Designing a DIY synth arpeggiator with logic gates: Part 2
HTML-код
- Опубликовано: 1 окт 2024
- Support the channel: / moritzklein
A detailed look at how to build a scaled CV arpeggiator with a multiplying digital-to-analog converter and a few logic gates. It can be used with any volt/octave analog synthesizer. In this second part, I'm building the actual DIY bit processor.
Here's another rough bill of materials:
1x 40106 Hex Inverter
2x 4081 Quad AND Gate
1x 4070 Quad XOR Gate
2x Small Signal Diode
6x LED
6x 2K Resistor
Lots of wire
Any questions - feel free to ask them in the comments. I'm happy to help.
Read the "Karnaugh map" entry in Wikipedia. This is the method they taught 1st years at university in the 90's for converting a truth table into a simple boolean circuit with AND, OR and NOT gates.
thanks, i'll check it out!
ive used the karnaugh map but in the best case i've used 8 digital gates (and some of them were 3-port and and 3-port or, so it would be more than 8), which is the same he used
They still teach it at university 1st semester :) (at least for me...10 years ago as EE)
@@yezariaelll I learned it last year (first year, second semester) - it's still going strong!
@Devin Amari Instablaster =)
Hey Moritz, I finally got to watch your videos and am absolutely amazed! I don't know of any other (true) Synth DIY channel this in-depth and high-quality. Keep it up bro!
Regarding the circuit: I'm excited to see where you'll be going with it. You most likely won't be able to handle Midi without using a microcontroller, so you'll have to come up with another way to generate patterns. Maybe have a look at using shift registers like the Music Thing Turing Machine or do something like the Omsonic Stochastic Inspiration Generator ...or whatever you have in mind :D
thanks! great to hear! and yes, i was also thinking shift registers. i just tested it out today and got very nice results - it's right on the edge between controllable and chaos. very nice stuff! i'll check out that omsonic-thing as well!
(b1 xnor b3 xor b4) or not(b1 or b2 or b4) is one way of expressing the scale check circuit with only 6 gates, I'm not sure if 5 is possible. Alternatively it's also possible to use an eeprom chip to do the scale checking for you. I recommend watching "Using an EEPROM to replace combinational logic" by Ben Eater if you're interested
ps: Love your series!!
i'll have to lay that out on paper to wrap my head around it, but sounds promising! ben's EEPROM video i know, and yeah, it would definitely be the best solution if you want to build a module with multiple pre-set scales. i think i'll go in a different direction with this though - i want to develop it into a really primitive, low level programmable computer/logic module. basically i'll leave the MDAC part as it is, but for the bit processing i'll just have a bunch of patch points so that you can chain different logic gates as you see fit. might not be practical, but i think it might be fun!
@@MoritzKlein0 sounds like a fun idea! I was thinking to use an array of 16 switches so you can switch up your scales on the fly (each switch assigns for each note whether it's allowed or not) so you can do stuff like change any major key to its minor with 6 switch flips. What ever you decide to do I will be looking forward to it. You inspired me to continue working on my breadboard projects again
Since now you are in the digital domain, it would make sense feeding the TLC7524 thru an Arduino, with Midi input for keyboard, MidiUsb input for Ableton sequencer, scale types library, arpeggio types library, internal clock, external clock reception, LCD, buttons, etc.
Nice job of yours.
I wish I had watched this when it came out. I'm a current Patreon supporter, and I'm in the midst of building up my modular. It's like yours, basically, but nearly all of the ideas are borrowed rather than cooked up by myself. This video follows a beautiful investigational arc, hypothesizing, testing, failing, recalibrating, and finally reaching the desired conclusion. Keeping to that cadence in the presentation scaffolds the viewer's experience so nicely. Again, thanks for the cool stuff you have taught me.
Accidently found your video. It's less musical electronics, more a tutorial into logic design - nothing wrong with that. I couldn't help but wonder if you might simplify things just by different coding of musical notes to binary e.g. C=001; D=010; E=011; F=100; G=101; A=110; B=111. Use the top bit as a flag for sharp (even though some notes do not have a sharp), i.e. 1001 = C#, and use 000 for a special case (silence?). Apologies as I have no idea how you are using the bits, but I am just throwing in this suggestion based on years of programming and coding data structures :-)
Just a tip, you can always replaces some gates by a combination of others, for example, a AND gate can be replaced by a combination of 2 NAND gates, in some cases this could help use less chips or at least using the same kind of chip but needing more of then, which in sometimes can be more practical, search for logical gates equivalence on the web for more information.
A more natural way of fixing a scale (given that you do not allow the tuning to vary) might be to use a multiplexor from a set of DIP switches. That way it would be programmable. (As others have said, this generalises to a ROM.)
4:23 You can use a 4-variable karnaugh map (k-map) to derive the minimal set of logic gates needed (it uses gray code and grouping the ones's by powers of 2).
You can also do the kmap to find the inverse by swapping the allowed and forbidden states (swap 1 with 0, and vice-versa) then use a not gate to invert the minimal function via De Morgan's law in order to cut down on the number of gates.
Hi there, really useful series of videos! Great explaination as well. Do you have a blog or some places with a detailed list of materials and schematic?
Oh, I know about these forbidden notes, they're the ones kept in the Boîte Diabolique, right?
www.npr.org/2017/10/31/560843189/the-unsettling-sound-of-tritones-the-devils-interval
evil lurks everywhere
Very nice video.I came for the synth stuff but It also help me understand better and put in use Digitals Systems uni course.Keep going!!
It's intensely clever to even think of doing it this way, let alone actually implementing it
phew... great tutorial. Looking forward to the next "musical context" episode !
Interesting rhythmic pattern going from E to F because not skipping note there but I don't hear that when going from B0 to C1. Why?
oh good question. i‘ll get back to you on that!
@@MoritzKlein0 I'm just curious. Great video.
@@MoritzKlein0 @Electronic Garden
The presence of the rhythm itself is no mystery - it comes from the flips playing the allowed notes twice, so they sound like one note held twice as long. But the question of why it only happens at EF and not at BC is interesting.
This is your description of the pattern: "Every sharp note seems to be identical with its paired natural one except for the first bit. So it's safe to say that inverting the first bit of a forbidden state would turn it into an allowed one." But that "pairing" turns out to be asymmetrical as you move up or down the scale.
Because of that asymmetry, there are two different kinds of flips happening. The first kind, call it the type 1, is when the allowed note is played, and then the forbidden note _follows_ and is _flattened_: C is played, then the would-be C# is flattened to C. Next D is played and the would-be D# is flattened to D. E and F then sound, but at the next note, we get the other kind of flip, type 2, as the forbidden note sounds _first_ and is _sharpened_: the would-be F# is sharpened to G, and then the allowed G plays. Following through, we get G##-A, A##-B, and back to C.
If, after playing F, the logic "looked ahead" and, seeing that the forbidden F# was coming up, "knew" to flatten it to F, then that flip would be the type 1 flip. Using such look-aheads where needed to convert the three type-2 flips into type-1s would put the two short notes rhythm at B-C. Each look-ahead would need the rule "invert both the second and the first bit" but I'm not sure how you'd implement knowing which rule to apply.
Even more manipulation would probably allow you to put the short notes wherever you wanted them, but this substitution approach can't get rid of them entirely.
Use
Karnaugh map to calculate the minimum needed logic gates.
I paused the video at 7:30 and gave the logic a go. I came up with NOT(XOR(B3, XOR(B1, B4))), notice the nested XOR and the lack of dependence on B2. I think it's pretty slick. This is for the allowed notes. Removing the outside NOT gate gives forbidden notes. I think it's be cool the most important NOT stays on the outside.
Sehr cool, Moritz!
Another thought is you could make a diode rom, but with diodes and jumpers (or switches) for every bit so it can be reconfigured. Then you can "program" your allowed notes into that, in the order you wish, and feed the output of your counter into the demux that enables the read lines for each row. I can't adequately describe the diode rom here but there are examples if you google around a bit. It's the same idea as using a rom/eeprom.
found this on redditt - have no idea whats going on but youre actually making this it easier to understand. incredible tutorial!
Hello. @Moritz Klein Does it work just with CV or it's possible to use it with any synth for manipulations?
Cool! However this specific case is where best fit would be to use MCU like ATMega
He's intentionally keeping it low level.
Hi. Nice to know u. This project is great!! You have a draw of this project on vereoboard or Stripboard?
How about Karno's maps
(b1 xor b3 xor b4) and (b2 or b4)
Brilliant
A much easier way to do this is to use a lookup table. You can create a ROM with the number of entries corresponding with the number of possible outputs from the counter. And just place the allowed values in there. So the counter sends the Address or count and the ROM outputs the note bit representation which can then just be sent to the MDAC.
I think that Moritz has stated that he wants to keep this as primitive as possible though.
@@bobvines00 I don't really see why... a simple microcontroller could have all of this data in flash memory with way less wiring, and trivial to change if/when required. If you're going to "go digital" it seems a bit futile to insist on using discrete logic gates IMHO.
EDIT TO ADD: After watching all of these again, I realise now that it's a useful learning process, bringing in the Karnaugh maps and teaching about logic gates. I don't really think it's about being "primitive", but more about being educational.
congratulations for your channel, I like it all the videos. Thank you so much for sharing all this content.
I wanted to know if you have any scheme to manufacture a symmetrical power supply.
yes, check this video: ruclips.net/video/pQKN30Mzi2g/видео.html