Forums > MaxMSP

how to start at x sample in a wavetable?

July 1, 2010 | 7:28 am

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?

Thanks for your help!

ana


July 1, 2010 | 8:11 am

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


July 1, 2010 | 3:04 pm

@ 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


July 1, 2010 | 3:34 pm

Thanks Alex, of course you’re right


Viewing 4 posts - 1 through 4 (of 4 total)