MIDI_PLAY

MIDI_PLAY N,T

PLAYS THE NOTE N OF TYPE T TO THE MIDI OUTPUT

  • Type: Command
  • Parameters: 2
  • Group: MIDI

ACTION

The command MIDI_PLAY N,T plays the note N of type T to the MIDI output.

N follows the MIDI convention (60 = C octave #4, 62 = D octave #4, ...) and must be between 21 and 108. N is the frequency.

T is the duration between 0 and 11, defined as follows:

0 : whole note (semibreve), duration = 4000 milliseconds

1 : dotted whole note (dotted semibreve), duration = 6000 milliseconds

2 : half note (minim), duration = 2000 milliseconds

3 : dotted half note (dotted minim), duration = 3000 milliseconds

4 : quarter note (crotchet), duration = 1000 milliseconds

5 : dotted quarter note (dotted crotchet), duration = 1500 milliseconds

6 : eighth note (quaver), duration = 500 milliseconds

7 : dotted eighth note (dotted quaver), duration = 750 milliseconds

8 : sixteenth note (semiquaver), duration = 250 milliseconds

9 : dotted sixteenth note (dotted semiquaver), duration = 375 milliseconds

10: thirty-second note (demisemiquaver), duration = 125 milliseconds

11: dotted thirty-second note (dotted demisemiquaver), duration = 188 milliseconds

SYNTAX: MIDI_PLAY N,T

  • N = MIDI code of the note (integer or real).
  • T = code for the duration (integer or real).

USE

  • The command MIDI_PLAY is used to play notes individually to a MIDI output.

ERROR

  • If MIDI output is not ON (MIDI_ON).
  • If value N is less than 21 or more than 108.
  • If value N is not a correct expression.
  • If value T is less than 0 or more than 11.
  • If value T is not a correct expression.

EXAMPLE

midi_on

rem set of 2 quarter notes (crotchets) C, D

midi_play 60,4

midi_play 62,4

rem set of 3 eighth notes (quavers) E, F, G

midi_play 64,6

midi_play 65,6

midi_play 67,6

midi_off

SEE ALSO

MIDI_INSTRUMENT

MIDI_OFF

MIDI_ON

MIDI_VOLUME