Eurorack drum machine to show - and a question about Teensy 3.2 DAC

Status
Not open for further replies.

kallikak

Active member
Hi,

I had some spare space in my Eurorack and decided to make a little drum machine to fill it.

I used a Teensy 3.2 with samples and a LED matrix as the primary control for connecting beats to samples.

In "bar" mode they are beats in the bar, but in "poly" mode they are "every nth beat" - leading to much more interesting rhythms.

IMG_0159.jpgIMG_0160.jpgIMG_0163.jpg

Here's a short video demo:

https://youtu.be/IKqNawbhtcc

Anyway, I realised it would also be quite cool to have the output send pitch CV to mod a VCO so it could also work as a sequencer, so I wrote an alternative firmware to support that.

What I would like to do is support both - but I can't work out how to turn off the AudioOutputAnalog that is writing to the DAC so I can write to it independently when I am in CV mode. I can destroy and recreate the object, but then I think I will get stuck in the dynamic creation bugs in the Audio library.

I'd appreciate any thoughts.

Best I could come up with is using a constant DC source and so work within the audio library in both cases.
 
I was going to suggest you use my Dynamic Audio Objects library, which allows creation or deletion of AudioStream and AudioConnection objects on the fly, but then noticed you're using a Teensy 3.2 and I've only (so far) implemented it for 4.x. I don't have a 3.x to test on, and not much motivation as I don't think anyone else is using it...

Anyway ... would something like this work?
2021-07-28 21_37_28-Audio System Design Tool for Teensy Audio Library.png
For audio output you set mixer3.gain(0,1.0f), mixer3.gain(1,0.0f), mixer3.gain(2,0.0f); for CV either 0.0, 1.0, 0.0 and call dc2.amplitude() to set the level (a bit crude), or 0.0,0.0,1.0 and queue1.getBuffer() and queue1.playBuffer() to create sample-accurate output at the cost of a bit more processing in your code.

Cheers

Jonathan
 
Thanks for that. I did try the dc option with some success. I didn't think of using a queue, so I'll try that too. There seemed to be some glide in the steps so maybe the queue option will be cleaner.

I'm also a bit confused by the levels. I know what voltage I need to appear on the DAC to get the 1V/octave output from the little amplifier that follows it, but I don't know what the AudioAnalogOutput object does to the incoming signal.

Is it simply an input of 0 maps to 0V, and 1 maps to the analog reference voltage?

I assumed that at first but it wasn't in tune. It was late though and I could easily have muddled something while exploring options. I need to keep plugging into the rack to get the voltages for the op-amp, so there's only so much I can easily test using the computer. :)

I'll have another go today.
 
Must have been just working too late. :)

It's all good now - and proving a lot of fun.

I must say I'm very happy with my first use of the T3.2. Small, fast, and with a DAC! Glad to be able to avoid the audio shield for this little project.
 
Status
Not open for further replies.
Back
Top