Central Eurorack Time Wermland Voltage Control
Wermland Voltage Control is a synth meetup in Värmland, Sweden.
https://www.facebook.com/wermlandvoltagecontrol
To make life easier when meeting with other synth nerds you need sync.
- 5 midi out with midiclock
- 8 different triggs with double buffered outputs = 16 trigg
- 4 outputs called play. When running they are high.
- Start/stop-button
- Knob for adjusting the tempo
In the schematic the power is normal Eurorack but could also be powered by 9V DC from wallwart, or even at battery.
The drive circuit, with inspiration from Niklas Rönnberg. It´s a simple use of a very low priced TTL-circuit called 74HC14. An inverter with Schmitt trigger, makes the signal nice and clean.
The code on the Arduino Nano is using a nice and stable library:
https://github.com/midilab/uClock
The circuit uses a 74HC595 to send the trigs to save some pins, but that could really be omitted (requiers some changes in code).

The schematic and code:
http://dittegetnamn.se/wp-content/uploads/2025/04/CET-WVC.zip
If you find errors, contact me.
Simple code
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
// CET – Central Eurorack Time WVC // Small module that will control time itself // Martin Gson – Sweden // // Pot connected to A0 // OLED Connected A4(SDA – pin 4), A5(SCL – pin 3) // // Output: 74HC595 connected: // Pin XX connected to DS (data-14, SER) of 74HC595 // Pin XX connected to SH_CP (clock 11, SRCLK) of 74HC595 // Pin XX connected to ST_CP (latch 12, RCLK) of 74HC595 // 74HC595: // GND: Pin 13 (OE) // PWR: Pin 10 (SRCLR) // // Midi //TX -> 220Ohm -> midi pin 5 //+5V -> 220 Ohm -> midi pin 4 // GND -> midi pin 2 (sleeve) if you like // // Button connected to pin 2 // Midiclock! #include <uClock.h> // For button (GO/Don´t GO) byte lastButtonState = LOW; unsigned long debounceDuration = 50; // millis unsigned long lastTimeButtonStateChanged = 0; int BUTTON_PIN = 2; // running-pin int RUNNING_PIN = 3; // for 74HC595 //Pin connected to ST_CP of 74HC595 int latchPin = 9; //Pin connected to SH_CP of 74HC595 int clockPin = 10; ////Pin connected to DS of 74HC595 int dataPin = 11; // for Trigg counting and division int division[] ={1, 6, 6, 12, 12, 24, 24, 48}; int clock = 0; int pinCount = 8; int numberToDisplay; int number[8]; int running = 0; // State of clock: 0 = not running, 1 = running // must be integer divideable with all divisions int clkCount = 1*6*6*12*12*24*24*48; // MIDI clock, start and stop byte definitions – based on MIDI 1.0 Standards. #define MIDI_CLOCK 0xF8 #define MIDI_START 0xFA #define MIDI_STOP 0xFC void ReadPotentiometer() { // Read potentiometer at pin A0 int sensorValue = analogRead(A0); //returns something between 0-1023 //we need to scale the value to something useful like 60 and 180 sensorValue = map(sensorValue, 0, 1023, 60, 180); uClock.setTempo(sensorValue); // Set new fresh BPM } void ReadButton(){ if (millis() – lastTimeButtonStateChanged > debounceDuration) { byte buttonState = digitalRead(BUTTON_PIN); if (buttonState != lastButtonState) { lastTimeButtonStateChanged = millis(); lastButtonState = buttonState; if (buttonState == LOW) { // do an action, start or stop the clock! if (running == 1) { // clock is running, we must stop it uClock.stop(); // set RUNNING pin low digitalWrite(RUNNING_PIN, LOW); // set running to low running = 0; } else { // clock is not running, we must start it uClock.start(); // set RUNNING pin low digitalWrite(RUNNING_PIN, HIGH); // set running to high running = 1; } } } } } void clockAdvance(){ if(clock == clkCount){ //reset clock clock = 0; } memset(number, 0, sizeof(number)); for (int thisPin = 0; thisPin < pinCount; thisPin++) { if((clock % division[thisPin] ) == 0 ){ // Make thisPin to 1 if % leaves 0 as remainder number[thisPin] = 0x01; } } numberToDisplay = number[0] << 0 | (number[1] << 1) | (number[2] << 2) | (number[3] << 3) | (number[4] << 4) | (number[5] << 5) | (number[6] << 6) | (number[7] << 7); // Write out the word digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay); //take the latch pin high so the LEDs will light up: digitalWrite(latchPin, HIGH); delay(10); // kill all output digitalWrite(latchPin, LOW); // shift out the bits: shiftOut(dataPin, clockPin, MSBFIRST,0); //take the latch pin high so the LEDs will light up: digitalWrite(latchPin, HIGH); // advance clock clock++; } // The callback function called by Clock each Pulse of 24PPQN clock resolution. void onSync24Callback(uint32_t tick) { // Send MIDI_CLOCK to external gears Serial.write(MIDI_CLOCK); clockAdvance(); } // The callback function called when clock starts by using Clock.start() method. void onClockStart() { Serial.write(MIDI_START); //reset clockcount clock = 0; } // The callback function called when clock stops by using Clock.stop() method. void onClockStop() { Serial.write(MIDI_STOP); } void setup() { // Initialize serial communication at 31250 bits per second, the default MIDI serial speed communication: Serial.begin(31250); // Setup the pin for the button pinMode(BUTTON_PIN, INPUT_PULLUP); // Setup for the pin for the running status pinMode(RUNNING_PIN, OUTPUT); // for the 74HC595 //set pins to output so you can control the shift register pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(dataPin, OUTPUT); // Inits the clock uClock.init(); // Set the callback function for the clock output to send MIDI Sync message based on 24PPQN uClock.setOnSync24(onSync24Callback); // Set the callback function for MIDI Start and Stop messages. uClock.setOnClockStart(onClockStart); uClock.setOnClockStop(onClockStop); // Set the clock BPM uClock.setTempo(90); //uClock.start(); // set RUNNING pin low //digitalWrite(RUNNING_PIN, HIGH); } // Do it whatever to interface with Clock.stop(), Clock.start(), Clock.setTempo() and integrate your environment… void loop() { ReadPotentiometer(); ReadButton(); } |