tttapa / MIDI_controller

This is a library for creating a MIDI controller using an Arduino or Teensy board.
GNU General Public License v3.0
404 stars 69 forks source link

DIN midi output? #75

Closed lameller closed 5 years ago

lameller commented 5 years ago

Hi

How would i go about using a standard DIN midi socket to send midi from the arduino instead of through the usb port?

tttapa commented 5 years ago

Connect the hardware like this: https://tttapa.github.io/Arduino/MIDI/Chap02-MIDI-Hardware.html And you could use the following code:

HardwareSerialMIDI_Interface midi(Serial, MIDI_BAUD);
Rolbista commented 5 years ago

After using it like this before setup() it throws an error:

Verifying...
DynamicCCPot:42: error: no matching function for call to 'HardwareSerialMIDI_Interface::HardwareSerialMIDI_Interface(Serial_&, int)'
 HardwareSerialMIDI_Interface midi(Serial, MIDI_BAUD);
                                                    ^
/Users/wojciechg/repos/arduino-midi/DynamicCCPot.ino:42:52: note: candidates are:
In file included from /Users/wojciechg/Documents/Arduino/libraries/MIDI_controller-master/src/MIDI_Controller.h:26:0,
                 from /Users/wojciechg/repos/arduino-midi/DynamicCCPot.ino:3:
/Users/wojciechg/Documents/Arduino/libraries/MIDI_controller-master/src/./MIDI_Interfaces/SerialMIDI_Interface.h:57:3: note: HardwareSerialMIDI_Interface::HardwareSerialMIDI_Interface(HardwareSerial&, long unsigned int)
   HardwareSerialMIDI_Interface(HardwareSerial &serial, unsigned long baud) : SerialMIDI_Interface(serial, baud) {}
   ^
/Users/wojciechg/Documents/Arduino/libraries/MIDI_controller-master/src/./MIDI_Interfaces/SerialMIDI_Interface.h:57:3: note:   no known conversion for argument 1 from 'Serial_' to 'HardwareSerial&'
/Users/wojciechg/Documents/Arduino/libraries/MIDI_controller-master/src/./MIDI_Interfaces/SerialMIDI_Interface.h:54:7: note: constexpr HardwareSerialMIDI_Interface::HardwareSerialMIDI_Interface(const HardwareSerialMIDI_Interface&)
 class HardwareSerialMIDI_Interface : public SerialMIDI_Interface<HardwareSerial>
       ^
/Users/wojciechg/Documents/Arduino/libraries/MIDI_controller-master/src/./MIDI_Interfaces/SerialMIDI_Interface.h:54:7: note:   candidate expects 1 argument, 2 provided
/Users/wojciechg/Documents/Arduino/libraries/MIDI_controller-master/src/./MIDI_Interfaces/SerialMIDI_Interface.h:54:7: note: constexpr HardwareSerialMIDI_Interface::HardwareSerialMIDI_Interface(HardwareSerialMIDI_Interface&&)
/Users/wojciechg/Documents/Arduino/libraries/MIDI_controller-master/src/./MIDI_Interfaces/SerialMIDI_Interface.h:54:7: note:   candidate expects 1 argument, 2 provided
exit status 1
tttapa commented 5 years ago

What board are you using? Different boards have different inheritance structures for the class of "Serial", requiring me to manually add support for each board.

Rolbista commented 5 years ago

Yeah, I have figured that out now, using HardwareSerialMIDI_Interface midi(Serial1, MIDI_BAUD); it compiled. I still need to test it with actual components but it should be ok.

CaBachhav commented 5 years ago

What if We want both way output simultaneously , like over USB & TX out also. All professional gears have both type of output.