MartyMcFly
New member
Hi All.
Newby to Teensy here.
I'm trying to create a Midi interface for an old Organ Pedalboard, using code from this project. https://github.com/Daddoon/PedalBoardToMidi
I am running Teensyduino 1.55 on an older MacBook pro, with Mojave 10.14.1.
Originally I had problems compiling, but after adding in the Bounce2.h, there was no compile errors. Next I kept getting a 'No Teensy boards were found...' error. Pressing the button on the Teensy 3.5 stopped the flashing light, but the board was not detected by the Teensy Loader.
I found a suggestion that I should use Terminal to remove a usbserial.kext (rm -rf /Library/Extensions/usbserial.kext). I did this and the compile seemed to work.
The Teensy loader momentarily popped up showing the Teensy 3.5, but then reverted to asking that I press the button on the Teensy again. At the same time, my mac popped up a message saying a new device (MFPedalboard) had been detected and I needed to set it up, but inside the system preferences, it seemed to appear as a modem, asking for phone numbers etc.
Since then I have not been able to compile again and just get the above mentioned 'No Teensy boards were found'
The above mentioned extensions folder has a bunch of different USB things in it. I'm wandering if there's something on this mace that is highjacking the USB ports.
I've deleted the MFPedalboard object from system preferences.
#include <Bounce2.h>
//#include <Bounce2/Bounce2.h>
void PinOutput(int pinNb, int pinValue)
{
Serial5.print("Pin: ");
Serial5.print(pinNb);
Serial5.print(", Value: ");
Serial5.println(pinValue);
}
struct KeyNote
{
int pin; //pin number on Teensy card
int value; //Note value in Midi
Bounce button; //Bounce instanciated button
};
const int channel = 1;
const int debounceTime = 5;
const int noteOn = 99;
const int noteOff = 0;
const int nbKeys = 32;
KeyNote keys[] = {
{ 0, 60 }, //Key 1, Note value => 60 (C4)
{ 1, 61 }, //Key 2
{ 2, 62 }, //Key 3
{ 3, 63 }, //Key 4
{ 4, 64 }, //Key 5
{ 5, 65 }, //Key 6
{ 6, 66 }, //Key 7
{ 7, 67 }, //Key 8
{ 8, 68 }, //Key 9
{ 9, 69 }, //Key 10
{ 10, 70 }, //Key 11
{ 11, 71 }, //Key 12
{ 12, 72 }, //Key 13
{ 32, 73 }, //Key 14 //NOTE: Using Pin 32 instead of Pin 13, because LED is interupting normal signals
{ 14, 74 }, //Key 15
{ 15, 75 }, //Key 16
{ 16, 76 }, //Key 17
{ 17, 77 }, //Key 18
{ 18, 78 }, //Key 19
{ 19, 79 }, //Key 20
{ 20, 80 }, //Key 21
{ 21, 81 }, //Key 22
{ 22, 82 }, //Key 23
{ 23, 83 }, //Key 24
{ 24, 84 }, //Key 25
{ 25, 85 }, //Key 26
{ 26, 86 }, //Key 27
{ 27, 87 }, //Key 28
{ 28, 88 }, //Key 29
{ 29, 89 }, //Key 30
{ 30, 90 }, //Key 31
{ 31, 91 } //Key 32
};
void BounceSetup()
{
int i = 0;
while (i < nbKeys)
{
keys.button = Bounce(keys.pin, debounceTime);
i++;
}
}
void PullUpSetup()
{
int i = 0;
while (i < nbKeys)
{
pinMode(keys.pin, INPUT_PULLUP);
i++;
}
}
void setup()
{
/*Serial5.begin(9600);*/
// Setup the button
///pinMode( inputPin ,INPUT);
// Activate internal pull-up (optional)
///digitalWrite( inputPin ,HIGH);
// After setting up the button, setup the object
///bouncer .attach( inputPin );
///bouncer .interval(5);
BounceSetup();
PullUpSetup();
}
void UpdateKeys()
{
int i = 0;
while (i < nbKeys)
{
keys.button.update();
i++;
}
}
void SendNoteOn()
{
int i = 0;
while (i < nbKeys)
{
// Note On messages when each button is pressed
if (keys.button.fallingEdge()) {
usbMIDI.sendNoteOn(keys.value, noteOn, channel);
//Debug only
/*PinOutput(keys.pin, keys.value);*/
}
i++;
}
}
void SendNoteOff()
{
int i = 0;
while (i < nbKeys)
{
// Note Off messages when each button is released
if (keys.button.risingEdge()) {
usbMIDI.sendNoteOn(keys.value, noteOff, channel);
}
i++;
}
}
void DiscardAllInputs()
{
// MIDI Controllers should discard incoming MIDI messages.
while (usbMIDI.read()) {
}
}
void loop()
{
UpdateKeys();
SendNoteOn();
SendNoteOff();
DiscardAllInputs();
}
// a .cpp file or your main sketch (the .ino file).
#include <usb_names.h>
// Edit these lines to create your own name. The length must
// match the number of characters in your custom name.
#define MIDI_NAME {'M','F',' ','P','e','d','a','l','b','o','a','r','d'}
#define MIDI_NAME_LEN 13
// Do not change this part. This exact format is required by USB.
struct usb_string_descriptor_struct usb_string_product_name = {
2 + MIDI_NAME_LEN * 2,
3,
MIDI_NAME
};
Newby to Teensy here.
I'm trying to create a Midi interface for an old Organ Pedalboard, using code from this project. https://github.com/Daddoon/PedalBoardToMidi
I am running Teensyduino 1.55 on an older MacBook pro, with Mojave 10.14.1.
Originally I had problems compiling, but after adding in the Bounce2.h, there was no compile errors. Next I kept getting a 'No Teensy boards were found...' error. Pressing the button on the Teensy 3.5 stopped the flashing light, but the board was not detected by the Teensy Loader.
I found a suggestion that I should use Terminal to remove a usbserial.kext (rm -rf /Library/Extensions/usbserial.kext). I did this and the compile seemed to work.
The Teensy loader momentarily popped up showing the Teensy 3.5, but then reverted to asking that I press the button on the Teensy again. At the same time, my mac popped up a message saying a new device (MFPedalboard) had been detected and I needed to set it up, but inside the system preferences, it seemed to appear as a modem, asking for phone numbers etc.
Since then I have not been able to compile again and just get the above mentioned 'No Teensy boards were found'
The above mentioned extensions folder has a bunch of different USB things in it. I'm wandering if there's something on this mace that is highjacking the USB ports.
I've deleted the MFPedalboard object from system preferences.
#include <Bounce2.h>
//#include <Bounce2/Bounce2.h>
void PinOutput(int pinNb, int pinValue)
{
Serial5.print("Pin: ");
Serial5.print(pinNb);
Serial5.print(", Value: ");
Serial5.println(pinValue);
}
struct KeyNote
{
int pin; //pin number on Teensy card
int value; //Note value in Midi
Bounce button; //Bounce instanciated button
};
const int channel = 1;
const int debounceTime = 5;
const int noteOn = 99;
const int noteOff = 0;
const int nbKeys = 32;
KeyNote keys[] = {
{ 0, 60 }, //Key 1, Note value => 60 (C4)
{ 1, 61 }, //Key 2
{ 2, 62 }, //Key 3
{ 3, 63 }, //Key 4
{ 4, 64 }, //Key 5
{ 5, 65 }, //Key 6
{ 6, 66 }, //Key 7
{ 7, 67 }, //Key 8
{ 8, 68 }, //Key 9
{ 9, 69 }, //Key 10
{ 10, 70 }, //Key 11
{ 11, 71 }, //Key 12
{ 12, 72 }, //Key 13
{ 32, 73 }, //Key 14 //NOTE: Using Pin 32 instead of Pin 13, because LED is interupting normal signals
{ 14, 74 }, //Key 15
{ 15, 75 }, //Key 16
{ 16, 76 }, //Key 17
{ 17, 77 }, //Key 18
{ 18, 78 }, //Key 19
{ 19, 79 }, //Key 20
{ 20, 80 }, //Key 21
{ 21, 81 }, //Key 22
{ 22, 82 }, //Key 23
{ 23, 83 }, //Key 24
{ 24, 84 }, //Key 25
{ 25, 85 }, //Key 26
{ 26, 86 }, //Key 27
{ 27, 87 }, //Key 28
{ 28, 88 }, //Key 29
{ 29, 89 }, //Key 30
{ 30, 90 }, //Key 31
{ 31, 91 } //Key 32
};
void BounceSetup()
{
int i = 0;
while (i < nbKeys)
{
keys.button = Bounce(keys.pin, debounceTime);
i++;
}
}
void PullUpSetup()
{
int i = 0;
while (i < nbKeys)
{
pinMode(keys.pin, INPUT_PULLUP);
i++;
}
}
void setup()
{
/*Serial5.begin(9600);*/
// Setup the button
///pinMode( inputPin ,INPUT);
// Activate internal pull-up (optional)
///digitalWrite( inputPin ,HIGH);
// After setting up the button, setup the object
///bouncer .attach( inputPin );
///bouncer .interval(5);
BounceSetup();
PullUpSetup();
}
void UpdateKeys()
{
int i = 0;
while (i < nbKeys)
{
keys.button.update();
i++;
}
}
void SendNoteOn()
{
int i = 0;
while (i < nbKeys)
{
// Note On messages when each button is pressed
if (keys.button.fallingEdge()) {
usbMIDI.sendNoteOn(keys.value, noteOn, channel);
//Debug only
/*PinOutput(keys.pin, keys.value);*/
}
i++;
}
}
void SendNoteOff()
{
int i = 0;
while (i < nbKeys)
{
// Note Off messages when each button is released
if (keys.button.risingEdge()) {
usbMIDI.sendNoteOn(keys.value, noteOff, channel);
}
i++;
}
}
void DiscardAllInputs()
{
// MIDI Controllers should discard incoming MIDI messages.
while (usbMIDI.read()) {
}
}
void loop()
{
UpdateKeys();
SendNoteOn();
SendNoteOff();
DiscardAllInputs();
}
// a .cpp file or your main sketch (the .ino file).
#include <usb_names.h>
// Edit these lines to create your own name. The length must
// match the number of characters in your custom name.
#define MIDI_NAME {'M','F',' ','P','e','d','a','l','b','o','a','r','d'}
#define MIDI_NAME_LEN 13
// Do not change this part. This exact format is required by USB.
struct usb_string_descriptor_struct usb_string_product_name = {
2 + MIDI_NAME_LEN * 2,
3,
MIDI_NAME
};