STOP and read first line at least!!! Not Spam, not trolling. Some educational/marketing click bait totally relevant to the thread.
TLDR scroll down to (bottom):
for my eventual question.
I’m new to MIDI so I’m experimenting. Now that BeatBuddy takes MIDI INPUT with it’s latest firmware, it’s essentially one of the most awesomely powerful digital MIDI devices on the market.
Anyhow, I got to thinking, in theory, since the BeatBuddy understands “some” MIDI messages, I can plug in a single cable and I’ll instantly have a way to interface with all it’s functions, remotely, with just about any other MIDI capable device in the world, including but not limited to, guitar pedals, phones, keyboards, computers, watches, and light bulbs.
In short, I said, “theory”, for a reason. It turns out there is an international MIDI standard, that all hardware manufactures try to adhere to, when building products. That’s only partly true. Then there is the software side, which is also supposed to adhere to “The standard”. What I’ve discovered after researching and playing with MIDI guitar stuff, is that designers, both hardware and software, all have their own MIDI dialect and interpretation of “The Standard”.
The problem with that is, in Digital World, where most musicians now frequent on a daily basis, the entire population of said world only understands the dialect spoken by other Digital World people. Consequently, even if the dialect is exactly the same (never happens), there is still room for interpretation issues, and often times, nobody understands anything and nothing gets done.
Ok, that last bit wasn’t entirely true. The DW people have what they call translators. They listen to commands spoken by tourists, and then the translators speak the commands to the DW people, who can now understand those commands perfectly [insert laughter]. The process also works in reverse just as efficiently [louder laughter].
[CENTER][/CENTER]
In summary, I’m using an Arduino UNO[/URL], with an optional Olimex MIDI Shield, to send MIDI commands to the BeatBuddy (and VL3). The BeatBuddy is acting as The MIDI Master (a.k.a. Pit Boss) and listening to commands on it’s MIDI input and sending commands, like song tempo, to the VL3 via it’s MIDI output. The VL3 is listening to the BeatBuddy (and the Arduino) via it’s MIDI input. For those that don’t know, The VL3 is, for lack of a better description, a digital floor based guitar/amp fx processor, a vocal processor, a looper, and a mixer, all in one box. Both the BeatBuddy and the VL3 are “almost” fully MIDI compatible, in all modes, [URL=‘http://www.midiworld.com/basics/’]In, Out, and Thru.
This is what I know so far:
These MIDI messages tell the BB to make various sounds: These should adhere to “The standard”, but annoyingly so, not everyone adheres to “The standard”, so this isn’t a global constant (weak code humor). I had inquired previously as to what note the percussion samples on the BB were “tuned to” in another thread, but never really got a straight answer. I suppose that is borderline proprietary information, but the cat is out of the bag, so here they be.
33 A0 Metronome
36 C1 Kick Drum
37 C#1 Cross Stick
38 D1 Snare
39 D#1 Handclaps
42 F#1 Hi-Hats Closed
43 G1 Tom 4 (Floor)
44 G#1 Foot Hi-hat
45 A1 Tom 3 (Low)
46 A#1 Hi-Hat Open
48 C2 Tom 2 (Hi-Mid)
49 C#2 Crash Cymbal 1
50 D2 Tom 1 (High)
51 D#2 Ride Cymbal
53 F2 Ride C. Bell
55 G2 Splash 1
57 A2 Crash Cymbal 2
59 B2 Splash 2
Basically (pun intended), I tell the Arduino (translator) to send this command to the BeatBuddy:
MIDI.sendNoteOn(36,100,1); //MIDI OUT to BB telling (asking) it to make a noise, in this case, a kick drum sample at 100 velocity on channel 1. (by default, the BB listens to all channels.)
MIDI Messages that the BeatBuddy will accept from Arduino Uno: I can’t find anything online that tells me exactly what the code should be, so I’m hoping a fellow nerd can help me out:
Again, this is what I know:
VL3 Preset Change (via MIDI thru):
MIDI.sendProgramChange(XX, 1); //via BB MIDI thru (configured for merge): tells VL3 to change to preset XX
Tempo:
tells the BB to increment tempo by 1 when a button on the Arduino is pressed. There is some funky stuff that has to happen with the MSB at certain values, hence the switch function. With the right math, I think this could be shortened, but math isn’t my strong suit.
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
switch (tempo) {
case 128:
MSB=1;
tempo=-128;
break;
case 0:
MSB=2;
tempo=-256;
break;
case -211:
MSB=0;
tempo=40;
break;
}
MIDI.sendControlChange(106,MSB,1); // (CC,MSB,channel)
MIDI.sendControlChange(107,tempo++,1); // (CC,LSB,channel)
delay(100); //debounce
}
}
UPDATE: Also found this, which is infinitely easier.
MIDI.sendControlChange(97,1,1); // (CC,MSB,channel) - decreases tempo by 1
MIDI.sendControlChange(96,1,1); // (CC,MSB,channel) - increases tempo by 1
Volume:
MIDI.sendControlChange(108, XX, 1); //--- change volume on BB to XX%: Use a pot to get the XX value----------
UPDATE: I ended up using a cheap encoder instead of a pot as I wanted to preserve the analog inputs on my Arduino for something else. Most of the code that’s out there for encoders is horrible, including the stuff on the Arduino site. After many an hour of struggling, I found this and it works beautifully, even with $1 encoders:
It came from this guy: http://www.buxtronix.net/2011/10/rotary-encoders-done-properly.html
// encoder pin A to Arduino pin 2 <--- special interrupt pin
// encoder pin B to Arduino pin 3 < --- special interrupt pin
// encoder ground pin to ground (GND)
#include <Rotary.h>
Rotary r = Rotary(2, 3);
void setup() {
Serial.begin(9600);
PCICR |= (1 << PCIE2);
PCMSK2 |= (1 << PCINT18) | (1 << PCINT19);
sei();
}
void loop() { // main execution loop }
ISR(PCINT2_vect) {
unsigned char result = r.process();
if (result == DIR_NONE) {
// do nothing
}
else if (result == DIR_CW) {
Serial.println("ClockWise"); // send CC commands here
}
else if (result == DIR_CCW) {
Serial.println("CounterClockWise"); // send CC commands here
}
}
Drum Set:
MIDI.sendControlChange(116, X, 1); //---- change BB drum set to X (could use a single digital button to increment through them)-----------
Tap Tempo:
I actually read this in the BeatBuddy MIDI manual I think, but sending a CC, control change in this case, like the following, is supposed to tell the BB to Tap Tempo: - This needs clarification. Is it supposed to bring up the tap tempo screen? If I send it a bunch of times, is it just like tapping on the tap tempo screen?
CC:117
[CENTER]********************************************************
********************************************************[/CENTER]
What I can’t figure out, is how to translate the Tap Tempo MIDI message into Arduino. I believe it should look something like the following, but I don’t understand enough MIDI or Arduino to know what the first two parameters (X) should be, and/ or, if I need to send one line, or multiple lines, like the tempo code above.
MIDI.sendControlChange(X, X, 1);
Sorry for length, but if you can, please educate me, and hopefully a few others.
Thanks in advance.
-Steve