thedreiskre
Active member
I have managed to create wavetables containing ~5 waves by assigning them to seperate waveform objects and then fading between them. However this is starting to get quite CPU intensive for more waves. I have been trying to figure out the best way to adapt the waveform arbitrary code, to allow for wavetables in 1 object. My plan is to store the table position as a float, eg. 1.7 would be somewhere between wave 1 and 2. Then have 1 sample from wave 1 have a "weight" of 0.7, and 1 sample from wave 2 have a weight of 0.3. My intention was to have the waves be stored in a single long array of integers, then have the table position value be an offset. So for example, a position value of 1.7 would result in an offset of (1 * 256) for wave 1, (2*256) for wave 2, and a mix of (0.7 * wave1) and (0.3 * wave2). Okay so this sounds simple enough, however when i was trying to see how to implement it, I couldn't understand a lot of the existing waveform arbitrary code. How would the offset be done? and would having a longer arbdata array break all the existing code? also, what is going on with all the pointers and scale and *bp++ ?
Sorry if this is either painfully simple, or overly optimistic, I haven't been using c++ for too long so please go easy
Sorry if this is either painfully simple, or overly optimistic, I haven't been using c++ for too long so please go easy