The Random Generators
Coin Flip
The first random generator acts as a weighted coin flip, generating a HIGH or LOW output depending on if the random() beats the odds or not.
if (random(1024) < odds0) {
digitalWrite(random0Pin, HIGH);
} else {
digitalWrite(random0Pin, LOW);
}
Flip-Flop
The second random generator acts as a flip-flop. When the random() is successful, the state of the output if flipped from HIGH to LOW or LOW to HIGH.
if (random(1024) < odds1) {
digitalWrite(random1Pin, flip);
flip = !flip;
}
Oscilloscope
Odds are set to approximately 50% for random generator.
- Yellow - The square wave used to trigger the generators.
- Cyan - The output of the coin flip generator.
- Magenta - The output of the flip-flop generator.
![](https://cdn.hackaday.io/images/3795501492877879539.jpg)
What does it sound like?
I've been able mimic sounds from WarGames, modems, Atari 2600 noise, and Aunt Beru's kitchen with various patches. When the output signals are mixed and tuned, it functions as a random arpeggiator.
Plans for the Future
- A clipping circuit to restrict voltage from exceeding 5V should be included in the final design.
- Replace Teensy with ATmega168 sans Arduino bootloader.
- Tidied up with a laser-cut faceplate that sits nicely with my other synth modules.
- LEDs to indicate the current state of each generator.