From the original SynthMaker forum (2004–2014), with its members’ names and dates.
subrock ·
Hello, I am tryig to code a simple delay using a buffer. There is something wrong(no sound) and I'd appreciate it if someone could figure out what I'm doing wrong.
Not sure what's wrong. Here's the code I use for a delay.
streamin in;
streamout out;
monoin offset; //delay in samples
float array[88200];
float index; // index of input write
float outdex; // index of output read
offset = rndint(offset);
index=index+1; //increment index
index=index-(index>=88200)&88200; //deal with overflow of write index
array[index] = in; // write to array
outdex = index - offset; // calc read point
outdex=outdex + (outdex < 0)&88200; // deal with overflow of read index
out=array[outdex]; // read array to output
It looks roughly equivalent to yours. Could be the round integers don't work inside variable assignments for arrays.
Shifrin ·
subrock wrote: dlybuffer[rndint(i)]=in;
It's been a while since I've played with SM, but I am pretty sure it doesn't like expressions/function calls used as an array index - unless things have changed - I had lots of problems with this and in the end had to use a temporary variable like :-
tmp = a*x +b*y etc...
somevar = array[tmp];
Shif.
ROMplERbuDE ·
Hy all,
here is an example. I added a 3rd var, (t) for (timeconversion). 😀
Hope that this is what you mean?