MIDI_INSTRUMENT

MIDI_INSTRUMENT N

THE USED MIDI INSTRUMENT IS THE INSTRUMENT NUIMBER N

  • Type: Command
  • Parameter: 1
  • Group: MIDI

ACTION

The command MIDI_INSTRUMENT N set the MIDI instrument used to the MIDI output.

N must be between 1 and 127.

Remark: the quality of the instrument depends on the sound card.

Some instruments:

xylophone = 13

harmonica = 22

guitar = 24

violin = 40

flute = 73

bag pipe = 109

seashore = 123

telephone ring = 124

SYNTAX: MIDI_INSTRUMENT N

  • N = MIDI code of the instrument (integer or real).

USE

  • The command MIDI_INSTRUMENT is used to change the MIDI instrument used to the MIDI output.

ERROR

  • If MIDI output is not ON (MIDI_ON).
  • If value N is less than 1 or more than 127.
  • If value N is not a correct expression.

EXAMPLE

label play

midi_on

print "5 notes"

print " played by a xylophone"

midi_instrument 13

gosub play

print " by an harmonica"

midi_instrument 22

gosub play

print " by a guitar"

midi_instrument 24

gosub play

print " by a violin"

midi_instrument 40

gosub play

print " by a flute"

midi_instrument 73

gosub play

print " by a bag pipe"

midi_instrument 109

gosub play

print " by birds"

midi_instrument 123

gosub play

print " by a telephone ring"

midi_instrument 124

gosub play

midi_off

end

play:

midi_play 60,6

midi_play 62,6

midi_play 64,6

midi_play 65,6

midi_play 67,6

return

SEE ALSO

MIDI_OFF

MIDI_ON

MIDI_PLAY

MIDI_VOLUME