Offers music parameters and functions specific to MIDI files.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | eighth_note | = | quarter_note/2 | |
integer, | public, | parameter | :: | f_level | = | 80 | |
integer, | public, | parameter | :: | ff_level | = | 96 | |
integer, | public, | parameter | :: | fff_level | = | 112 | |
integer, | public, | parameter | :: | ffff_level | = | 127 |
Common note levels expressed as MIDI velocities https://arxiv.org/pdf/1705.05322 |
integer, | public, | parameter | :: | half_note | = | 2*quarter_note | |
integer, | public, | parameter | :: | mf_level | = | 64 | |
integer, | public, | parameter | :: | mp_level | = | 53 | |
integer, | public, | parameter | :: | p_level | = | 42 | |
integer, | public, | parameter | :: | pp_level | = | 31 | |
integer, | public, | parameter | :: | ppp_level | = | 20 | |
integer, | public, | parameter | :: | pppp_level | = | 8 | |
integer, | public, | parameter | :: | quarter_note | = | 96 |
The timing resolution of a MIDI file is defined by the number of MIDI ticks in a quarter note: the value 96 is commonly used because it can be divided by 2 and 3. We also define the most useful other values. https://en.wikipedia.org/wiki/Note_value |
integer, | public, | parameter | :: | sixteenth_note | = | quarter_note/4 | |
integer, | public, | parameter | :: | thirty_second_note | = | quarter_note/8 | |
integer, | public, | parameter | :: | whole_note | = | 4*quarter_note |
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | note |
Returns the value of a dotted note.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | value |
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | MIDI_note |