Contains music theory elements: scales, circle of fifths, chords, etc.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public, | parameter | :: | PITCH | = | 440.0_wp |
Concert pitch (A note): |
real(kind=wp), | public, | parameter | :: | SEMITONE | = | 2.0_wp**(1.0_wp/12.0_wp) |
Equal temperament: https://en.wikipedia.org/wiki/Equal_temperament |
Returns the frequency of the note. 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 |
Writes a broken chord using an array containing the intervals (see the music_common module). It uses plucked strings (Karplus-Strong). For the moment, each note has the same duration. https://en.wikipedia.org/wiki/Arpeggio
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tape_recorder), | intent(inout) | :: | tape | |||
integer, | intent(in) | :: | track | |||
real(kind=wp), | intent(in) | :: | t1 | |||
real(kind=wp), | intent(in) | :: | t2 | |||
real(kind=wp), | intent(in) | :: | f | |||
real(kind=wp), | intent(in) | :: | Amp | |||
integer, | intent(in), | dimension(:) | :: | chord |
Writes a chord using an array containing the intervals (see the music_common module)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tape_recorder), | intent(inout) | :: | tape | |||
integer, | intent(in) | :: | track | |||
real(kind=wp), | intent(in) | :: | t1 | |||
real(kind=wp), | intent(in) | :: | t2 | |||
real(kind=wp), | intent(in) | :: | f | |||
real(kind=wp), | intent(in) | :: | Amp | |||
integer, | intent(in), | dimension(:) | :: | chord | ||
type(ADSR_envelope), | intent(inout), | optional | :: | envelope |
A note of fundamental frequency f with harmonics, based on sine waves. https://en.wikipedia.org/wiki/Harmonic
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tape_recorder), | intent(inout) | :: | tape | |||
integer, | intent(in) | :: | track | |||
real(kind=wp), | intent(in) | :: | t1 | |||
real(kind=wp), | intent(in) | :: | t2 | |||
real(kind=wp), | intent(in) | :: | f | |||
real(kind=wp), | intent(in) | :: | Amp | |||
type(ADSR_envelope), | intent(inout), | optional | :: | envelope |