VCV-Prototype icon indicating copy to clipboard operation
VCV-Prototype copied to clipboard

Access to neighbor JSON values [enhancement]

Open firolightfog opened this issue 2 years ago • 1 comments

I'd like to propose a feature to get and set values of a neighboring module by VCV Prototype.

Currently the values can be copied into the clipboard (Ctrl-C, Ctrl-P) in JSON format (and easily modified in a text editor before copying it back). The JS motor of Prototype would be an excellent tool to make basic modifications to this JSON. But reading the API and the forum pages I've learnt that currently there is no way to do this.

Example: Bogaudio MIX4 has great polyphony features but lacks of 'toggle mute'. Instead of chasing the developer to add the feature, any user could use Prototype to toggle with a switch, or randomly, or by knob/input value.

Example: Voxglitch Digital Sequencer allows manual randomization (see 'r') of the active sequence. But its randomization follows the 'one-or-all' rule. It's impossible to extend the randomization to a set of tracks. Instead of chasing the developer to add the feature, any user could use Prototype to randomize step 1-8 simultaneously in track 1-3 with a single button press.

Example: StochSeq4 provides four sequences of stepped CV and gates. But it's impossible to copy one of the tracks to the other one. Instead of chasing the developer to add the feature, any user could use Prototype to copy sequence A to track B with the same values (or shuffled) with a button press.

Please note the difference to Stoermelder 8FACE module. That allows recall of values based on previously saved templates. This proposal is about giving a simple tool (JS motor of Prototype) to randomly or programmatically change the values to something new.

OK, I know it's not the most burning issue at the time of Rack V2 approaching and I don't have a clue of the complexity of this change but I thought I put it here for future consideration.

Best regards, Andras

firolightfog avatar Oct 13 '21 12:10 firolightfog

config.frameDivider = 1
config.bufferSize = 32

function process(block) {
	// Per-block inputs:
	// block.knobs[i]
	// block.switches[i]

	let tempjson=getNbrJson(me.leftModuleId)
	tempjson.data.percentages=false
	setNbrJson(me.leftModuleId,tempjson)

	for (let j = 0; j < block.bufferSize; j++) {
		// Per-sample inputs:
		// block.inputs[i][j]

		// Per-sample outputs:
		// block.outputs[i][j]
	}

	// Per-block outputs:
	// block.lights[i][color]
	// block.switchLights[i][color]
}

firolightfog avatar Oct 19 '21 10:10 firolightfog