Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Scripting output functions question

David Oct 10, 2018 02:10AM CEST

I'm having a problem working out the format for defining a midiout message (no problems with ctlout and noteout.
The manual states midiout(target,msg[])
If anyone could reply with the script to send a midi program change of 10 on channel 2 I can work it out from there.
Assistance would be very much appreciated!

Up 1 rated Down
MiluX Oct 12, 2018 07:56AM CEST
Hey David!
It's a little bit tricky to understand MIDI Messages. Hier is a quote from :

The MIDI message used to specify the instrument is called a "program change" message. It has one STATUS byte and one DATA byte :

Status byte : 1100 CCCC
Data byte 1 : 0XXX XXXX

where CCCC is the MIDI channel (0 to 15) and XXXXXXX is the instrument number from 0 to 127. Similarly to MIDI channels, you will often see that the instrument numbers in synthesizers and in GM lists, are numbered from 1 to 128 so you also need to add or subtract 1 for the conversion.

For instance, the trumpet instrument has number 57 in the GM list, so in the above MIDI message you must set XXXXXXX = 56 to get the correct instrument in the target synthesizer.

Because Lemur handles the binary conversion for you, you have to make the following conversion :
Channel 1 is 0000, Channel 2 is 0001, etc... So your first byte (PGM Change on Channel 2) will be : 1100 0001, which is 193 in decimal.
The second byte is the program number (10), here we don't need to convert.

Hence your script :



Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found