SOUND ch, inst, note[, len[, vel]]
PARAMETERS
ch
sound channel [0 to 2] 3 midi channels
inst midi insruments 0 to 127 see below INsruments
instrument number
General Midi (GM)" standard defines a list of 128 instruments that simplifies compatibility 0 to 127
note
See below Note=Pitch
The pitch value determines the frequency of the note to be played. It goes from 0 to 127, with the middle C note being represented by the value of 60:
len
note duration, milliseconds [default: 1000]
Duration is the time the note is held. The smallest unit of time is the tick, which is equal to 100 nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond. Duration Beats per minute See Below Len = Duration
note velocity [0 to 1 (default)] vel 0 = off 1 = on
VEL = VELOCITY
The velocity value normally goes from .0 to .99 covering the range from a practically inaudible note up to the maximum note level. It basically corresponds to the scale of nuances found in music notation, as follows (it is more indicative than exact value
Converted from Midi velocity chart
multipiled by O,00787
Midi Basic Engine
pppp=8 .06
ppp=20 .16
pp=31 .24
p=42 .33
mp=53 .42
mf=64 .50
f=80 .63
ff=96 .76
fff=112 .88
ffff=127 .99
In basic synthesizers, the velocity value is used only to determine the force with which the note is played, the only effect being a note that is louder or softer in volume.
In more sophisticated synthesizer, this value will also affect the sound quality. Indeed, on a real piano, hitting a note harder will not only affect its loudness but also the quality of the sound itself, the timber. This is practically the case with any real instrument.
NOTES = PITCH
pitch---The pitch value determines the frequency of the note to be played. It goes from 0 to 127, with the middle C note being represented by the value of 60:
Octave Number
Notes
C C# D D# E F F# G G# A A# B
0 0 1 2 3 4 5 6 7 8 9 10 11
1 12 13 14 15 16 17 18 19 20 21 22 23
2 24 25 26 27 28 29 30 31 32 33 34 35
3 36 37 38 39 40 41 42 43 44 45 46 47
4 48 49 50 51 52 53 54 55 56 57 58 59
5 60 61 62 63 64 65 66 67 68 69 70 7
6 72 73 74 75 76 77 78 79 80 81 82 83
7 84 85 86 87 88 89 90 91 92 93 94 95
8 96 97 98 99 100 101 102 103 104 105 106 107
9 108 109 110 111 112 113 114 115 116 117 118 119
10 120 121 122 123 124 125 126 127
The value is represented in half steps, so that C# will be 61, D will be 62,...
To transpose a note one octave higher, add 12 to its pitch value. By using MIDI, transposition is very simple as it is done simply by adding or subtracting a fixed value.
Be cautious however about the range of MIDI notes that goes from 0 to 127. By adding for instance 4 octaves (+48) to a note of value 96, the total is 144, which is outside the range and may be truncated to 16 (144 - 128) so that a very low note will result.
Converting from the AY-3-8910 Programmable Sound Generator (PSG)
Note Period Note Period
C 3421 F# 2419
C# 3228 G 2283
D 3047 G# 2155
D# 2876 A 2034
E 2715 A# 1920
F 2562 B 1892
The lower the period, the higher the note. In order to get a higher octave, just divide the period by two.
midi instruments
1-8 Piano
9-16 Chromatic Percussion
17-24 Organ
25-32 Guitar
33-40 Bass
41-48 Strings
49-56 Ensemble
57-64 Brass
65-72 Reed
73-80 Pipe
81-88 Synth Lead
89-96 Synth Pad
97-104 Synth Effects
105-112 Ethnic
113-120 Percussive
121-128 Sound Effects
INS = Insruments
General MIDI Level 1 Instrument Patch Map
Note: While GM1 does not define the actual characteristics of any sounds, the names in parentheses after each of the synth leads, pads, and sound effects are, in particular, intended only as guides).
PC# Instrument Name
- Acoustic Grand Piano
- Bright Acoustic Piano
- Electric Grand Piano
- Honky-tonk Piano
- Electric Piano 1
- Electric Piano 2
- Harpsichord
- Clavi
- Celesta
- Glockenspiel
- Music Box
- Vibraphone
- Marimba
- Xylophone
- Tubular Bells
- Dulcimer
- Drawbar Organ
- Percussive Organ
- Rock Organ
- Church Organ
- Reed Organ
- Accordion
- Harmonica
- Tango Accordion
- Acoustic Guitar (nylon)
- Acoustic Guitar (steel)
- Electric Guitar (jazz)
- Electric Guitar (clean)
- Electric Guitar (muted)
- Overdriven Guitar
- Distortion Guitar
- Guitar harmonics
- Acoustic Bass
- Electric Bass (finger)
- Electric Bass (pick)
- Fretless Bass
- Slap Bass 1
- Slap Bass 2
- Synth Bass 1
- Synth Bass 2
- Violin
- Viola
- Cello
- Contrabass
- Tremolo Strings
- Pizzicato Strings
- Orchestral Harp
- Timpani
- String Ensemble 1
- String Ensemble 2
- SynthStrings 1
- SynthStrings 2
- Choir Aahs
- Voice Oohs
- Synth Voice
- Orchestra Hit
- Trumpet
- Trombone
- Tuba
- Muted Trumpet
- French Horn
- Brass Section
- SynthBrass 1
- SynthBrass 2
- Soprano Sax
- Alto Sax
- Tenor Sax
- Baritone Sax
- Oboe
- English Horn
- Bassoon
- Clarinet
- Piccolo
- Flute
- Recorder
- Pan Flute
- Blown Bottle
- Shakuhachi
- Whistle
- Ocarina
- Lead 1 (square)
- Lead 2 (sawtooth)
- Lead 3 (calliope)
- Lead 4 (chiff)
- Lead 5 (charang)
- Lead 6 (voice)
- Lead 7 (fifths)
- Lead 8 (bass + lead)
- Pad 1 (new age)
- Pad 2 (warm)
- Pad 3 (polysynth)
- Pad 4 (choir)
- Pad 5 (bowed)
- Pad 6 (metallic)
- Pad 7 (halo)
- Pad 8 (sweep)
- FX 1 (rain)
- FX 2 (soundtrack)
- FX 3 (crystal)
- FX 4 (atmosphere)
- FX 5 (brightness)
- FX 6 (goblins)
- FX 7 (echoes)
- FX 8 (sci-fi)
- Sitar
- Banjo
- Shamisen
- Koto
- Kalimba
- Bag pipe
- Fiddle
- Shanai
- Tinkle Bell
- Agogo
- Steel Drums
- Woodblock
- Taiko Drum
- Melodic Tom
- Synth Drum
- Reverse Cymbal
- Guitar Fret Noise
- Breath Noise
- Seashore
- Bird Tweet
- Telephone Ring
- Helicopter
- Applause
- Gunshot
LEN = DURATION
Duration calculator https://www.homestudiosimplified.com/p/reverbdelay-calculator.html
Understanding BPM to ms
To convert from BPM to ms we first need to determine how many ms are in a minute.
1 minute = 60 seconds = 60,000 milliseconds
Divide 60,000 by the BPM to get the duration of a single beat – a quarter note. If our BPM is 100 we can write:
Quarter note duration = 60,000 / 100 = 600 ms.
From here we can multiply or divide to find the duration of other notes. For example, a half note is twice the duration of a quarter note.
Half note duration = 600 ms x 2 = 1,200 ms
A sixteenth note is half as long as an eighth note, which is half as long as a quarter note.
Eighth note duration = 600 ms / 2 = 300 ms
Sixteenth note duration = 300 ms / 2 = 150 ms
You could also divide the duration of a quarter note by 4 to achieve the same result.
Sixteenth note duration = 600 ms / 4 = 150 ms
Calculating dotted notes and triplets works in the exact same way, except we multiply the answers by 1.5 for a dotted note and 0.6667 for a triplet.
Dotted quarter note duration = 600 ms x 1.5 = 900 ms
Duration of one third of a quarter note triplet = 600 ms x 0.6667 = 400 ms