Package midi :: Module constants
[hide private]
[frames] | no frames]

Module constants

source code

Constants relating to MIDI data.

These constants are used by MIDI data operations.

I'm not convinced all of these are useful. It might be nice to tidy them up a bit and make it clear what they're all for.

Variables [hide private]
  OCTAVE_MAX_VALUE = 12
  OCTAVE_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  NOTE_NAMES = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#',...
A set of names for each note in the 12-tet octave.
  WHITE_KEYS = [0, 2, 4, 5, 7, 9, 11]
Indices in the octave of the white notes on a piano keyboard.
  BLACK_KEYS = [1, 3, 6, 8, 10]
Indices in the octave of the black notes on a piano keyboard.
  NOTE_PER_OCTAVE = 12
  NOTE_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1...
  NOTE_NAME_MAP_FLAT = {'A-0': 9, 'A-1': 21, 'A-2': 33, 'A-3': 4...
  NOTE_VALUE_MAP_FLAT = ['C-0', 'Db-0', 'D-0', 'Eb-0', 'E-0', 'F...
  NOTE_NAME_MAP_SHARP = {'A#-0': 10, 'A#-1': 22, 'A#-2': 34, 'A#...
  NOTE_VALUE_MAP_SHARP = ['C-0', 'C#-0', 'D-0', 'D#-0', 'E-0', '...
  BEATNAMES = ['whole', 'half', 'quarter', 'eighth', 'sixteenth'...
  BEATVALUES = [4, 2, 1, 0.5, 0.25, 0.125, 0.0625]
  WHOLE = 0
  HALF = 1
  QUARTER = 2
  EIGHTH = 3
  SIXTEENTH = 4
  THIRTYSECOND = 5
  SIXTYFOURTH = 6
  DEFAULT_MIDI_HEADER_SIZE = 14
  CONTROL_MESSAGE_DICTIONARY = {0: 'Bank Select, MSB', 1: 'Modul...
  A_0 = 9
  A_1 = 21
  A_2 = 33
  A_3 = 45
  A_4 = 57
  A_5 = 69
  A_6 = 81
  A_7 = 93
  A_8 = 105
  A_9 = 117
  Ab_0 = 8
  Ab_1 = 20
  Ab_2 = 32
  Ab_3 = 44
  Ab_4 = 56
  Ab_5 = 68
  Ab_6 = 80
  Ab_7 = 92
  Ab_8 = 104
  Ab_9 = 116
  As_0 = 10
  As_1 = 22
  As_2 = 34
  As_3 = 46
  As_4 = 58
  As_5 = 70
  As_6 = 82
  As_7 = 94
  As_8 = 106
  As_9 = 118
  B_0 = 11
  B_1 = 23
  B_2 = 35
  B_3 = 47
  B_4 = 59
  B_5 = 71
  B_6 = 83
  B_7 = 95
  B_8 = 107
  B_9 = 119
  Bb_0 = 10
  Bb_1 = 22
  Bb_2 = 34
  Bb_3 = 46
  Bb_4 = 58
  Bb_5 = 70
  Bb_6 = 82
  Bb_7 = 94
  Bb_8 = 106
  Bb_9 = 118
  C_0 = 0
  C_1 = 12
  C_10 = 120
  C_2 = 24
  C_3 = 36
  C_4 = 48
  C_5 = 60
  C_6 = 72
  C_7 = 84
  C_8 = 96
  C_9 = 108
  Cs_0 = 1
  Cs_1 = 13
  Cs_10 = 121
  Cs_2 = 25
  Cs_3 = 37
  Cs_4 = 49
  Cs_5 = 61
  Cs_6 = 73
  Cs_7 = 85
  Cs_8 = 97
  Cs_9 = 109
  D_0 = 2
  D_1 = 14
  D_10 = 122
  D_2 = 26
  D_3 = 38
  D_4 = 50
  D_5 = 62
  D_6 = 74
  D_7 = 86
  D_8 = 98
  D_9 = 110
  Db_0 = 1
  Db_1 = 13
  Db_10 = 121
  Db_2 = 25
  Db_3 = 37
  Db_4 = 49
  Db_5 = 61
  Db_6 = 73
  Db_7 = 85
  Db_8 = 97
  Db_9 = 109
  Ds_0 = 3
  Ds_1 = 15
  Ds_10 = 123
  Ds_2 = 27
  Ds_3 = 39
  Ds_4 = 51
  Ds_5 = 63
  Ds_6 = 75
  Ds_7 = 87
  Ds_8 = 99
  Ds_9 = 111
  E_0 = 4
  E_1 = 16
  E_10 = 124
  E_2 = 28
  E_3 = 40
  E_4 = 52
  E_5 = 64
  E_6 = 76
  E_7 = 88
  E_8 = 100
  E_9 = 112
  Eb_0 = 3
  Eb_1 = 15
  Eb_10 = 123
  Eb_2 = 27
  Eb_3 = 39
  Eb_4 = 51
  Eb_5 = 63
  Eb_6 = 75
  Eb_7 = 87
  Eb_8 = 99
  Eb_9 = 111
  F_0 = 5
  F_1 = 17
  F_10 = 125
  F_2 = 29
  F_3 = 41
  F_4 = 53
  F_5 = 65
  F_6 = 77
  F_7 = 89
  F_8 = 101
  F_9 = 113
  Fs_0 = 6
  Fs_1 = 18
  Fs_10 = 126
  Fs_2 = 30
  Fs_3 = 42
  Fs_4 = 54
  Fs_5 = 66
  Fs_6 = 78
  Fs_7 = 90
  Fs_8 = 102
  Fs_9 = 114
  G_0 = 7
  G_1 = 19
  G_10 = 127
  G_2 = 31
  G_3 = 43
  G_4 = 55
  G_5 = 67
  G_6 = 79
  G_7 = 91
  G_8 = 103
  G_9 = 115
  Gb_0 = 6
  Gb_1 = 18
  Gb_10 = 126
  Gb_2 = 30
  Gb_3 = 42
  Gb_4 = 54
  Gb_5 = 66
  Gb_6 = 78
  Gb_7 = 90
  Gb_8 = 102
  Gb_9 = 114
  Gs_0 = 8
  Gs_1 = 20
  Gs_2 = 32
  Gs_3 = 44
  Gs_4 = 56
  Gs_5 = 68
  Gs_6 = 80
  Gs_7 = 92
  Gs_8 = 104
  Gs_9 = 116
  __package__ = None
hash(x)
  flat = 'Gb'
  name = 'G'
  noteidx = 7
  octidx = 10
  value = 127
Variables Details [hide private]

NOTE_NAMES

A set of names for each note in the 12-tet octave.

Value:
['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']

NOTE_VALUES

Value:
[0,
 1,
 2,
 3,
 4,
 5,
 6,
 7,
...

NOTE_NAME_MAP_FLAT

Value:
{'A-0': 9,
 'A-1': 21,
 'A-2': 33,
 'A-3': 45,
 'A-4': 57,
 'A-5': 69,
 'A-6': 81,
 'A-7': 93,
...

NOTE_VALUE_MAP_FLAT

Value:
['C-0',
 'Db-0',
 'D-0',
 'Eb-0',
 'E-0',
 'F-0',
 'Gb-0',
 'G-0',
...

NOTE_NAME_MAP_SHARP

Value:
{'A#-0': 10,
 'A#-1': 22,
 'A#-2': 34,
 'A#-3': 46,
 'A#-4': 58,
 'A#-5': 70,
 'A#-6': 82,
 'A#-7': 94,
...

NOTE_VALUE_MAP_SHARP

Value:
['C-0',
 'C#-0',
 'D-0',
 'D#-0',
 'E-0',
 'F-0',
 'F#-0',
 'G-0',
...

BEATNAMES

Value:
['whole',
 'half',
 'quarter',
 'eighth',
 'sixteenth',
 'thiry-second',
 'sixty-fourth']

CONTROL_MESSAGE_DICTIONARY

Value:
{0: 'Bank Select, MSB',
 1: 'Modulation Wheel',
 2: 'Breath Controller',
 4: 'Foot Controller',
 5: 'Portamento Time',
 6: 'Data Entry',
 7: 'Channel Volume',
 8: 'Balance',
...