What i'm imagining is an insert effect with one switch (on/off) and one slider (speed). When turned on, the incoming audio will be slowed to a stop at a speed determined by the slider. When turned back off, the audio will play through as normal.
Here's the main part of code that same used to create the pitch-drop plugin in synthmaker:
My first question: is something like this possible in sonicbirth? and if so, what kind of modules should i be investigating?monoin in;
monoout out;
monoin delay;
// Sam Bean interpolated delay 2005
float index;
float f,frac;
float temp1,temp2;
float mem[88200]; // An array with 88200 slots, enough for 2 secs of sampling
// The delay value is split up into f (delay: whole samples)
// and frac (delay: extra fractions of a sample).
temp1 = delay - 0.4999; // rndint rounds to nearest integer, we want to round down...
f = rndint(temp1);
frac = delay - f; // The fractional part of the delay
index=index+1;
index=index-(index>=88200)&88200; // Reset main pointer
// when it reaches 88200
mem[index]=in; // Write current input value to memory array
temp1 = index - f; // Read pointer is delayed f samples behind current index position
temp1 = temp1 + (temp1 < 0)&88200; // if temp1 ends up a negative number
// , add 88200 to it so that it corresponds
// with one of the last 'slots' in the array.
// (before the main index was reset)
temp1 = mem[temp1];
// Now retrieve whats in the slot _before_ the one
// we just retrieved. This is incase the delay input wasn't set to a whole
// sample value, and we have a fraction of a sample we still need
// to take into consideration (frac).
temp2 = index - f - 1; // Read position f-1 for interpolation.
temp2 = temp2 + (temp2 < 0)&88200; // If temp2 ends up a negative number
// , add 88200 to it so that it corresponds
// with one of the last 'slots' in the array.
// (before the main index was reset)
temp2 = mem[temp2];
// Now we use the value of frac to do a weighted 'blend' between the
// two values we retrieved (interpolation).
out = (1 - frac) * temp1 + frac * temp2;
Thanks for your time.[/quote]