|
Post by slowscape on Sept 21, 2019 20:31:15 GMT
I was wondering if anyone had a simple example of reading a CV from AE modular with an Arduino, and/or the other way around? I've tired many different configurations and none seem to work. CV from AE to Arduino shows a rapid 0-5v coming from the TRIQ164 regardless of the TRIQ sending a signal or not.
CV out of the Arduino to a VCO results in scrambled sounds. Below is the latest rendition that I've tried on an Arduino UNO as well as Nano: * CAUTION, I HAVE NO IDEA IF THIS CODE WILL DAMAGE SOMETHING. SO FAR MY EQUIPMENT SEEMS FINE... *
/* Attempt at sending a CV to AE VCO and also reading a CV from AE. */
int in = A1; // Analog 1 pin for reading CV from AE int out = A3; // Analog 3 pin for CV out to AE
void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); }
void loop() { //// READ AND PRINT INPUT FROM AE int cvValue = analogRead(in); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): float voltage = cvValue * (5.0 / 1023.0); Serial.println((String)"Voltage: "+ voltage); // view output from AE: tools>serial plotter
///// OUTPUT 5V TO AE, PLUG PIN A3 INTO A VCO's CV. analogWrite(out, HIGH); // should send a steady 5V TO AE }
If anyone has any tips or can fix my code it would be greatly appreciated. I beleive this simple example would be helpful for any Arduino based module as it should demonstrate a simple input and output.
I am much more of a programmer, dealing with actual voltages and hardware is both new and confusing for me!
Thank you!
|
|
|
Post by NightMachines on Sept 21, 2019 20:43:25 GMT
Check out this thread of a module of mine which does CV in and out: forum.aemodular.com/post/2957/threadAnd the Let’s DIY subforum might be a good starting point too: forum.aemodular.com/board/16/diyAlso maybe read a bit of the „Arduino for musicians“ book. Reading CV via analogRead() should just work, although you might need a pull-down resistor (also shown in the thread post above). Outputting 5V gates can be done with digitalWrite(). AnalogWrite() however only does pulse width modulation (PWM) usually and requires a filtering circuit, which is also shown in the example above. For a proper digital analog converter (DAC) you can use external ICs which the arduino can talk to.
|
|
|
Post by slowscape on Sept 21, 2019 21:23:26 GMT
Thanks NightMachines for the reply. I have seen your project, but it was a bit too complicated for me and this is why I was attempting to write something very simple, just for my own understanding.
It looks like you pull the voltage back down to ground after the switch is closed. How would this look when an incoming CV doesn't have a ground wire?
|
|
|
Post by NightMachines on Sept 22, 2019 7:57:42 GMT
What do you mean by “if incoming CV doesn’t have a ground wire”? There is ground on the Arduino and on the AE Modular power bus. Like I said, the Arduino for Musicians book is a great place to start, explaining the basics very well and quickly. In the DIY Tutorials in the Let’s DIY Together subforum I also give examples for pull-down resistor circuits and the components involved For example in this thread: forum.aemodular.com/thread/365/diy-project-02-passive-logic
|
|
|
Post by slowscape on Sept 23, 2019 3:13:19 GMT
I really don’t know. When I look at a circuit it’s like a foreign language haha. I’ll take a look at that book and go through your lessons, hopefully that will help. I guess I had too high of hopes, I thought I’d be able to just plug the two things together, and start coding. It’s obviously a little more involved
|
|
|
Post by NightMachines on Sept 23, 2019 6:31:47 GMT
It’s only a tiny little bit more involved, so don’t worry. Once you got the Arduino hardware basics down you’ll make full modules in no time, if you can already code
|
|
|
Post by slowscape on Sept 24, 2019 14:39:23 GMT
Tried my hand at the CV input again with what I believe to be a pull down, still no luck. I did however figure out how to send midi!
While CV input/ output would be preferred, I am now going to be working on a MIDI BPM + Sequencer that sends notes. I'll make a tutorial once it's finished while continuing to tinker with CV input/ output. Hopefully eventually I (or someone) can get a simple example in this thread!
|
|
|
Post by rodney on Sept 25, 2019 10:53:49 GMT
Thanks NightMachines for the reply. I have seen your project, but it was a bit too complicated for me and this is why I was attempting to write something very simple, just for my own understanding.
It looks like you pull the voltage back down to ground after the switch is closed. How would this look when an incoming CV doesn't have a ground wire?
Ground is the negative terminal of the power supply in both arduino and AE Modular. It slowly makes sense, once you've heard it explained in slightly different wording from different people.
I think that, and the pull down resistor, should get you a clean(ish) gate trigger in and out.
|
|
|
Post by slowscape on Sept 27, 2019 19:04:41 GMT
I completed the coding of my midi module, and am now working on moving it from bread board to module form.
The project has turned into a Turing Machine clone(ish). I've built in some of my own use-case features like a simple quantize feature. I'll make a post about it once finished. I then plan on working with cv circuits again, as that would be my ideal, rather than a midi module.
|
|
|
Post by slowscape on Sept 28, 2019 17:18:45 GMT
Everything but the buttons were working, realized I forgot a wire to them. Put the wire in but accidentally crossed the ground with power and never checked the circuit before plugging it back in. Fried the Arduino. So sad.
Live and learn
|
|
|
Post by NightMachines on Sept 28, 2019 18:38:16 GMT
Oh no! Hope you ordered a bunch of them. I recently destroyed my first Arduino too
|
|
|
Post by slowscape on Sept 28, 2019 20:02:04 GMT
One of three remain
The other issue I was dealing with was not having small potentiates available. These full size ones made it really difficult to work with.
I'm putting the project on hold until I get some small pot's and will re-build the board from the ground up.
Next project: Teensy effects with my Teensy 4. Fingers crossed I don't blow it up lol
On a side note, I was so frustrated that I bought a Beatstep Pro.
|
|
|
Post by rodney on Sept 29, 2019 8:58:27 GMT
On a side note, I was so frustrated that I bought a Beatstep Pro.
The healing power of credit card!
|
|
|
Post by slowscape on Sept 29, 2019 15:27:51 GMT
On a side note, I was so frustrated that I bought a Beatstep Pro.
The healing power of credit card! XD I don’t typically think of myself as materialistic, but in this case it’s definitely true!
|
|
|
Post by slowscape on Oct 17, 2019 23:50:22 GMT
EDIT: Actually, I'm not sure if this is correct. It seems the pull down is effecting AEM modules because the CV is being sent to ground. I don't know. It's weird. Electricity is weird.
Just an update for CV In, I finally figured it out! The resistor values for a pull down circuit matter. I found that 2K resistors are what AEM + Aruduino require.
Copy code below into falstad.com/circuit/circuitjs.html to explore circuit. $ 1 0.000005 10.20027730826997 50 5 43 x 403 92 455 95 4 24 AEM w 496 64 368 64 0 w 368 64 368 256 0 w 368 256 496 256 0 w 496 256 496 64 0 g 384 144 384 160 0 w 368 272 496 272 0 w 496 272 496 416 0 w 496 416 368 416 0 w 368 416 368 272 0 g 384 336 384 352 0 x 387 299 479 302 4 24 Arduino w 384 144 304 144 0 w 384 336 304 336 0 x 400 401 427 404 4 10 CV\sIN x 413 338 470 341 4 10 AUDIO\sOUT w 480 336 544 336 0 w 544 336 544 160 0 w 544 160 480 160 0 x 425 162 471 165 4 10 AUDIO\sIN x 395 113 433 116 4 10 CV\sOUT w 304 144 304 304 0 w 304 304 304 336 0 r 304 304 256 304 0 2000 w 384 112 256 112 0 w 256 112 256 304 0 w 256 304 256 400 0 w 256 400 384 400 0 x -40 126 223 129 4 24 PULL\sDOWN\sEXAMPLE x -28 145 215 148 4 15 FOR\sCV\sFROM\sAEM\sTO\sARDUINO x -32 164 217 167 4 15 (And\saudio\sfrom\sArduino\sto\sAEM) x -47 188 236 191 4 10 For\suse\swith\sArduino\ssynth\sand\seffects\slibraries\slike\sMozzi
|
|