Page 1 of 1

Midi Interface, total newbie

Posted: Mon Nov 11, 2013 1:43 am
by rdnzl
Hello there,

Growing frustrated from bad support for midi / usb on win & mac os, I thought I would do a bit of programming on a raspberry...

So, here it, where do I start? I have some knowledge of the midi implementation in Java, and so I could start there, but I am open to all suggestions...

Kind Regards

Re: Midi Interface, total newbie

Posted: Mon Nov 11, 2013 11:59 am
by KenT
sudo apt-get install timidity to get midi onto the Pi

Look at the three tetris based Python Games examples. Location of these will be reveled by opening the desktop icon in leafpad

Re: Midi Interface, total newbie

Posted: Mon Nov 11, 2013 1:24 pm
by Douglas6
Java has excellent MIDI support, and Linux has good support for USB midi devices. I was able to simply plug in my AKAI MPD18 pad controller to trigger MIDI sequences that I used to control a 8x relay board. I haven't tried the Java synthesizer yet, but you can also use Linux virtual MIDI to pass-through to, say, FluidSynth. In my brief tinkering, I was fairly impressed with the latency of the Pi, even without jackd or other tweaks. [EDIT: I am not a musician; your results may vary. Remember it's a Raspberry pi.]

Re: Midi Interface, total newbie

Posted: Mon Nov 11, 2013 7:36 pm
by AutoStatic
rdnzl wrote:So, here it, where do I start?
Discover what's already there and make sure you're not going to reinvent the wheel ;) And do you have any idea what you'd like to develop? Software that takes MIDI as an input (synth, drum machine, sampler) or that filters MIDI events? Or maybe something like a sequencer? Or would you like to work on a lower level (thinking drivers here)?

Re: Midi Interface, total newbie

Posted: Mon Nov 11, 2013 7:47 pm
by rdnzl
Hey,

For now, I just want a dead simple midi patch bay. Probably when I get comfortable with the dev cycle, I will filter, then map events, and so on...

Re: Midi Interface, total newbie

Posted: Mon Nov 11, 2013 7:58 pm
by DougieLawson
KenT wrote:sudo apt-get install timidity to get midi onto the Pi
That gets you the software side of MIDI but doesn't provide the hardware side that used to let you wire a MIDI instrument to a PC soundcard (first seen on Apple ][, Apple ][e and C64s).

That could be an interesting hardware project.

Re: Midi Interface, total newbie

Posted: Mon Nov 11, 2013 9:37 pm
by MoosePi

Re: Midi Interface, total newbie

Posted: Tue Nov 12, 2013 12:54 pm
by AutoStatic
rdnzl wrote:For now, I just want a dead simple midi patch bay.
Then you might want to check out aconnect or its GUI frontend aconnectgui.
rdnzl wrote:Probably when I get comfortable with the dev cycle, I will filter, then map events, and so on...
Check out midish, mididings or ALSA MIDI Filter.

Re: Midi Interface, total newbie

Posted: Tue Nov 12, 2013 1:13 pm
by AutoStatic
DougieLawson wrote:That gets you the software side of MIDI but doesn't provide the hardware side that used to let you wire a MIDI instrument to a PC soundcard (first seen on Apple ][, Apple ][e and C64s).

That could be an interesting hardware project.
http://zuzebox.wordpress.com/2012/03/18 ... -pi-v0-10/
You could also do this with a $6 USB-MIDI cable: http://dx.com/p/usb-2-0-to-midi-convert ... gth-110980

Re: Midi Interface, total newbie

Posted: Tue Nov 12, 2013 2:33 pm
by tjsheffler
Hi rdnzl -

Here are a few pointers I've found useful to get started programming midi on the Pi:

- Python on the Pi comes with PyGame installed and its own midi wrapper around ALSA. Here is an example
that shows how to talk to pygame.midi

https://bitbucket.org/pygame/pygame/src ... es/midi.py

- I've enjoyed reading this series of articles by Craig Stuart Sapp. He shows simple programming examples in C
for talking to OSS devices and ALSA devices.

https://ccrma.stanford.edu/~craig/articles/linuxmidi/

- Before you begin compiling C code that access ALSA you'll need to install the libasound2-dev package. (You'll need gcc too, of course)
% sudo apt-get install libasound2-dev
- Here's a nice article on how ALSA reveals itself through the /proc filesystem

http://alsa.opensrc.org/Proc_asound_documentation

Have some fun!

Re: Midi Interface, total newbie

Posted: Wed Dec 25, 2013 12:08 am
by rdnzl
Okay,

I might start doing some work, will read the articles, and have a good look at mididings...

Cheers

Re: Midi Interface, total newbie

Posted: Fri Oct 03, 2014 1:05 pm
by ilmostro
A MIDI interface to RTP (Midi over Ethernet) would be awesome. I believe the RTP code is open source, so it should be possible.

Re: Midi Interface, total newbie

Posted: Mon Dec 22, 2014 9:13 am
by robin48gx
Hi

Midi is just Rs-232 at 31k bps I think.
Does the timidity program act as a USB host. If so it might be quite easy
to get the timidity program to simply pass midi messages it receives
on to the Rs-232. Viola! and we have a midi interface that can go on a modern piano which only
has USB (like the Yamamha P105)

Re: Midi Interface, total newbie

Posted: Sun Jan 11, 2015 1:59 pm
by ur_rnorn_says_hi
This falls in line somewhat with a project I am about to startt. About to as in later this afternoon... unless i can't find any real direction or find out i'm going in the wrong direction. I am going to work on a device that will trigger lighting, or other visual effects via either an internal trigger (for things like projection or random graphics) or an external relay bank (for dumb lights, christmas lights etc) or via midi (dmx technically, but dmx is just modified midi, for 'smart' lighting). I would like to be able to bind triggers to things like specific notes @ specific frequencies, a progression of notes, at a specific time in the track, at the 'break down' or 'break' (so basically at drastic changes, but also would like to try and use predictive analysis to try and determine the length in beats of the 'break' so that a dramatic lighting change would already be waiting )... I know that something like Pure Data and Max MSP would do what im trying to do, but it's too robust and processor intensive for what i am envisioning... anyone have any thoughts, or suggestions?

Re: Midi Interface, total newbie

Posted: Mon Jan 04, 2016 11:32 pm
by JovianPyx
AutoStatic wrote:
DougieLawson wrote:That gets you the software side of MIDI but doesn't provide the hardware side that used to let you wire a MIDI instrument to a PC soundcard (first seen on Apple ][, Apple ][e and C64s).

That could be an interesting hardware project.
http://zuzebox.wordpress.com/2012/03/18 ... -pi-v0-10/
You could also do this with a $6 USB-MIDI cable: http://dx.com/p/usb-2-0-to-midi-convert ... gth-110980
I have this exact USB-MIDI cable (DIGIFLEX) and while lsusb shows the device and ALSA can connect it, I've not been able to make it work with ZynAddSubFX. My MIDIsport 2x2 works perfectly, but when I use the DIGIFLEX cable device, I get error messages from ZynAddSubFX such as:

Code: Select all

Damage("/part15/")
Info, other non-handled midi event, type: 36
other type numbers were output as well along with

Code: Select all

Damage("/part0/")
I don't know what those messages mean, but they don't occur when I use the MIDIsport device - and the synth plays notes with the MIDIsport where it plays nothing with the DIGIFLEX.

I have made the assumption that there's no driver to install?

I'm using a Raspberry Pi 2 B running Arch Linux with kernel 4.1.13-1.2-WSP (the WSP part is there because I'm also using a Cirrus/Element14 audio card).

Can anyone shed some light?

Re: Midi Interface, total newbie

Posted: Wed Mar 01, 2017 9:36 am
by rroor
by ilmostro ยป Fri Oct 03, 2014 1:05 pm
A MIDI interface to RTP (Midi over Ethernet) would be awesome. I believe the RTP code is open source, so it should be possible.
For the moment, no RTP MIDI stack and drivers looks available under Linux. Best solution is to use an external MIDI interface to get RTP connectivity. Midigateway Network MIDI interface from Cinara looks to make the job by providing access to MIDI ports and RTP midi sessions over Ethernet. Connection to the host (rpi) is done using USB.

Re: Midi Interface, total newbie

Posted: Thu Jan 03, 2019 12:47 am
by mclarenlabs
Take a look at rtpmidi from McLaren Labs.

https://mclarenlabs.com

It is a commercial product, but not expensive. And it was designed for the Raspberry Pi :-)