Building a 'record stop' effect. hints? clues?

Official support for: sonicbirth.sourceforge.net
Post Reply New Topic
RELATED
PRODUCTS

Post

A while back Sam Bean kindly built a 'record stop' effect in synthmaker. Since moving to a mac i've been trying to find a replacement but without luck so far. My hope now i that it might be possible to recreate in sonicbirth, perhaps someone on this forum can let me know if this is feasable or not, and perhaps gove a few initial pointers about which modules will be most useful.

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:
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;
My first question: is something like this possible in sonicbirth? and if so, what kind of modules should i be investigating?

Thanks for your time.[/quote]

Post

just a delay module, with the delay value increasing (0.5 second / wall clock second will give half pitch, 1 second / wall clock second will give a full stop).

all the blocks you need are already there.

Post

Thanks! Can you explain what you mean by wall clock second? I couldn't find a reference to it in the manual.

Post

cbit wrote:Thanks! Can you explain what you mean by wall clock second? I couldn't find a reference to it in the manual.
lol i understand! sorry. Wall clock second == 1 second.

Post

Thanks for the replies. Here's what i currently have:

Image

It's almost working correctly. The problem I'm having is that when i activate the boolean switch, the sound drops in pitch as intended, but continues past the 'stopped' point, and starts to speed up in reverse, while i want it to stop changing speed at the 'stopped' point!

If anyone can see what I'm doing wrong here I'd very much appreciate a pointer. Thanks again!

Post

The way I got around that was to use the timer output to also change the amplitude of the audio signal and rapidly cut it when it when the tape was just about to stop. Then, who cares what the delay line does after that since you can't hear it.

First I used a comparator to enact this kind of logic (where c is a constant) if time < c then output 0. If time > c then output time - constant. Then, as soon as time > c you get an output that starts at 0 and runs positive. I think I used that as the input, x, to a pretty severe exponential decay function e^(-rx) where r was a constant I input from a slider to control the rate of decay. I played with the slider until it sounded right, but a large value obviously kills the audio faster. Then I just multiplied the output of this function (which starts at 1 and approaches 0) with the audio output. The trick with all of this was to get the constant c correct so that the rapid amplitude decay started happening right as the tape stopped.

As an aside, I think at one point I played with also a low pass filter whose cutoff lowered from 20k to 0 in a similar fashion so that the sound got a little darker as the tape slowed. It sounded a little more natural to me.

Hope this helps.

Post

Thanks for the information, this is very useful. I'm going to follow roughly the same approach.

Post

Thanks for all the help! I got it done.
Image
Incase anyone else is interested here are the files:
Component
Source

Post

thanks cbit

I will definitely use this. I never did finish the one I started to make a year ago and I don't think I could even find the file. Cool.

Post

ps. I hadn't yet found the "Next" button while making this so everything is on the root circuit. ie. It's a bit of a mess ;)

Post Reply

Return to “SonicBirth”