[sdiy] Wavetable Design Update
Matthew Smith
matt at smiffytech.com
Thu Feb 3 05:04:26 CET 2011
Quoth Paul Maddox at 03/02/11 13:02...
...
> HUH?
> What compiler are you using, that's wrong, so very wrong.
> you don't have chars promoted to int or something do you?
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.
> ahhh, ok, I forgot that part.
> You don't have enough IO on that to do what I suggested.
Think I found I was tight on pins for other stuff as well, as I am using
pins to set the I2C ID (probably 3 pins) as well as having pins
allocated to trigger and gate. (Also keeping the SPI pins free just for
programming.)
> Use the phase accumulator approach.
> Only don't use 8 bits for address, just use the MSBit as your output
> to your counter circuit.
> All your ATTiny2313 need do then is the following;
Right. Pin count stays the same.
> if MSBit of accumulator = 1, set output pin high
> else if MSBit of accumulator = 0, set output pin low
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.
...
> Just do that in your main loop and *nothing* else.
> The you have a UART RX interupt, and you have such that you send the following
Yeah - might still use UART, with a device address byte in addition to
that list.
...
> to get a second oscillator, you could easily use the same MCU, like
> this (excuse bad ASCII)
>
> MIDI -> MCU(MIDI) -> Tiny2313 (Oscillator 1) -> CPLD -> EPROM -> DAC
> -> Tiny2313 (Oscillator 2) -> CPLD -> EPROM -> DAC
That's EXACTLY the layout I was proposing. So the only thing that really
changes with the phase accumulator approach is the software.
> superb, there's a whole chapter on phase accumulator oscillators.
> It's a great book, wish I had kept my copy now.
Which I will proceed to read, in addition to the Wikipedia reference.
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. However, at least I've found that there are some
interesting issues in my approach, so I can't say I haven't tried that
way before diving into PAs!
Thanks again.
Cheers
M
--
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business: http://www.smiffytech.com/
Blog/personal: http://www.smiffysplace.com/
LinkedIn: http://www.linkedin.com/in/smiffy
Skype: msmiffy
Twitter: @smiffy
More information about the Synth-diy
mailing list