[sdiy] Wavetable Design Update
Paul Maddox
paul.Maddox.mail-list at Synth.net
Thu Feb 3 08:41:26 CET 2011
Matt,
> I thought HUH, too. I'll have another look at the code to make sure that
> it's not anything daft like the DATA being out (as in something that can't
> be represented as an unsigned char in there) and avr-gcc (for such it is)
> trying to be clever and giving me a different type, rather than an error.
>
> I just know that when I was looking to save space, I whipped out what I
> thought was 128 bits worth of waveform and, well, it didn't add up.
bits? or bytes?
128 bytes of unsigned char should be 128bytes of unsigned char, you
should use a couple of bytes more RAM for the pointer.
> Which looks like an AND and a shift, at first glance, so no conditional
> required. (Unless ANDing with an intermediate value and doing a conditional
> is more efficient than the shift.
actually, you can cheat.. I just remembered what I did with the monowave.
forget the 32nd bit, use the carry over flow bit.
so when the accumulator overflows (i.e. it gets bigger than 32 bits
and resets) a carry/overflow flag is raised.
Use that to "flip" (just like a flip flip) a pin on an IO port.
> That's EXACTLY the layout I was proposing. So the only thing that really
> changes with the phase accumulator approach is the software.
See this page if it helps - http://ppg.synth.net/wave22/
I explained how it works in a PPG Wave 2.2
> I'd
> actually been persevering with the other technique as a means of avoiding
> getting my head around phase accumulators which *looks* hard to me at first
> glance.
it's one of those things that the moment you get it you'll kick
yourself at how obvious it is :-)
Paul
More information about the Synth-diy
mailing list