Procedures

ProcedureLocationProcedure TypeDescription
analyze la_folia Subroutine

Receives a string with an encoded chord, and returns its fundamental, the type of chord and its encoded value

checked_int16 utilities Function

Receives a default kind integer, checks its bounds (Fortran signed int), fixes it if needed, and returns an int16:

checked_int32 utilities Function

Receives a default kind integer, checks its bounds (Fortran signed int), fixes it if needed, and returns an int32.

checked_int8 utilities Function

Receives a default kind integer, checks its MIDI bounds (15 or 127), fixes it if needed, and returns an int8:

close MIDI_file_class Subroutine

Closes the MIDI file.

Control_Change MIDI_file_class Subroutine

Many MIDI parameters can be set by Control Change. See the list.

copyright_notice MIDI_file_class Subroutine

Copyright Notice event: FF 02 len text

cue_point MIDI_file_class Subroutine

Cue Point event: FF 07 len text

delta_time MIDI_file_class Subroutine

Each MIDI event must be preceded by a delay called "delta time", expressed in MIDI ticks.

dotted music Function

Returns the value of a dotted note.

end_of_track MIDI_file_class Subroutine

A track must end with 0xFF2F00.

get_name MIDI_file_class Function

Returns the name of the MIDI file:

init_formidi MIDI_file_class Subroutine

Verifies the needed data types.

instrument_name MIDI_file_class Subroutine

Instrument Name event: FF 04 len text

lyric MIDI_file_class Subroutine

Lyric event: FF 05 len text

marker MIDI_file_class Subroutine

Marker event: FF 06 len text

MIDI_Note music Function

Returns the MIDI note number, from 12 (C0) to 127 (G9). The note name is composed of two or three characters, for example "A4", "A#4", "Ab4", where the final character is the octave.

new MIDI_file_class Subroutine

Create a new MIDI file and its metadata track. Concerning the "divisions" argument, ForMIDI uses the "metrical timing" scheme, defining the number of ticks in a quarter note. The "timecode" scheme is not implemented. SMF format: 0: only one track in the file 1: several tracks played together (generally used) 2: several tracks played sequentially

note_name music Function

Receives a MIDI note (for example 69), and returns the name of the note (for example A4). It works also with the octave -1, although most of its notes are too low for hearing.

Note_OFF MIDI_file_class Subroutine

Writes a Note OFF event. MIDI notes are in the range 0..127 The release velocity is in the range 0..127.

Note_ON MIDI_file_class Subroutine

Writes a Note ON event. MIDI notes are in the range 0..127 The attack velocity is in the range 1..127 and will set the volume. A Note ON event with a zero velocity is equivalent to a Note OFF.

Pitch_Bend MIDI_file_class Subroutine

Apply a pitch bend to all notes currently sounding on the channel. No bend is 00 40 (64 in decimal), maximum downward bend is 00 00, maximum upward bend is 7F 7F. The Least Significant Byte (lsb) is optional (default value is 0), as it is useful only for fine adjustment. You can not use it with play_note, play_chord or play_broken_chord: you must manage yourself the Note ON and Note OFF events, and put the bend between.

play_broken_chord MIDI_file_class Subroutine

Writes a broken chord using an array containing the intervals (see the music_common module). https://en.wikipedia.org/wiki/Arpeggio You must pass either a scalar value (whole duration) or a values array (containing the values for each note).

play_chord MIDI_file_class Subroutine

Writes a chord, waits for its duration, and writes the OFF events

play_note MIDI_file_class Subroutine

Write a Note ON event, waits for its duration, and writes a Note OFF.

Program_Change MIDI_file_class Subroutine

Each channel (0..15) can use one General MIDI instrument (0..127) at a time.

sequence_track_name MIDI_file_class Subroutine

Sequence or Track Name event: FF 03 len text

set_tempo MIDI_file_class Subroutine

Specifies a tempo change by writing the duration of a quarter note expressed in µs. It is coded on 3 bytes: from 1 µs to 256**3 µs ~ 16.7 s. A duration of 500000 µs = 0.5 s is equivalent to a 120 bpm tempo. https://en.wikipedia.org/wiki/Tempo MIDI events must always be preceded by a "delta time", even if null:

Read more…
set_time_signature MIDI_file_class Subroutine

The time signature includes the numerator, the denominator, the number of MIDI clocks between metronome ticks, (there are 24 MIDI clocks per quarter note) and the number of 32nd notes in a quarter note. The number of "MIDI clocks" between metronome clicks.

text_event MIDI_file_class Subroutine

Text event: FF 01 len text

track_header MIDI_file_class Subroutine

Writes a track header and stores the position where the size of the track will be written when the track will be closed.

variable_length_quantity MIDI_file_class Function

MIDI delta times are composed of one to four bytes, depending on their values. If there is still bytes to write, the MSB (most significant bit) of the current byte is 1, else 0. This functions is automatically tested. https://en.wikipedia.org/wiki/Variable-length_quantity

write_string MIDI_file_class Subroutine

This subroutine is used my many events. The text must be coded in ASCII (7 bits).

write_track_size MIDI_file_class Subroutine

Must be called when the track is finished. It writes its size at the memorized position in the track header.

write_variable_length_quantity MIDI_file_class Subroutine

Writes the integer i in the MIDI file using the variable length quantity representation:

call~~graph~~CallGraph proc~analyze analyze proc~checked_int16 checked_int16 proc~checked_int32 checked_int32 proc~checked_int8 checked_int8 proc~close MIDI_file%close proc~control_change MIDI_file%Control_Change proc~control_change->proc~checked_int8 proc~delta_time MIDI_file%delta_time proc~control_change->proc~delta_time proc~copyright_notice MIDI_file%copyright_notice proc~write_string MIDI_file%write_string proc~copyright_notice->proc~write_string proc~cue_point MIDI_file%cue_point proc~cue_point->proc~write_string proc~delta_time->proc~checked_int32 proc~write_variable_length_quantity MIDI_file%write_variable_length_quantity proc~delta_time->proc~write_variable_length_quantity proc~dotted dotted proc~end_of_track MIDI_file%end_of_track proc~end_of_track->proc~delta_time proc~write_track_size MIDI_file%write_track_size proc~end_of_track->proc~write_track_size proc~get_name MIDI_file%get_name proc~init_formidi MIDI_file%init_formidi proc~instrument_name MIDI_file%instrument_name proc~instrument_name->proc~write_string proc~lyric MIDI_file%lyric proc~lyric->proc~write_string proc~marker MIDI_file%marker proc~marker->proc~write_string proc~midi_note MIDI_Note proc~new MIDI_file%new proc~new->proc~checked_int16 proc~new->proc~checked_int32 proc~new->proc~checked_int8 proc~new->proc~copyright_notice proc~new->proc~end_of_track proc~new->proc~init_formidi proc~set_tempo MIDI_file%set_tempo proc~new->proc~set_tempo proc~set_time_signature MIDI_file%set_time_signature proc~new->proc~set_time_signature proc~text_event MIDI_file%text_event proc~new->proc~text_event proc~track_header MIDI_file%track_header proc~new->proc~track_header proc~note_name note_name proc~note_name->proc~checked_int8 proc~note_off MIDI_file%Note_OFF proc~note_off->proc~checked_int8 proc~note_on MIDI_file%Note_ON proc~note_on->proc~checked_int8 proc~pitch_bend MIDI_file%Pitch_Bend proc~pitch_bend->proc~checked_int8 proc~pitch_bend->proc~delta_time proc~play_broken_chord MIDI_file%play_broken_chord proc~play_broken_chord->proc~checked_int32 proc~play_broken_chord->proc~delta_time proc~play_broken_chord->proc~note_off proc~play_broken_chord->proc~note_on proc~play_chord MIDI_file%play_chord proc~play_chord->proc~checked_int32 proc~play_chord->proc~delta_time proc~play_chord->proc~note_off proc~play_chord->proc~note_on proc~play_note MIDI_file%play_note proc~play_note->proc~checked_int32 proc~play_note->proc~delta_time proc~play_note->proc~note_off proc~play_note->proc~note_on proc~program_change MIDI_file%Program_Change proc~program_change->proc~checked_int8 proc~program_change->proc~delta_time proc~sequence_track_name MIDI_file%sequence_track_name proc~sequence_track_name->proc~write_string proc~set_tempo->proc~checked_int32 proc~set_tempo->proc~delta_time proc~set_time_signature->proc~checked_int8 proc~set_time_signature->proc~delta_time proc~text_event->proc~write_string proc~track_header->proc~sequence_track_name proc~track_header->proc~text_event proc~variable_length_quantity variable_length_quantity proc~write_string->proc~checked_int8 proc~write_string->proc~delta_time proc~write_string->proc~write_variable_length_quantity proc~write_variable_length_quantity->proc~variable_length_quantity program~blues blues program~blues->proc~control_change program~blues->proc~delta_time program~blues->proc~end_of_track program~blues->proc~get_name program~blues->proc~midi_note program~blues->proc~new program~blues->proc~note_off program~blues->proc~note_on program~blues->proc~play_chord program~blues->proc~program_change program~blues->proc~track_header program~canon canon program~canon->proc~control_change program~canon->proc~end_of_track program~canon->proc~get_name program~canon->proc~midi_note program~canon->proc~new program~canon->proc~play_note program~canon->proc~program_change program~canon->proc~track_header program~circle_of_fifths circle_of_fifths program~circle_of_fifths->proc~control_change program~circle_of_fifths->proc~end_of_track program~circle_of_fifths->proc~get_name program~circle_of_fifths->proc~midi_note program~circle_of_fifths->proc~new program~circle_of_fifths->proc~play_chord program~circle_of_fifths->proc~program_change program~circle_of_fifths->proc~track_header program~la_folia la_folia program~la_folia->proc~analyze program~la_folia->proc~control_change program~la_folia->proc~dotted program~la_folia->proc~end_of_track program~la_folia->proc~get_name program~la_folia->proc~midi_note program~la_folia->proc~new program~la_folia->proc~play_broken_chord program~la_folia->proc~play_chord program~la_folia->proc~program_change program~la_folia->proc~track_header program~motifs motifs program~motifs->proc~control_change program~motifs->proc~dotted program~motifs->proc~end_of_track program~motifs->proc~get_name program~motifs->proc~midi_note program~motifs->proc~new program~motifs->proc~play_broken_chord program~motifs->proc~play_chord program~motifs->proc~play_note program~motifs->proc~program_change program~motifs->proc~track_header program~third_kind third_kind program~third_kind->proc~end_of_track program~third_kind->proc~get_name program~third_kind->proc~midi_note program~third_kind->proc~new program~third_kind->proc~play_note program~third_kind->proc~program_change program~third_kind->proc~track_header
Help