how to start at x sample in a wavetable?

Jul 1, 2010 at 7:28am

how to start at x sample in a wavetable?

Hi,

From the cycle~ helpfile I get this information:

“The cycle~ object is an interpolating oscillator that reads repeatedly through one cycle of a waveform, using a wavetable of 512 samples”

- now my question is: How do I set the cycle~ to start at sample 300 or sample 100?

ana

#51146
Jul 1, 2010 at 8:11am

multiply phase offset (0. to 1.) by samplerate. So, an offset of 0.5 @ 44.1kHz = 22050 samples (500ms). To determine the amount of offset needed to generate a 100-sample offset, divide 100 by samplerate (44.1k); 100/44100 = 0.0022675.

Brendan

#183446
Jul 1, 2010 at 3:04pm

@ brendan mccloskey – The phase offset is relative to the number of samples in the wavetable (512 – 0-1 is 0-512 in samples), so I don’t think you need to account for the samplerate here – a 100 sample offset should be 100 / 512 = 0.195…..

@anamaria Regardless of the above, you should note that the phase offset input sets the offset into the wavetable, not the instantaneous phase (the phase at a particular point in time).

If you need to set the instantaneous phase you’ll need to use a phasor~ connected to a cycle – like this:

– Pasted Max Patch, click to expand. –

Regards

Alex

#183447
Jul 1, 2010 at 3:34pm

Thanks Alex, of course you’re right

#183448

You must be logged in to reply to this topic.