Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Midi generation and playback on Android: Possible?

Tags:

android

midi

Strangely I find no support for Midi in Android. The only thing that comes close is the Jetplayer, but this only takes a existing .jet file.

I want to dynamically generate a midi file with some intervals and play it. I even thought about just manually creating a .jet file with a tone and then transposing it with the jet player, but it limits the transposing to -12, +12. Which is not so good for me.

There also is a ToneGenerator on Android, but it's limited to predefined tones with no way to transpose.

Does someone know how to achieve midi generation and playback on Android?

like image 963
Peterdk Avatar asked Apr 12 '10 20:04

Peterdk


People also ask

Can Android play MIDI files?

Midi Sheet Music is a free Android application for converting MIDI music files into sheet music. It simultaneously plays MIDI music files, highlights the piano notes, and highlights the sheet music notes.

What is MIDI mode in Android?

The Android MIDI package allows users to: Connect a MIDI keyboard to Android to play a synthesizer or drive music apps. Connect alternative MIDI controllers to Android. Drive external MIDI synths from Android. Drive external peripherals, lights, show control, etc from Android.


3 Answers

Perhaps this Pragmatic Programmer thread might be of interest.

like image 119
Alex Reynolds Avatar answered Oct 05 '22 00:10

Alex Reynolds


I currently settled for the dynamic generation of midi files that then are fed to the MediaPlayer. It's quite easy to build a simple midi file generator and the MediaPlayer works correctly with it.

I do have opened a feature request for direct streaming access to the synthesizer. If you are interested in streaming midi, please rate, star, comment there.

like image 30
Peterdk Avatar answered Oct 04 '22 23:10

Peterdk


Better late than never, but there's a bare-bones Java MIDI library on Google Code here: http://code.google.com/p/android-midi-lib/

That can handle MIDI file generation and you can use MediaPlayer to play it back supposedly.

like image 44
LeffelMania Avatar answered Oct 05 '22 00:10

LeffelMania