mutwo.parameters.pitches_constants

This module adds several constants that are used for the different pitch classes.

There are basically two types of constants:

  1. Default values for initialisation method argument of the different pitch classes.

  2. Values that are defined by general (cultural, physical, technical) standards

Data:

ACCIDENTAL_NAME_TO_PITCH_CLASS_MODIFICATION

Mapping of accidental name to pitch class modification for the WesternPitch class.

ASCENDING_DIATONIC_PITCH_NAMES

Tuple with diatonic pitch names in ascending order.

CENT_CALCULATION_CONSTANT

constant used for cent calculation in mutwo.parameters.abc.Pitch

DEFAULT_CONCERT_PITCH

The default concert pitch in frequency.

DEFAULT_CONCERT_PITCH_OCTAVE_FOR_WESTERN_PITCH

The default value of concert_pitch_octave_for_western_pitch for the WesternPitch class.

DEFAULT_CONCERT_PITCH_PITCH_CLASS_FOR_WESTERN_PITCH

The default value of``concert_pitch_concert_pitch_class_for_western_pitch`` for the WesternPitch class.

DEFAULT_PRIME_TO_COMMA

Standard commas defined by the Helmholtz-Ellis JI Pitch Notation.

DIATONIC_PITCH_NAME_CYCLE_OF_FIFTHS

Diatonic pitch names sorted by cycle of fifths.

DIATONIC_PITCH_NAME_TO_PITCH_CLASS

Mapping of diatonic pitch name to pitch class for the WesternPitch class.

MIDI_PITCH_FREQUENCIES

A tuple that contains the frequency of each midi pitch (from 1 to 127).

MIDI_PITCH_NUMBERS

A tuple that contains all available midi pitch numbers.

PITCH_CLASS_MODIFICATION_TO_ACCIDENTAL_NAME

Mapping of pitch class modifications name accidental name for the WesternPitch class.

ACCIDENTAL_NAME_TO_PITCH_CLASS_MODIFICATION = {'': Fraction(0, 1), 'ef': Fraction(-1, 4), 'es': Fraction(1, 4), 'etf': Fraction(-11, 6), 'ets': Fraction(11, 6), 'f': Fraction(-1, 1), 'ff': Fraction(-2, 1), 'ftf': Fraction(-5, 6), 'fts': Fraction(5, 6), 'nef': Fraction(-9, 4), 'nes': Fraction(9, 4), 'qf': Fraction(-1, 2), 'qs': Fraction(1, 2), 'rf': Fraction(-2, 3), 'rs': Fraction(2, 3), 's': Fraction(1, 1), 'sef': Fraction(-7, 4), 'ses': Fraction(7, 4), 'ss': Fraction(2, 1), 'stf': Fraction(-7, 6), 'sts': Fraction(7, 6), 'sxf': Fraction(-7, 3), 'sxs': Fraction(7, 3), 'tef': Fraction(-3, 4), 'tes': Fraction(3, 4), 'tf': Fraction(-1, 6), 'tqf': Fraction(-3, 2), 'tqs': Fraction(3, 2), 'trf': Fraction(-4, 3), 'trs': Fraction(4, 3), 'ts': Fraction(1, 6), 'xf': Fraction(-1, 3), 'xs': Fraction(1, 3)}

Mapping of accidental name to pitch class modification for the WesternPitch class. When adding new accidentals or changing accidental names only this constant has to be changed.

ASCENDING_DIATONIC_PITCH_NAMES = ('c', 'd', 'e', 'f', 'g', 'a', 'b')

Tuple with diatonic pitch names in ascending order.

CENT_CALCULATION_CONSTANT = 3986.313713864835

constant used for cent calculation in mutwo.parameters.abc.Pitch

DEFAULT_CONCERT_PITCH = 440

The default concert pitch in frequency.

DEFAULT_CONCERT_PITCH_OCTAVE_FOR_WESTERN_PITCH = 4

The default value of concert_pitch_octave_for_western_pitch for the WesternPitch class. It sets octave of default concert pitch for western pitch to one line (’) (so that the resulting concert pitch is a’ or in midi nomenclature a4)

DEFAULT_CONCERT_PITCH_PITCH_CLASS_FOR_WESTERN_PITCH = 9

The default value of``concert_pitch_concert_pitch_class_for_western_pitch`` for the WesternPitch class. It sets pitch class ‘a’ as the default pitch class for the concert pitch of the WesternPitch class.

DEFAULT_PRIME_TO_COMMA = {5: Comma(80/81), 7: Comma(63/64), 11: Comma(33/32), 13: Comma(26/27), 17: Comma(2176/2187), 19: Comma(513/512), 23: Comma(736/729), 29: Comma(261/256), 31: Comma(31/32), 37: Comma(37/36), 41: Comma(82/81), 43: Comma(129/128), 47: Comma(752/729)}

Standard commas defined by the Helmholtz-Ellis JI Pitch Notation.

DIATONIC_PITCH_NAME_CYCLE_OF_FIFTHS = ('f', 'c', 'g', 'd', 'a', 'e', 'b')

Diatonic pitch names sorted by cycle of fifths.

DIATONIC_PITCH_NAME_TO_PITCH_CLASS = {'a': 9, 'b': 11, 'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7}

Mapping of diatonic pitch name to pitch class for the WesternPitch class. Mutwo uses a chromatic scale where a change of the number 1 is one half tone.

MIDI_PITCH_FREQUENCIES = (8.175798915643705, 8.66195721802725, 9.177023997418985, 9.722718241315027, 10.300861153527185, 10.91338223228137, 11.562325709738575, 12.249857374429666, 12.978271799373287, 13.75, 14.567617547440312, 15.433853164253883, 16.35159783128741, 17.3239144360545, 18.35404799483797, 19.445436482630054, 20.60172230705437, 21.82676446456274, 23.12465141947715, 24.499714748859333, 25.956543598746574, 27.500000000000004, 29.135235094880624, 30.867706328507765, 32.70319566257482, 34.647828872109, 36.70809598967594, 38.89087296526011, 41.20344461410874, 43.65352892912548, 46.2493028389543, 48.999429497718666, 51.91308719749315, 55.00000000000001, 58.27047018976125, 61.73541265701553, 65.40639132514964, 69.295657744218, 73.41619197935188, 77.78174593052022, 82.40688922821748, 87.30705785825096, 92.4986056779086, 97.99885899543733, 103.8261743949863, 110.00000000000001, 116.5409403795225, 123.47082531403106, 130.81278265029928, 138.591315488436, 146.83238395870376, 155.56349186104043, 164.81377845643496, 174.6141157165019, 184.9972113558172, 195.99771799087466, 207.6523487899726, 220.00000000000003, 233.081880759045, 246.94165062806212, 261.62556530059857, 277.182630976872, 293.6647679174075, 311.12698372208087, 329.6275569128699, 349.2282314330038, 369.9944227116344, 391.9954359817493, 415.3046975799452, 440.00000000000006, 466.16376151809, 493.88330125612424, 523.2511306011971, 554.365261953744, 587.329535834815, 622.2539674441617, 659.2551138257398, 698.4564628660077, 739.9888454232688, 783.9908719634986, 830.6093951598904, 880.0000000000001, 932.32752303618, 987.7666025122485, 1046.5022612023943, 1108.730523907488, 1174.65907166963, 1244.5079348883235, 1318.5102276514797, 1396.9129257320153, 1479.9776908465376, 1567.9817439269973, 1661.2187903197807, 1760.0000000000002, 1864.65504607236, 1975.533205024497, 2093.0045224047885, 2217.461047814976, 2349.31814333926, 2489.015869776647, 2637.0204553029594, 2793.8258514640306, 2959.955381693075, 3135.9634878539946, 3322.4375806395615, 3520.0000000000005, 3729.31009214472, 3951.066410048994, 4186.009044809577, 4434.922095629952, 4698.63628667852, 4978.031739553294, 5274.040910605919, 5587.651702928061, 5919.91076338615, 6271.926975707989, 6644.875161279123, 7040.000000000001, 7458.62018428944, 7902.132820097988, 8372.018089619154, 8869.844191259905, 9397.27257335704, 9956.063479106588, 10548.081821211837, 11175.303405856122, 11839.8215267723)

A tuple that contains the frequency of each midi pitch (from 1 to 127).

MIDI_PITCH_NUMBERS = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126)

A tuple that contains all available midi pitch numbers.

PITCH_CLASS_MODIFICATION_TO_ACCIDENTAL_NAME = {Fraction(-7, 3): 'sxf', Fraction(-9, 4): 'nef', Fraction(-2, 1): 'ff', Fraction(-11, 6): 'etf', Fraction(-7, 4): 'sef', Fraction(-3, 2): 'tqf', Fraction(-4, 3): 'trf', Fraction(-7, 6): 'stf', Fraction(-1, 1): 'f', Fraction(-5, 6): 'ftf', Fraction(-3, 4): 'tef', Fraction(-2, 3): 'rf', Fraction(-1, 2): 'qf', Fraction(-1, 3): 'xf', Fraction(-1, 4): 'ef', Fraction(-1, 6): 'tf', Fraction(0, 1): '', Fraction(1, 6): 'ts', Fraction(1, 4): 'es', Fraction(1, 3): 'xs', Fraction(1, 2): 'qs', Fraction(2, 3): 'rs', Fraction(3, 4): 'tes', Fraction(5, 6): 'fts', Fraction(1, 1): 's', Fraction(7, 6): 'sts', Fraction(4, 3): 'trs', Fraction(3, 2): 'tqs', Fraction(7, 4): 'ses', Fraction(11, 6): 'ets', Fraction(2, 1): 'ss', Fraction(9, 4): 'nes', Fraction(7, 3): 'sxs'}

Mapping of pitch class modifications name accidental name for the WesternPitch class. This global variable is defined in reference to ACCIDENTAL_NAME_TO_PITCH_CLASS_MODIFICATION.