Hey guys! I’m a noob here, so forgive the potentially dumb question…
I want to turn audio signals into midi-cc values. I plan to implement some kind of envelope follower to turn the audio signal into a usable control voltage, then into midi cc from there.
My question is: can I just input the audio into the ain module, and then perform the envelope following digitally, using the pic in the core module? I was originally planning to use a hardware envelope follower design, but I thought that if I could use the core module to do this, I would save money and time and maintain more design flexibility.
I need to do a minimum of 4 distinct audio stream>>envelope followers.
Your best bet in terms of ease of programming and reliability would be to take a leaf out of old audio compressor design and use an optical coupler or similar strategy.
The basic premise is that you:
connect a light source (ie an LED) to your audio signal (I would suggest using an op-amp buffer to avoid overloading your audio output, and to give you more juice to drive the LED). Also, the op-amp wants to be optimised so that your hottest signal will give it nearly +5v output.
physically coupled to this LED (and shielded using black tape or a small tubing sleeve, you connect an LDR device.
connect one lead from the LDR to ground, the other end to the analog input on the PIC.
The pic would then treat the LDR as a voltage source, not too different to a pot or fader.
This is the concept. You’ll find it needs a little refining and experimentation.
I would then need to turn the volume of each signal into a midi-cc value which could be mapped to parameters in a synth engine. Now I could use vactrols or some other analog envelope follower method to create a usable voltage to put into an AIN module, but I was wondering if I could avoid that extra work by simply inputting the raw audio (scaled appropriately of course) to the AIN, and implementing envelope followers in the code.
@ playbo$$- That VST looks awesome, but I don’t necesarily want to use a computer with this midi controller. Thanks for the link, though.
OK based on what A.C. says I am gonna go ahead and give this a shot. If I can’t do a digital env follower in the box, then I will just go ahead and build analog env followers.
Does anyone know what the sample rate of the AIN module is? Same as the core(40mhz)?
If anyone has any thoughts or questions on this project, let me know.
Unprocessed audio into AIN wouldn’t give the results you’re looking for. The sampling rate is not high enough, so as a result you’d get somewhat unpredictable results - and if you tried to “smooth” the input in software it would likely introduce far too much latency.
You will need an analog envelope follower of some sort at the input stage. There is a variety of simple envelope follower schematics all over the net, including a couple that don’t appear to require expensive and fragile vactrols:
the PIC ains go into a single successive approximation ADC so its a single converter . Nebula says processing these signals would take big effort and mcu cycles, I think he is right. Please check THAT2252 datasheet and app notes it might be what you want (…)
the PIC ains go into a single successive approximation ADC so its a single converter . Nebula says processing these signals would take big effort and mcu cycles, I think he is right. Please check THAT2252 datasheet and app notes it might be what you want (…)
Also, the “audio” that I will be tracking is kind of irrelevant, so I can tailor it to the processing. I am tracking the vibrations of guitar strings, and I am not using the audio for any other thing. The strings could all be tuned to the same note for all I care. I just want it to feel like a normal guitar and extract a usable envelope.
Tomorrow is payday, so I’ll order the pcbs and such and get started. Thanks everyone for the info and advice.