Generate CV's in the overtone series without the Prototype module?

In the previous version of Rack, I used the Prototype module to create control voltages with pitch intervals that correspond to the overtone series with the following code:

config.frameDivider = 1
config.bufferSize = 32

function process(block) {
	// Per-block inputs:
	// block.knobs[i]
	// block.switches[i]
	for (let i = 0; i<6; i++) {


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

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

			block.outputs[i][j] = Math.log2(Math.round(Math.pow(2, block.inputs[i][j])))
		}

	}

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

I asked about how to create CV in the overtone series this on Facebook years ago where Andrew Belt kindly responded with the function and a friend of mine later helped me put this code together using one of the templates that shipped with Rack.

But now, the Prototype module is no longer available in the current version.

I’ve tried recreating this function using the Funktion and Algebra modules created by Clément Foulc by combining them in different ways, but I’ve been unsucessful so far.

How would you “translate” the function block.outputs[i][j] = Math.log2(Math.round(Math.pow(2, block.inputs[i][j])))in to a patch?

/Paerox

e.g. like so: overtone

2 Likes

I made a module for this purpose:

2 Likes