irvined Posted March 3, 2019 Share Posted March 3, 2019 Hi, We have just finished the V8 upgrade to my homebrew bass pedal. I've made a (badly filmed) video to show hat they can do: https://www.dropbox.com/s/wksuh0lh7kgu20f/V8 bass pedals.mp4?dl=0 The original consist of an old pedal board from an organ, a Novation Bass station1 plus an Arduino microcomputer. I wanted something that could provide some backing chords so I've added another synth module (Roland) a second Arduino and more switching. My original code has been sorted by my son, who is a programmer by trade. The original has been running fine for about 8 years and we have used the same technology to build our DMX controller - no video though: Regards, Doug 3 Quote Link to comment Share on other sites More sharing options...
fleabag Posted March 3, 2019 Share Posted March 3, 2019 That was weirdly fascinating. Never seen anything like it ! clever stuff Quote Link to comment Share on other sites More sharing options...
irvined Posted March 4, 2019 Author Share Posted March 4, 2019 Just in case anyone wants to see our arduino code: #include <Bounce2.h> #include <MIDI.h> MIDI_CREATE_DEFAULT_INSTANCE(); Bounce ChordDebouncer = Bounce(); Bounce MajorDebouncer = Bounce(); Bounce MinorDebouncer = Bounce(); Bounce AugmentedDebouncer = Bounce(); Bounce DiminishedDebouncer = Bounce(); struct Outputs { enum LEDs { Chord = 8, Major = 9, Minor = 10, Augmented = 11, Diminished = 12, }; }; struct Inputs { enum Switches { Chord = 2, Major = 3, Minor = 4, Augmented = 5, Diminished = 6, }; }; struct SwitchStatus_t { bool Chord = false; bool Major = false; bool Minor = false; bool Augmented = false; bool Diminished = false; } LastSwitchStatus; struct ModeStatus_t { bool Chord = false; bool Major = false; bool Minor = false; bool Augmented = false; bool Diminished = false; } LastModeStatus, ModeStatus; typedef Outputs::LEDs LEDs; typedef Inputs::Switches Switches; const byte octave_3 = 36; void calculateNotes(byte pitch, byte * root, byte * chord2, byte * chord3, byte * chord4 = 0) { *root = pitch + octave_3; if (ModeStatus.Major) { *chord2 = *root + 4; *chord3 = *chord2 + 3; } if (ModeStatus.Minor) { *chord2 = *root + 3; *chord3 = *chord2 + 4; } if (ModeStatus.Augmented) { *chord2 = *root + 4; *chord3 = *chord2 + 3; *chord4 = *chord3 + 3; } if (ModeStatus.Diminished) { *chord2 = *root + 3; *chord3 = *chord2 + 3; } } void handleNoteOn(byte channel, byte pitch, byte velocity) { if (!ModeStatus.Chord) { return; } byte rootNote = 0; byte chord2 = 0; byte chord3 = 0; byte chord4 = 0; if (!ModeStatus.Augmented) { calculateNotes(pitch, &rootNote, &chord2, &chord3); } else { calculateNotes(pitch, &rootNote, &chord2, &chord3, &chord4); } MIDI.sendNoteOn(rootNote, velocity, channel); MIDI.sendNoteOn(chord2, velocity, channel); MIDI.sendNoteOn(chord3, velocity, channel); if (ModeStatus.Augmented) { MIDI.sendNoteOn(chord4, velocity, channel); } } void handleNoteOff(byte channel, byte pitch, byte velocity) { if (!ModeStatus.Chord) { return; } byte rootNote = 0; byte chord2 = 0; byte chord3 = 0; byte chord4 = 0; if (!ModeStatus.Augmented) { calculateNotes(pitch, &rootNote, &chord2, &chord3); } else { calculateNotes(pitch, &rootNote, &chord2, &chord3, &chord4); } MIDI.sendNoteOff(rootNote, velocity, channel); MIDI.sendNoteOff(chord2, velocity, channel); MIDI.sendNoteOff(chord3, velocity, channel); if (ModeStatus.Augmented) { MIDI.sendNoteOff(chord4, velocity, channel); } } void resetMIDIBus() { Serial.write(0xFF); Serial.write(0xF0); Serial.write(0x7F); Serial.write(0x7F); //device id 7F = 127 all channels Serial.write(0x02); Serial.write(0x7F); // command format 7F = all devices Serial.write(0x0A); // action 0x0A= reset Serial.write(0xF7); } void setup() { pinMode(LEDs::Chord, OUTPUT); pinMode(LEDs::Major, OUTPUT); pinMode(LEDs::Minor, OUTPUT); pinMode(LEDs::Augmented, OUTPUT); pinMode(LEDs::Diminished, OUTPUT); pinMode(Switches::Chord, INPUT_PULLUP); pinMode(Switches::Major, INPUT_PULLUP); pinMode(Switches::Minor, INPUT_PULLUP); pinMode(Switches::Augmented, INPUT_PULLUP); pinMode(Switches::Diminished, INPUT_PULLUP); ChordDebouncer.attach(Switches::Chord, INPUT_PULLUP); MajorDebouncer.attach(Switches::Major, INPUT_PULLUP); MinorDebouncer.attach(Switches::Minor, INPUT_PULLUP); AugmentedDebouncer.attach(Switches::Augmented, INPUT_PULLUP); DiminishedDebouncer.attach(Switches::Diminished, INPUT_PULLUP); ChordDebouncer.interval(25); MajorDebouncer.interval(25); MinorDebouncer.interval(25); AugmentedDebouncer.interval(25); DiminishedDebouncer.interval(25); MIDI.setHandleNoteOn(handleNoteOn); MIDI.setHandleNoteOff(handleNoteOff); MIDI.begin(MIDI_CHANNEL_OMNI); MIDI.turnThruOff(); resetMIDIBus(); digitalWrite(LEDs::Chord, HIGH); delay(100); digitalWrite(LEDs::Major, HIGH); delay(100); digitalWrite(LEDs::Minor, HIGH); delay(100); digitalWrite(LEDs::Augmented, HIGH); delay(100); digitalWrite(LEDs::Diminished, HIGH); delay(100); digitalWrite(LEDs::Chord, LOW); delay(100); digitalWrite(LEDs::Major, LOW); delay(100); digitalWrite(LEDs::Minor, LOW); delay(100); digitalWrite(LEDs::Augmented, LOW); delay(100); digitalWrite(LEDs::Diminished, LOW); delay(100); } void updateDebouncers() { ChordDebouncer.update(); MajorDebouncer.update(); MinorDebouncer.update(); AugmentedDebouncer.update(); DiminishedDebouncer.update(); } void checkDebouncerStates() { if (ChordDebouncer.fell()) { ModeStatus.Chord = !ModeStatus.Chord; } if (MajorDebouncer.fell()) { ModeStatus.Major = true; } if (MinorDebouncer.fell()) { ModeStatus.Minor = true; } if (AugmentedDebouncer.fell()) { ModeStatus.Augmented = true; } if (DiminishedDebouncer.fell()) { ModeStatus.Diminished = true; } } void calculateModes() { if (ModeStatus.Chord != LastModeStatus.Chord) { if (ModeStatus.Chord) { ModeStatus.Major = true; } else { ModeStatus.Major = false; ModeStatus.Minor = false; ModeStatus.Augmented = false; ModeStatus.Diminished = false; } } if (ModeStatus.Major != LastModeStatus.Major) { if (ModeStatus.Major) { ModeStatus.Minor = false; ModeStatus.Augmented = false; ModeStatus.Diminished = false; } } if (ModeStatus.Minor != LastModeStatus.Minor) { if (ModeStatus.Minor) { ModeStatus.Major = false; ModeStatus.Augmented = false; ModeStatus.Diminished = false; } } if (ModeStatus.Augmented != LastModeStatus.Augmented) { if (ModeStatus.Augmented) { ModeStatus.Major = false; ModeStatus.Minor = false; ModeStatus.Diminished = false; } } if (ModeStatus.Diminished != LastModeStatus.Diminished) { if (ModeStatus.Diminished) { ModeStatus.Major = false; ModeStatus.Minor = false; ModeStatus.Augmented = false; } } } void writeLEDStates() { int BinaryLEDStatus = B00000000; if (ModeStatus.Chord) { BinaryLEDStatus ^= B00000001; } if (ModeStatus.Major) { BinaryLEDStatus ^= B00000010; } if (ModeStatus.Minor) { BinaryLEDStatus ^= B00000100; } if (ModeStatus.Augmented) { BinaryLEDStatus ^= B00001000; } if (ModeStatus.Diminished) { BinaryLEDStatus ^= B00010000; } PORTB = BinaryLEDStatus; } void loop() { updateDebouncers(); checkDebouncerStates(); calculateModes(); writeLEDStates(); MIDI.read(); LastModeStatus = ModeStatus; } We use the bounce2 library to debounce the switches and read the status of the data lines from the PORTa and PORTB registers. This makes button responses much more stable, especially when checking MIDI. Regards, Doug Quote Link to comment Share on other sites More sharing options...
LukeFRC Posted March 4, 2019 Share Posted March 4, 2019 (edited) Dear Doug I have no idea what that all means, but look there's a code tag you can use to keep all your formating! Edited March 4, 2019 by LukeFRC 1 Quote Link to comment Share on other sites More sharing options...
fleabag Posted March 5, 2019 Share Posted March 5, 2019 Eggsellent Quote Link to comment Share on other sites More sharing options...
stoo Posted March 5, 2019 Share Posted March 5, 2019 Cool! I've recently had a go at an Arduino midi foot controller so I'll definitely be having a good pore over that code to see what I can learn from it.... already spotted a few things that could be useful but will try again with a fresher pair of eyes tomorrow. Some info on my one here in case you're interested... Quote Link to comment Share on other sites More sharing options...
irvined Posted March 5, 2019 Author Share Posted March 5, 2019 Thanks for the advice and update. I will add the tag! I saw the article which prompted me to post the code. I have to say it is all my son's work. I can rough out an idea in arduino code but he is a programmer by trade so does a much better job than I can. Good luck with your pedal. In our band now we have 3 arduinos and a raspberry pi keeping stuff working! Regards, Doug Quote Link to comment Share on other sites More sharing options...
Bigwan Posted March 29, 2019 Share Posted March 29, 2019 On 05/03/2019 at 06:58, irvined said: Good luck with your pedal. In our band now we have 3 arduinos and a raspberry pi keeping stuff working! @irvined colour me interested! What are you using them all for, if you don't mind me asking? Quote Link to comment Share on other sites More sharing options...
irvined Posted March 29, 2019 Author Share Posted March 29, 2019 Hi, There's two arduinos in the bass pedals. One to drive each synth One in the DMX lighting unit. Enables you to change the lights with your feet. The Pi pretends it is a desktop and links into two Behringer BCF2000s to drive our Soundcraft UI24R desk. Regards, Doug Quote Link to comment Share on other sites More sharing options...
Bigwan Posted March 29, 2019 Share Posted March 29, 2019 6 minutes ago, irvined said: Hi, There's two arduinos in the bass pedals. One to drive each synth One in the DMX lighting unit. Enables you to change the lights with your feet. The Pi pretends it is a desktop and links into two Behringer BCF2000s to drive our Soundcraft UI24R desk. Regards, Doug Awesome! Quote Link to comment Share on other sites More sharing options...
Sibob Posted April 2, 2019 Share Posted April 2, 2019 Just sent this around at work, great job! Si // Novation Quote Link to comment Share on other sites More sharing options...
Rich Posted April 3, 2019 Share Posted April 3, 2019 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.