|
Post by NightMachines on Jul 16, 2019 15:26:29 GMT
EDIT: The module is finished for now and I've released the schematics and source code in this post below. I'd recommend that you still read the thread from the beginning though, to understand more about the project and maybe modify it to your taste -------------------- In the module wishlist thread thundersound voiced a cool idea of an event-based generative CV sequencer, which I would like to try and DIY. But first, here's his explanation: What I really would like is a evolving CV based on "events". Events could be clock pulse / trigger / start of gate / end of gate / height of voltage (comparator) / peak detection, it could be a lot of different things. But lets take a trigger as expample. The module has a starting voltage Knob and/or CV input. So without Triggers it will output that voltage in the pitch output. There is a trigger input, a trigger count Knob X (minimal 1 to 5), a voltage knob Y, and an pitch output. So for every X triggers, the module adds a voltage of Y to the existing voltage. Lets say the Starting Voltage Knob is set to 1V. The Counter knob X to 2 triggers. And the Voltage Knob to 0,1 V. When the system starts the output is 1 V. After the first trigger it is still 1V But after the 2nd trigger the output is 1,1 V. and after the 4th (next 2nd) trigger the output is 1,2 V. I think there could be more lanes with inputs and knobs, and there could be different kind of events. The lanes could be have their own outputs but it is also possible to have a combined output. so 1 event could add a small voltage, and another could substract a small voltage and another resets to the base voltage for example. And also something like a max.voltage, and things like direction, and a kind of bounce effect is also handy. I am always prepared to share more thoughts about this module and also prepared to test work if needed. That does indeed sound cool! I still have a bunch of Arduino Pro Micros sitting around here and I thought I'd ponder how to create such a sequencer with one of them. First, of course, we need to check the limitations. Here's the pinout of the Arduino: Teal pins can be configured as digital inputs or outputs, which means they can either receive or send HIGH and LOW signals (e.g. +5V or 0V), but no values in between. This is good for clocks, triggers and gates and for reading push buttons and switches. Green pins can be configured as analog inputs, which measure voltages between 0 and +5V and convert them into 10bit integers, i.e. values from 0 to 1023. This is good to process incoming CV or read potentiometer values. Red pins with a checkmark/tick ✓ can be configured as pulse width modulation (PWM) outputs. This PWM is just like your square wave VCO PWM feature, only faster. It can act as kind of an analog output, by averaging the HIGH/LOW signal times. E.g. if the pulse wave is 50% wide, meaning it is HIGH half of the time and LOW the other half of the time, then the average value would also be 50% of the signal range, or about +2.5V. Of course it is still a normal jaggy square wave, but one can smooth and average the output into a constant analog voltage by using a simple lowpass filter circuit. This is not perfect though, but because we want to generate slowly changing CV which doesn't have to be super precise, it might work well enough. The Arduino Pro Micro does not come with an onboard Digital-Analog-Converter (DAC) for precise analog voltage output, although we can control an external one. But let's try PWM first. Okay, we can configure the pins only as one type of input or output, so now we have to choose. How many potentiometers do we want? How many CV inputs? How many PWM/analog outputs? How many trigger/gate inputs or outputs? I thought about this last weekend and came up with the following idea, based on thundersound's explanation: There are three separate event "lanes" with their own inputs and outputs: 1. Trigger or rising Gate: Whenever a rising Gate is detected, voltage is added or subtracted to the output according to a bipolar potentiometer 2. Falling Gate: Whenever a falling Gate is detected, voltage is added or subtracted to the output according to a bipolar potentiometer 3. CV threshold: Whenever an incoming CV rises above a threshold set by a potentiometer, voltage is added or subtracted to the output according to a bipolar potentiometer. The condition can also be reversed with a manual switch, so that the voltage is added/subtracted if the incoming CV falls below the threshold. We also want to be able to set an offset to our output CV and maybe we can cram in some CV control over certain parameters. Let's make a list of inputs and outputs next and assign them to the Arduino pins. Digital Switch Inputs:- Lane 3 condition switch (D2)Digital Trigger/Gate CV Inputs:- Lane 1 Trigger input (for rising trigger/gate detection) (D0)- Lane 2 Gate input (for falling gate detection) (D1)- Lane 3 rise above/fall below behaviour control (inverts the condition) (D7)Analog Potentiometer Inputs:- Global offset pot (A2)- Lane 1 pot for addition/subtraction amount (A6) - Lane 2 pot for addition/subtraction amount (A7)- Lane 3 pot for addition/subtraction amount (A8)- Lane 3 pot for threshold value (A3)Analog CV Inputs:- Global offset CV input (to add to out CV output) (A0)- Lane 3 CV input (to compare to our threshold) (A1)PWM Analog Outputs:- Lane 1 + offset output (D3)- Lane 2 + offset output (D10)- Lane 3 + offset output (D5)- Sum of all lanes + Offset output (D9)This will use up all pins except D14, D15 and D16, which we could maybe use to generate gates/triggers or to read digital data. Here's a little sketch of how the module could look like. I assume I'll need 2U. Alright, that's where I'm at. I will continue to post further developments as they come and walk you through all the steps I took from thundersound 's idea to a (hopefully) working DIY module. If you have any suggestions or want to work on your own DIY sequencer like this at the same time, let me know and we can share this thread
|
|
thundersound
Junior Member
A modular world .. from Aa to Thunder and beyond
Posts: 82
|
Post by thundersound on Jul 16, 2019 17:51:37 GMT
Cool to see this post Very curious if all is possible, hope that it works out well. So soon I need to learn much more about Arduino it seems ..
|
|
|
Post by NightMachines on Jul 16, 2019 19:27:11 GMT
So soon I need to learn much more about Arduino it seems .. I just whipped up some Arduino code and I think (hope) that I’m already done with the basic functionality. It’s not very complicated ... if it indeed works. Of course I’ll post the code once I have tried it on the hardware. While I was coding, I also implemented another switch (D14) and gate (D15) input to set wether the values will just stop growing above +5V and below 0V, or if they will wrap around. In the latter case a theoretical internal value of 6V would not be clipped by the output to 5V, but it would roll over and become 1V. This works in both directions, so -2V would become +3V, etc. This means that we have one more gate or trigger input or output left on the Arduino. What should we do with that? Another toggle switch for something? A gate input to reset all the lane values to 0 (so it only outputs the offset)? Or a gate output that goes high when a certain condition is met? Here is an updated module layout scribble with color coding for the three lanes: I’m not sure when I will have time to build a hardware prototype, but I hope in the next two weeks. It shouldn’t take more than half a day and I’ve already got all the components here.
|
|
thundersound
Junior Member
A modular world .. from Aa to Thunder and beyond
Posts: 82
|
Post by thundersound on Jul 16, 2019 19:50:01 GMT
So soon I need to learn much more about Arduino it seems .. I just whipped up some Arduino code and I think (hope) that I’m already done with the basic functionality. It’s not very complicated ... if it indeed works. Of course I’ll post the code once I have tried it on the hardware. While I was coding, I also implemented another switch and gate input to set wether the values will just stop growing above 1023 (5V) and below 0 (0V) or if they will wrap around. In the latter case a theoretical internal value of 6V would not be clipped by the output to 5V, but it would roll over and become 1V. This works in both directions, so -2V would become +3V, etc. This means that we have one more gate or trigger input or output left on the Arduino. What should we do with that? Another toggle switch for something? A gate input to reset all the lane values to 0 (so it only outputs the offset)? Or a gate output that goes high when a certain condition is met? Here is an updated module layout scribble with color coding for the three lanes: I’m not sure when I will have time to build a hardware prototype, but I hope in the next two weeks. It shouldn’t take more than half a day and I’ve already got all the components here. Sometimes we need more inputs/outputs, oh maybe it is even always, that is closer to my experience I had 2 complementing idea's for the current flow: - the first is a reset switch/triger, to go back to the offset current. It could be possible to do that not for all lanes, but only for the first 1 or 2 lanes. - the second idea is to let 'bounce' 1 lane, so if that lane reaches 5V the rise positive addition will be substracted, (and from then the substraction will be added instead of subtracted) this could be a gate I think, or even without reaching the 5V to switch the behaviour, then it could be a direction switch trigger. But maybe this is too similar to the conditional switch.
|
|
|
Post by NightMachines on Jul 17, 2019 6:23:31 GMT
I had 2 complementing idea's for the current flow: - the first is a reset switch/triger, to go back to the offset current. It could be possible to do that not for all lanes, but only for the first 1 or 2 lanes. - the second idea is to let 'bounce' 1 lane, so if that lane reaches 5V the rise positive addition will be substracted, (and from then the substraction will be added instead of subtracted) this could be a gate I think, or even without reaching the 5V to switch the behaviour, then it could be a direction switch trigger. But maybe this is too similar to the conditional switch. Great ideas! I left away the “threshold above/below” gate input (so there’s only a manual switch for that now) and added a “reset 1&2” gate input and a “bounce 2&3“ gate input. The cool thing about all this, is that it’s all software and can be programmed differently easily. New mock-up: All arduino pins are now in use, so in order to add new features we would have to leave others away. I like this idea though and will try to build a prototype as soon as possible The cv/gates inputs, switches and pots can then still be programmed differently.
|
|
thundersound
Junior Member
A modular world .. from Aa to Thunder and beyond
Posts: 82
|
Post by thundersound on Jul 19, 2019 8:25:33 GMT
I had 2 complementing idea's for the current flow: - the first is a reset switch/triger, to go back to the offset current. It could be possible to do that not for all lanes, but only for the first 1 or 2 lanes. - the second idea is to let 'bounce' 1 lane, so if that lane reaches 5V the rise positive addition will be substracted, (and from then the substraction will be added instead of subtracted) this could be a gate I think, or even without reaching the 5V to switch the behaviour, then it could be a direction switch trigger. But maybe this is too similar to the conditional switch. Great ideas! I left away the “threshold above/below” gate input (so there’s only a manual switch for that now) and added a “reset 1&2” gate input and a “bounce 2&3“ gate input. The cool thing about all this, is that it’s all software and can be programmed differently easily. New mock-up: All arduino pins are now in use, so in order to add new features we would have to leave others away. I like this idea though and will try to build a prototype as soon as possible The cv/gates inputs, switches and pots can then still be programmed differently. I was thinking about the gates / switches. Would it be possible to reintroduce the “threshold above/below” gate input, and 'OR'it with 2 diodes with the switch for that function? With this method they could be using just 1 Arduino port. Then the same could be possible with the Limit/Wrap Switch and gate, and that will even free a gate. There could be a small loss of current when using diodes, but for a gate signal that should not be a huge problem I think. The freed port could be used for a separate reset trigger for the 3th lane. Also could there be manual momentary buttons for the reset gates with a 'OR' diodes. And for the "bounce"gate there could also be a complementary (toggle) switch.
|
|
|
Post by NightMachines on Jul 27, 2019 15:11:17 GMT
I built the thing today! Yay! Need to put it behind a front panel still, but everything else is done and works. Here’s a quick video: http://instagram.com/p/B0bJcKVoWDC All modulation (filter, pwm, etc) apart from the slow four-note melody is coming from the DIY module which receives various DIVIDER gates and LFO signals, which it turns into evolving stepped-CV patterns. I was thinking about the gates / switches. Would it be possible to reintroduce the “threshold above/below” gate input, and 'OR'it with 2 diodes with the switch for that function? With this method they could be using just 1 Arduino port. Then the same could be possible with the Limit/Wrap Switch and gate, and that will even free a gate. There could be a small loss of current when using diodes, but for a gate signal that should not be a huge problem I think. The freed port could be used for a separate reset trigger for the 3th lane. Also could there be manual momentary buttons for the reset gates with a 'OR' diodes. And for the "bounce"gate there could also be a complementary (toggle) switch. I thought about this, but I prefer to have those gate inputs separate and not OR’d with the switches, as an OR gate doesn’t let me invert the switch position. So when the switch is on, the gate CV won’t do anything. All gate inputs can of course be OR’d externally with a switch though. Playing a bit with it, your idea of the “bounce” which makes CV move up and down between 0-5V is great though. So far I only programmed the “bounce” gate input the invert the poti values, but this of course is different as they will still reach and stay at 0 or 5V like this. The “wrap” feature is fun but also quite a strong effect, because it jumps a full 5 volts ... hmmm ... I’ll think so more about it. It was a very easy build on the whole, but even in 2U it was getting cramped with all those cables. Edit: by the way, this is my first DIY with properly buffered outputs! Haha! Finally, I’m using op-amps!
|
|
thundersound
Junior Member
A modular world .. from Aa to Thunder and beyond
Posts: 82
|
Post by thundersound on Jul 27, 2019 16:56:34 GMT
Top !! I really like the video ..
|
|
|
Post by NightMachines on Jul 27, 2019 17:04:00 GMT
|
|
|
Post by NightMachines on Jul 27, 2019 17:13:57 GMT
... and some pictures. Getting all the parts together while warming up the soldering iron: Trying out the component placement on the 2U wide PCB: All soldered and ready for testing! Had one faulty solder connection but nothing else that didn’t work ... although at first nothing worked because that Arduino Pro Micro came flashed as a Leonardo or something. Thought I’d blown the whole thing initially, but then it turned out alright with the proper software upload. Phew!
|
|
|
Post by NightMachines on Aug 4, 2019 19:21:24 GMT
I uploaded my schematics and source code to GitHub, for anyone who wants to build the module: github.com/TuesdayNightMachines/AEModular/tree/master/Generative_CV_SequencerMy final 2U front panel mock-up (how I found it easiest to cram everything on the PCB): Here are the schematics as well: I bought the Arduino Pro Micro here: AliExpressAnd here's a description of how it works with the source code on GitHub: Possible improvements or changes you could tackle: - Scale the CV outputs to the Op-Amps' rail-to-rail range (i.e. 0V to a little bit below 5V) either in software or using a voltage divider. - Try out lower resistor values, even down to 270 Ohm, for the RC Filter circuits on the CV outputs (right before the Op-Amps) for less slew/portamento and maybe higher output voltages. - Use Arduino interrupts to handle the gate and trigger input signals more quickly (since this is supposed to be a rather slow CV sequencer I didn't bother to do that). - Experiment with the input functionality, e.g. you could use the "Invert L2+L3 Pot" gate input to invert the L1 as well, or make it do something completely different. Let me know if you have any other suggestions
|
|
thundersound
Junior Member
A modular world .. from Aa to Thunder and beyond
Posts: 82
|
Post by thundersound on Aug 18, 2019 19:04:26 GMT
I really want to build this one ) But so much I need to learn and find out ..
I think I need to start with ordering the Arduino's. In total I want to build 2 of these modules. So my first stop is to look at Ali, something with China, I think ..
|
|
|
Post by NightMachines on Aug 18, 2019 19:24:24 GMT
Yes, order the Arduinos and some DIY stuff from the shopping list in the “Let’s DIY” sub-forum. Once the Arduinos arrive, solder the pin headers to them and try out a few programs on the breadboard to get your feet wet. Or just copy and paste my code and start playing
|
|
|
Post by 101 on Aug 20, 2019 21:48:58 GMT
Pretty awesome NightMachines. Are you patching directly into the patch points on the AE modules from the Arduino headers? or are you buffering the output from the Arduino headers via resistors beforehand ?
|
|
|
Post by NightMachines on Aug 21, 2019 3:46:32 GMT
Pretty awesome NightMachines. Are you patching directly into the patch points on the AE modules from the Arduino headers? or are you buffering the output from the Arduino headers via resistors beforehand ? Check the schematics for the details. The PWM outputs require an RC lowpass filter and then you need to buffer that signal with an op-amp Digital inputs require pull down resistors.
|
|
|
Post by 101 on Aug 21, 2019 12:24:46 GMT
OK. On the PWM outputs I'm guessing your wanting to filter out noise and higher frequency harmonics using the RC filter. Are you using the op-amps as unity gain/voltage buffers type thing? Also from the schematic it looks like your clocking operations on the Arduino from the AE clock - is that correct? Any advice is much appreciated.
|
|
thundersound
Junior Member
A modular world .. from Aa to Thunder and beyond
Posts: 82
|
Post by thundersound on Sept 2, 2019 16:54:43 GMT
My arduino's should arrive soon, Ali said they have arrived in my country already, now I have to look at the other stuff, I expected Ali to take a longer time, this weekend I think I will order the other stuff I will need..
|
|
|
Post by NightMachines on Sept 4, 2019 6:22:21 GMT
OK. On the PWM outputs I'm guessing your wanting to filter out noise and higher frequency harmonics using the RC filter. Are you using the op-amps as unity gain/voltage buffers type thing? Also from the schematic it looks like your clocking operations on the Arduino from the AE clock - is that correct? Any advice is much appreciated. The RC filter smoothes the PWM signals. Without it, the PWM output would just be a digital on/off output. With lowpass filtering though, the on/off states will be averaged into an analog voltage. See here for example: www.instructables.com/id/Arduino-RC-Circuit-PWM-to-analog-DC/After the RC filter, you need to place an op-amp buffer indeed. There isn't a typical clock input, as the sequencer only changes its output when one of three things happen: low to high gate at input 1, high to low gate at input 2, CV crossing the threshold at input 3. My arduino's should arrive soon, Ali said they have arrived in my country already, now I have to look at the other stuff, I expected Ali to take a longer time, this weekend I think I will order the other stuff I will need.. Nice! Crossing my fingers that all the parts will get to you quickly
|
|
|
Post by 101 on Sept 16, 2019 18:23:40 GMT
OK. On the PWM outputs I'm guessing your wanting to filter out noise and higher frequency harmonics using the RC filter. Are you using the op-amps as unity gain/voltage buffers type thing? Also from the schematic it looks like your clocking operations on the Arduino from the AE clock - is that correct? Any advice is much appreciated. The RC filter smoothes the PWM signals. Without it, the PWM output would just be a digital on/off output. With lowpass filtering though, the on/off states will be averaged into an analog voltage. See here for example: www.instructables.com/id/Arduino-RC-Circuit-PWM-to-analog-DC/After the RC filter, you need to place an op-amp buffer indeed. There isn't a typical clock input, as the sequencer only changes its output when one of three things happen: low to high gate at input 1, high to low gate at input 2, CV crossing the threshold at input 3. I have a bunch of MCP602 op-amps and resistors. I've also bought a VCLFO chip from Electric Druid so I'm planning to use those to smooth the VCLFO PWM outputs. Not sure what to do with the Arduino now. Maybe try to make a clock divider. Still trying to get my head around using interrupts and timers and port registers for that!
|
|
|
Post by handtapeloop on Oct 6, 2019 15:28:11 GMT
I built the thing today! Yay! Need to put it behind a front panel still, but everything else is done and works. Here’s a quick video: http://instagr.am/p/B0bJcKVoWDC All modulation (filter, pwm, etc) apart from the slow four-note melody is coming from the DIY module which receives various DIVIDER gates and LFO signals, which it turns into evolving stepped-CV patterns. Sound very good:-) I was thinking about the gates / switches. Would it be possible to reintroduce the “threshold above/below” gate input, and 'OR'it with 2 diodes with the switch for that function? With this method they could be using just 1 Arduino port. Then the same could be possible with the Limit/Wrap Switch and gate, and that will even free a gate. There could be a small loss of current when using diodes, but for a gate signal that should not be a huge problem I think. The freed port could be used for a separate reset trigger for the 3th lane. Also could there be manual momentary buttons for the reset gates with a 'OR' diodes. And for the "bounce"gate there could also be a complementary (toggle) switch. I thought about this, but I prefer to have those gate inputs separate and not OR’d with the switches, as an OR gate doesn’t let me invert the switch position. So when the switch is on, the gate CV won’t do anything. All gate inputs can of course be OR’d externally with a switch though. Playing a bit with it, your idea of the “bounce” which makes CV move up and down between 0-5V is great though. So far I only programmed the “bounce” gate input the invert the poti values, but this of course is different as they will still reach and stay at 0 or 5V like this. The “wrap” feature is fun but also quite a strong effect, because it jumps a full 5 volts ... hmmm ... I’ll think so more about it. It was a very easy build on the whole, but even in 2U it was getting cramped with all those cables. Edit: by the way, this is my first DIY with properly buffered outputs! Haha! Finally, I’m using op-amps!
|
|
|
Post by NightMachines on Oct 6, 2019 16:12:50 GMT
I think something went wrong there with your quote. Did you have a question?
|
|
Tom
New Member
Posts: 3
|
Post by Tom on Dec 18, 2019 11:14:05 GMT
This is awesome! Definitely something I will be experimenting with in the new year.
|
|
|
Post by MikMo on Dec 18, 2019 20:09:14 GMT
What are the protoboards you are using for the module?
Mikael
|
|
|
Post by NightMachines on Dec 18, 2019 23:05:04 GMT
What are the protoboards you are using for the module? Mikael They’re regular double sided proto boards which you can get anywhere online. I think I bought them on eBay or Aliexpress a long time ago
|
|
|
Post by despairbear on Dec 18, 2019 23:23:15 GMT
Super super beginner question here, but how do you split the 5v power source from the Arduino to multiple power sources when soldering? It's obvious on a breadboard but I'm not sure how to go about this on one of the PCB prototyping boards
|
|