Help with cycle~ waveform from buffer~
I'm having some serious trouble making a basic wavetable synth, here is my m4l instrument so far and the file I have been trying to use as my waveform. Every time I load the file in I get this awful sound, it is sort of at pitch but is a complete mess. Is anyone able to recreate this? Where am I going wrong?
The wavetable (the portion of the buffer~) used by cycle~ will be 512 samples by default; you can specify a different size if you want, as long as it's a power of 2. (See the reference page for the cycle~ object.) However, your sound file is 262 samples.
What's the best way to make a zero crossing audio sample to use as a waveform? I know I can get the existing info of a file from buffer but how should I make the waveform to begin with?
You can specify a (power of 2) number of samples in a buffer~ to read with cycle~, or you can read the whole buffer~ with cycle~, or you can use an arbitrary portion of a buffer~ with wave~. You can fill a buffer~ in non-real time with peek~ and then read it with a cycle~. Etc.
I guess what I'm wondering is, if I want to use an audio sample in cycle~ as my waveform, for example a recording of a square wave from my minibrute, what frequency would I have to sample to get a waveform which starts and ends with a zero crossing and fits perfectly within the 512 sample boundary, or some other boundary that is a power of two? For example above my sample was 262 samples long, and it was a single cycle of the pitch I recorded, so did I not choose the right frequency? Or is zero crossing not a property the waveform needs to have?
recording at 48khz you need a 93.75hz signal (48000/512) at 44.1khz you need an 86.133hz signal to fill the buffer.
Just as an update, I ultimately found the wave~ object much easier to use than the cycle~ object, because you can use a buffer of any length. The waveforms I recorded which have three cycles of a waveform and aren't at a particular sample length work just fine. Thanks everyone for you help though