Android Question How to play single midi note?

watesoft

Active Member
Licensed User
Longtime User
I searched the forum and found some examples about midi, but I am still confused. I don’t know how to start, or even how to initialize an instrument.
In addition, when playing multiple notes, I wanted to change the instrument in the middle and found a way in forum, but the debugging failed.
https://www.b4x.com/android/forum/threads/midisystem.50106/page-2
 

Attachments

  • midi note.zip
    9.5 KB · Views: 72

stevel05

Expert
Licensed User
Longtime User
Here is a simple example. Salient points are:

You need to initialize some modules first.
You can get the default receiver from MidiDevice_Static

You only need to worry about generating Midi Messages when dealing with sequences and adding them to tracks. For real-time use it is simpler to send the messages as byte arrays.

On my device, some of the pianos sound the same, and some programs appear not to have a sound associated with them (unless they were just quiet), this may be different on each device.

Hope this helps
 
Upvote 0

watesoft

Active Member
Licensed User
Longtime User
Here is a simple example. Salient points are:

You need to initialize some modules first.
You can get the default receiver from MidiDevice_Static

You only need to worry about generating Midi Messages when dealing with sequences and adding them to tracks. For real-time use it is simpler to send the messages as byte arrays.

On my device, some of the pianos sound the same, and some programs appear not to have a sound associated with them (unless they were just quiet), this may be different on each device.

Hope this helps

Many thanks, I open midi project, MidiSystem_Static shows "Unknown member: initialize",maybe I lost a library, but IDE don't tell me.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Hmm, not sure what happened there. Please download the library again and try with this project. As I said, it's been a while.
 

Attachments

  • midi.zip
    9.9 KB · Views: 56
Upvote 0

watesoft

Active Member
Licensed User
Longtime User
Hmm, not sure what happened there. Please download the library again and try with this project. As I said, it's been a while.
Thanks to stevel
I download the library again, but it not work, now I will try to use js.
 
Upvote 0
Top