I’ve written a table based oscillator class. Yay me!
Right now it can do a saw and a sin using simple algos, but I would like to use a more versatile approach.
So, I am thinking of using the binary builder to source-ify single cycle wav files, and have the class load one of them into the table at creation. Brilliant, if I may say so. I suspect its simple.
'Cept I don’t know how exactly.
So, given this set up (roughly):
int TableSize = 512;
float * table = (float*)malloc(TableSize * sizeof(float));
for(int i = 0; i < TableSize; i++){
table[i] = [nab float from BB file here];
}
This is tougher than I thought. The wav reading thingummy does not have a method equivalent to what the image thingummy has.
Maybe the easiest way would be to save the wave cycle files as ‘raw’ 16/44100 with zero header and tail, and try and piece the floats together from that…
So, as an alternate question to the original one:
How does one make a float from two chars?
(Answer: You put one in the backseat and one in the fridge.)
I want waveforms that do not lend themselves to algorithmical generation, and I want a lot of them.
The synth I posted above reads the table directly from the static array that binary builder files create, and you can swap them on the fly easily enough.
The 6 waveforms added roughly 12 Kb to the exe so there is really no need to save space.
Also, I just like the workflow of making waveforms in a sample editor, and the compile them into a synth, and then see the same waveform come out the other end. Its like the circle of life or something.