Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
This is your starting point in the ForMIDI world.
Close Encounters of the Third Kind: https://www.youtube.com/watch?v=S4PYI6TzqYk
You will generally use the format SMF 1 which allows several tracks
to be played together.
We will use only one musical track but we need 2 tracks, as there is
always a metadata track automatically created by the new() method.
Divisions is the number of ticks ("metrical timing" MIDI scheme) in
a quarter note, and can be considered as the time resolution of your file.
The MIDI velocity is the speed at which you type on the keyboard and
can be considered equivalent to the volume. As many MIDI values, it is
defined in the 0..127 range.
There are 16 channels (0..15).
The value (duration) of a note is expressed in MIDI ticks.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
program third_kind! The main class you need to create music:use MIDI_file_class! The function MIDI_Note() returns the MIDI number of a note from 12 (C0)! to 127 (G9). The A4 (440 Hz tuning standard) is the note 69.use music! Contains the list of General MIDI 128 instruments and 47 percussions:use GM_instrumentsimplicit none type(MIDI_file)::midi!> You will generally use the format SMF 1 which allows several tracks!> to be played together.!> We will use only one musical track but we need 2 tracks, as there is!> always a metadata track automatically created by the new() method.!> Divisions is the number of ticks ("metrical timing" MIDI scheme) in!> a quarter note, and can be considered as the time resolution of your file.! We define the tempo: a quarter note will last 500000 µs = 0.5 s => tempo=120 bpmcall midi%new("third_kind.mid",format=1,tracks=2,divisions=quarter_note,tempo=500000,&&text_event="This file was created with the ForMIDI Fortran project")! (1) The single musical track:call midi%track_header()! Choosing the instrument (in the 0..127 range):call midi%Program_Change(channel=0,instrument=Pad_6_metallic)! Playing a sequence of five notes on MIDI channel 0:call midi%play_note(channel=0,note=MIDI_Note("G4"),velocity=mf_level,value=quarter_note)call midi%play_note(channel=0,note=MIDI_Note("A4"),velocity=mf_level,value=quarter_note)call midi%play_note(channel=0,note=MIDI_Note("F4"),velocity=mf_level,value=quarter_note)call midi%play_note(channel=0,note=MIDI_Note("F3"),velocity=mf_level,value=quarter_note)call midi%play_note(channel=0,note=MIDI_Note("C4"),velocity=mf_level,value=half_note)!> The MIDI velocity is the speed at which you type on the keyboard and!> can be considered equivalent to the volume. As many MIDI values, it is!> defined in the 0..127 range.!> There are 16 channels (0..15).!> The value (duration) of a note is expressed in MIDI ticks.call midi%end_of_track()call midi%close()print*,"You can now play the file ",midi%get_name()end program third_kind