I was looking for a simple, cheap oscillator to "drive" other modules, like the APC. I realized the cheapest way would be to do it with grains, even if it means I should buy another (have two ATM).
So I wrote a simple square wave oscillator for grains. It's calibrated (in code) here to be in tune with the lower knob fully CCW and one octave up with the lower knob all the way CW. Upper knob turns on optional quantization to semitones. Middle knob is not used.
Quick demo here:
Code here:
https://github.com/attejensen/grains/tr ... er/sqr_osc
There are still few issues:
1) I'm using tone() to play the square wave. However there are some hick-ups in the audio every now and then. I'm guessing it's because the 1V/oct is changing slightly, which causes the wave to change abruptly. I added some smoothing of the CV, which helps a bit, but still. Any ideas on how to improve this? Maybe using something better than tone() to generate the wave?
2) In principle quantization on/off should be CVable through in 1, however sending something (too hot?) in affects the tuning in a strange way. As far as I understand, the upper knob and in 1 are "linked" so that with no jack in the knob determines what's on the pin, with a jack in the knob becomes a attenuator for the incoming CV. Any thoughts on why this happens would be appreciated!
And finally a few questions related to grains in general:
1) Why does the module behave different (same CV in input 3 gives different results) when powered over USB compared to powered from the rack? Only tried this with my old grains, might be something with my build, although the module works fine otherwise.
2) Is it OK to have the module connected to computer AND powered from the rack at the same time or will this blow up the arduino? I didn't dare trying this, which means that because of the inconsistent behavior based on where powered from, there's a lot of pulling cables, especially when calibrating pitch of my code.
Naturally if anyone is brave enough to try the code, I'll be really interested in any observations, especially improvements on the code
