PaulSlocum wrote:And I think I've figured out how to do vibrato -- just resample, distributing the samples earlier/later using a sine wave to control the time displacement.
for( i=0; i<(length/2); i++ ) // note: length/2 because my length is in bytes but sample is 16 bit
rawDataShiftPos = i + sin(i/44100.0)*100.0; // 44100.0=vibrato rate 100.0=depth
dataShiftPos = (long)rawDataShiftPos;
dataShiftPercent = rawDataShiftPos - dataShiftPos;
if( (dataShiftPos>=0) && (dataShiftPos<(length/2)) )
// accounts for offsets that fall between sample points -- distribute them between the two points
memcpy( inputWave, tempBuffer, length );
PaulSlocum wrote:Vibrato works
PaulSlocum wrote:all integer math, and no between sample consideration if you're willing to sacrifice a little sound quality for speed.
PaulSlocum wrote:Could probably do it with a sine lookup table
PaulSlocum wrote:I'm using it for the software at the link below that I'm developing. An effect I use often in my music is to have a very slow, very subtle vibrato on most tracks, which is what I'll be using it for.
Users browsing this forum: No registered users and 4 guests