googlecreativelab / open-nsynth-super

Open NSynth Super is an experimental physical interface for the NSynth algorithm
Apache License 2.0
2.42k stars 270 forks source link

MIDI over USB #29

Closed nwesthoff closed 6 years ago

nwesthoff commented 6 years ago

I would like to send MIDI over USB from a Traktor Pro Remix Deck (in step sequence or one-shot mode) to be able to use the NSynth Super in a live environment while DJ'ing.

Is it possible to send MIDI over USB? Or do I have to use the 5-pin DIN port? If this is currently not possible, could it be added using an openFrameworks package? I couldn't find anything about it in the docs, and would try myself, but I'm currently waiting for the PCB to arrive.

KyleWerle commented 6 years ago

The NSynth can only send / receive MIDI over USB as a USB Host. It is less easy to send MIDI between two host computers. There are many ways to do what you want, but very few of them are easy to setup and none as easy as connecting the NSynth Super to your computer with a USB cable.

The easiest solution in this case is to use a USB to MIDI DIN Adapter.

nwesthoff commented 6 years ago

Okay! It would make the whole live setup a little more cumbersome, but fortunately my audio interface already has MIDI DIN in/out, so I'll just get a cable and be done with it. Thanks.

nanu-c commented 6 years ago

This is easly done by adding the ofxMidi library to the app

nanu-c commented 6 years ago

I can expand the openframeworksapp to do that and it's only some 20 lines of code

nanu-c commented 6 years ago
    // print input ports to console 
    midiIn.listPorts(); // via instance -> comment this line when done
    //ofxMidiIn::listPorts(); // via static as well

    // open port by number (you may need to change this)
    midiIn.openPort(1);
    //midiIn.openPort("IAC Pure Data In");  // by name
    //midiIn.openVirtualPort("ofxMidiIn Input"); // open a virtual port

    // don't ignore sysex, timing, & active sense messages,
    // these are ignored by default
    midiIn.ignoreTypes(false, false, false);

    // add ofApp as a listener
    midiIn.addListener(this);

    // print received messages to the console
midiIn.setVerbose(true);
hagan66 commented 6 years ago

Has anyone done this and prepared a ready-to-go image file? I have no recent programming experience but I would very much like my Nsynth to speak USB. :-)

gitunit commented 5 years ago

@nanu-c thx for the code. there is a minor typo though. it should be "listInPorts()" instead of "listPorts" at least in the latest version of ofxMidi.

gitunit commented 5 years ago

@nanu-c seems not that easy. have you tested it yourself? im unable to list the port created with "loopMIDI" in Windows. i have connected the device via the pcb's USB port with the PC. should i use the USB port on the pi instead?

nanu-c commented 5 years ago

it's different, you have to put a usbmidi device in the raspberry pi. Like a akai or so. If you wan't to use your pcb as usbmidi it's not possible like that because I think the usb connector on the pcb is only for power.

if you want use the touch/knobs as midi input and send it to a other machine there a 2 common ways to do it.

  1. connect the rpi to your windows network

  2. use either https://github.com/hiroyuki/ofxArtnet for Artnet or

osc depending what is supported py the program you try to use in windows. https://github.com/openframeworks/openFrameworks/tree/patch-release/addons/ofxOsc https://www.youtube.com/watch?v=TczI-tSOIpY

gitunit commented 5 years ago

ok. i get it. thx for clarification. btw. im from vienna, too. saw your homepage. nice projects ;)