Midi commands

Литература по BASIC
Post Reply
smbstarv
Posts: 98
Joined: Wed Nov 27, 2013 3:44 pm
My devices: Ipad 6th gen
Flag: Netherlands
Contact:

Midi commands

Post by smbstarv »

I'm trying to figure out which midi-commands have been implemented...
Although I understand explaining MIDI is beyond the scope of the tutorial, I hope you could give me some more information on the commands that can be used in SB to generate MIDI-messages.
Thank you.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Midi commands

Post by Mr. Kibernetik »

All MIDI commands are valid because your iOS device is a General MIDI 1.0 compatible gadget.

You can use NOTES MIDI t, cmd,a,b command to send MIDI messages.
t - music track to receive MIDI command
cmd - MIDI command
a,b - parameters of MIDI command

You can ask more specific question about any MIDI command you are interested in.
Also you can check "MIDI synthesizer.txt" sample to see how MIDI commands are implemented.

smbstarv
Posts: 98
Joined: Wed Nov 27, 2013 3:44 pm
My devices: Ipad 6th gen
Flag: Netherlands
Contact:

Re: Midi commands

Post by smbstarv »

Thank you for your reply. But I still need your help.
I refer to "NOTES MIDI t, cmd,a,b"
From the sample program, I recognize cmd = 9 for Note "a" On with volume "b", and cmd =12 for choosing "a" as instrument.
Am I right that cmd=11 sets the overal volume to "b" ? And cmd=8 for Note-off for key "a" ?
There may be other useful commands, but where can I find them ?

How do I write a midicommand to sound a percussioninstrument e.g. Bassdrum (35) on track 10 ?
Thank you for your patience with this user, who is by the way very enthousiastic about SB.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Midi commands

Post by Mr. Kibernetik »

You should understand that MIDI interface was designed to transmit musician activity on his keyboard to sound production device, in real time. So every musician movement is encoded as MIDI command and is sent to sound sampler.
smbstarv wrote:From the sample program, I recognize cmd = 9 for Note "a" On with volume "b", and cmd =12 for choosing "a" as instrument.
cmd = 9 is to start playing note "a" with key press velocity "b"
cmd = 8 is to stop playing note "a" with key release velocity "b"
cmd = 12 is for choosing "a" as instrument
smbstarv wrote:Am I right that cmd=11 sets the overal volume to "b" ? And cmd=8 for Note-off for key "a" ?
No, cmd = 11 is for controller commands. There are many of them depending on "a" value.
Yes, cmd = 8 is key release command for key "a".
smbstarv wrote:There may be other useful commands, but where can I find them ?
At first you can refer to Dutchman manual, section 9.2.
More complete list of MIDI commands you can find here. For example there is a list of controller commands for cmd = 11.
smbstarv wrote:How do I write a midicommand to sound a percussioninstrument e.g. Bassdrum (35) on track 10 ?
Please note that tracks numerically start with 0, so Track #1 has number 0 and Track #10 has number 9 in MIDI commands.

Code: Select all

1 notes midi 9,9,35,127 'start playing Bass Drum
pause 0.3
notes midi 9,8,35,127 'stop playing Bass Drum
pause 0.5
notes midi 9,9,38,127 'start playing Snare Drum
pause 0.3
notes midi 9,8,38,127 'stop playing Snare Drum
pause 0.5
goto 1

Post Reply