Giter Site home page Giter Site logo

Comments (10)

nanu-c avatar nanu-c commented on June 26, 2024 7
  • get a version of ofxMidi that works with yout version of openframeworks for 0.9.8
    $ cd /home/pi/opt/of/addons && git clone https://github.com/danomatika/ofxMidi/
  • add ofxMidi to ~/opt/of/apps/open-nsynth/open-nsynth/addons.make
  • in /home/pi/opt/of/apps/open-nsynth/open-nsynth/src/ofApp.h add at the beginning after the includes #include "ofxMidi.h" and change line 35 to
    class ofApp : public ofBaseApp, public ofxMidiListener{
  • add at line 73
               // the midi stuff
                void newMidiMessage(ofxMidiMessage& eventArgs);
                ofxMidiIn midiIn;
                ofxMidiMessage midiMessage;
  • In /home/pi/opt/of/apps/open-nsynth/open-nsynth/src/ofApp.cpp change after line 77 add at end of void ofApp::setup() -> adapt this to your needs
	// 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);
  • add at the end of ofApp.cpp
void ofApp::newMidiMessage(ofxMidiMessage& msg) {
		midiMessage = msg;
	// ofLog(OF_LOG_NOTICE,"channel: " + ofToString(midiMessage.channel) + " control: "
	// + ofToString(midiMessage.control) +" value: " + ofToString(midiMessage.value)+" pitch: " + ofToString(midiMessage.pitch)
	// +" velocity: " + ofToString(midiMessage.velocity));
		int idx;
		idx = midiMessage.pitch;
		if (msg.velocity == 127){
			synthMutex.lock();
			synth.on(idx);
			synthMutex.unlock();
		}
		else{
			synthMutex.lock();
			synth.off(idx);
			synthMutex.unlock();
		}
}
  • in ~/opt/of/apps/open-nsynth/open-nsynth run $ make -j4
  • stop nysth service sudo service open-nsynth stop
  • run compiled app $ bin/open-nsynth

from open-nsynth-super.

nanu-c avatar nanu-c commented on June 26, 2024 2

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

from open-nsynth-super.

KyleWerle avatar KyleWerle commented on June 26, 2024 1

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.

from open-nsynth-super.

nanu-c avatar nanu-c commented on June 26, 2024 1

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

from open-nsynth-super.

nwesthoff avatar nwesthoff commented on June 26, 2024

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.

from open-nsynth-super.

nanu-c avatar nanu-c commented on June 26, 2024

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

from open-nsynth-super.

hagan66 avatar hagan66 commented on June 26, 2024

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. :-)

from open-nsynth-super.

gitunit avatar gitunit commented on June 26, 2024

@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.

from open-nsynth-super.

gitunit avatar gitunit commented on June 26, 2024

@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?

from open-nsynth-super.

gitunit avatar gitunit commented on June 26, 2024

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

from open-nsynth-super.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.