| | |
- omde.converter.Converter(omde.functional.Generator)
-
- PchOct
- PitchConverter
-
- FreePitchConverter
- GenericPitchConverter
-
- Ptolemy
- Pythagorean
- TET12
- omde.functional.Generator
-
- PitchGenerator
- Pitch
- Scale
- _convert
-
- _pch_convert
-
- Cpsmidi
- PchClass
- _pch_convert2
-
- cpsnote
- midinote
- pchnote
- cpsoct
- cpspch
- midicps
- octcps
- octmidi
- octpch
- pchmidi
class Cpsmidi(_pch_convert) |
| |
Cpsmidi( [input, reference] )
converts from midi to cps: 69 => 440. If you
are using the slower converter (by setting
reference), so float >midi< values are permitted. |
| |
- __call__(self, a=None)
- __init__(self, input=0, reference=0)
- __len__(self) from _convert
- _li(self, a) from _convert
- _t_(self, a) from _convert
- _ti_(self, a) from _convert
- display(self, n=None) from _convert
- getList(self, n=None) from _convert
|
class FreePitchConverter(PitchConverter) |
| |
|
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self) from omde.functional.Generator
- __div__(self, object) from omde.functional.Generator
- __init__(self, input=None, pseudoctaveratio=2.0, nsteps=25, origin_frequency=0)
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
- _call1(self, object) from omde.converter.Converter
- _call2(self, *args) from omde.converter.Converter
- _normalize(self, modulo, pitch) from PitchConverter
- convert(self, value) from PitchConverter
- pitch2freq(self, pitch)
|
class GenericPitchConverter(PitchConverter) |
| |
|
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self) from omde.functional.Generator
- __div__(self, object) from omde.functional.Generator
- __init__(self, central_A_freq=32.851846551950104, klass=0, name=None, ratios=None, input=None)
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
- _call1(self, object) from omde.converter.Converter
- _call2(self, *args) from omde.converter.Converter
- _normalize(self, modulo, pitch) from PitchConverter
- convert(self, value) from PitchConverter
- pitch2freq(self, pitch)
|
class PchClass(_pch_convert) |
| |
Converts pitch Class values to pch (à la Csound).
Integers represent pitch Classes, whenever
a float value is given, so the fractional
parts represent the pitch Class and the integer part
represents the octave.
The last given octave resets the attribute octpc.
The initial octave may be given as octpc keyword
(as number, not as string!).
Example:
FIXME: Is this example useful and correct??
I'm not sure what the original intent was.
>>> input = List(7,4,15,18,13,5,2,-1,10,12,9,20)
>>> pc = PchClass(input)
>>> for i in range(len(pc.input.list)):
... print pc(),
...
8.07 8.04 9.03 9.06 9.01 8.05 8.02 7.11 8.1 9.0 8.09 9.08 |
| |
- __call__(self, a=None)
- __init__(self, input=0, octpc=8)
- __len__(self) from _convert
- _li(self, a) from _convert
- _t_(self, a) from _convert
- _ti_(self, a) from _convert
- display(self, n=None) from _convert
- getList(self, n=None) from _convert
|
class PchOct(omde.converter.Converter) |
| |
PchOct(input, reference)
converts from octave point decimal to pch
in Csound-usage: 8.75 => 8.09 |
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self) from omde.functional.Generator
- __div__(self, object) from omde.functional.Generator
- __init__(self, input=None, reference=None)
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
- _call1(self, object) from omde.converter.Converter
- _call2(self, *args) from omde.converter.Converter
- convert(self, value)
|
class Pitch |
| |
This class represents a pitch as a pair:
pitch class and octave.
Note that pitch class is spelled 'klass' in
OMDE/pmask because 'class' is a Python keyword.
Usually a PitchConverter performs a normalization step before
converting a Pitch object to a frequency value: the pitch class
number is wrapped at octave boundaries in order to get the real
pitch class and octave number. So a pitch class of 13 will become
a pitch class of 1, and increase the octave by 1.
Pitch class values start with 0.
Note also that octave doesn't always mean a 2:1 ratio.
>>>
>>> |
| |
- __init__(self, klass, octave=0)
- freq(self, converter)
|
class PitchConverter(omde.converter.Converter) |
| |
Base class for all Pitch to frequency converters.
This is a Generator. |
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self) from omde.functional.Generator
- __div__(self, object) from omde.functional.Generator
- __init__(self, input=None)
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
- _call1(self, object) from omde.converter.Converter
- _call2(self, *args) from omde.converter.Converter
- _normalize(self, modulo, pitch)
- convert(self, value)
- pitch2freq(self, pitch)
|
class PitchGenerator(omde.functional.Generator) |
| |
|
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self)
- __div__(self, object) from omde.functional.Generator
- __init__(self, klass, octave=None)
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
|
class Ptolemy(GenericPitchConverter) |
| |
>>> for i in range(13): print "%.2f" % ptolemy(i),
...
4.11 4.38 4.62 4.93 5.13 5.48 5.77 6.16 6.57 6.84 7.39 7.70 8.21 |
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self) from omde.functional.Generator
- __div__(self, object) from omde.functional.Generator
- __init__(self, central_A_freq=32.851846551950104, klass=0, name=None, ratios=None, input=None) from GenericPitchConverter
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
- _call1(self, object) from omde.converter.Converter
- _call2(self, *args) from omde.converter.Converter
- _normalize(self, modulo, pitch) from PitchConverter
- convert(self, value) from PitchConverter
- pitch2freq(self, pitch) from GenericPitchConverter
|
class Pythagorean(GenericPitchConverter) |
| |
>>> for i in range(13): print "%.2f" % pythagorean(i),
...
4.11 4.16 4.62 4.87 5.20 5.48 5.85 6.16 6.49 6.93 7.30 7.80 8.21 |
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self) from omde.functional.Generator
- __div__(self, object) from omde.functional.Generator
- __init__(self, central_A_freq=32.851846551950104, klass=0, name=None, ratios=None, input=None) from GenericPitchConverter
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
- _call1(self, object) from omde.converter.Converter
- _call2(self, *args) from omde.converter.Converter
- _normalize(self, modulo, pitch) from PitchConverter
- convert(self, value) from PitchConverter
- pitch2freq(self, pitch) from GenericPitchConverter
|
class Scale |
| |
Represent a scale from the SCALA database.
This object has 3 attributes:
name: a short name derived from the name of
the file in the original SCALA archive by
stripping pathname and extension.
info: a description of the scale as contained
in the original SCALA .scm file.
ratios: a list of the intervals contained in
this scale as ratios. |
| |
- __init__(self, name, info, ratios)
|
class TET12(PitchConverter) |
| |
A PitchConverter which converts from
pitch Class to frequency. The pitch Class 0 is taken to mean C
four octaves below the central A frequency.
By default, the central A frequency is 442 Hz.
So middle C can be found like so:
>>> print '%.4f' % TET12(0 + 12 * 4)()
525.6295
>>> for c in range(13):
... print "%.2f" % tet12(Pitch(c, 3)),
262.81 278.44 295.00 312.54 331.13 350.82 371.68 393.78 417.19 442.00 468.28 496.13 525.63
>>> for i in range(13): print "%.2f" % tet12(i),
...
32.85 34.81 36.87 39.07 41.39 43.85 46.46 49.22 52.15 55.25 58.54 62.02 65.70
>>> print tet12(9)
55.25 |
| |
- __add__(self, object) from omde.functional.Generator
- __call__(self) from omde.functional.Generator
- __div__(self, object) from omde.functional.Generator
- __init__(self, input=None, central_A_freq=442.0)
- __mul__(self, object) from omde.functional.Generator
- __radd__(self, object) from omde.functional.Generator
- __rdiv__(self, object) from omde.functional.Generator
- __rmul__(self, object) from omde.functional.Generator
- __rsub__(self, object) from omde.functional.Generator
- __sub__(self, object) from omde.functional.Generator
- _call1(self, object) from omde.converter.Converter
- _call2(self, *args) from omde.converter.Converter
- _normalize(self, modulo, pitch) from PitchConverter
- convert(self, value) from PitchConverter
- pitch2freq(self, pitch)
- steps2ratio(self, n)
|
class cpsnote(_pch_convert2) |
| |
cpsnote( [input, reference, octRef] )
converts strings with 'notename' to cps:
'8a' => 440 Hz
'8ab' is 'a-flat'
'8abb' is 'a-double-flat'
'8h' is 'b' - german notation
'8as' is 'a-sharp'
'8ass' is 'a-double-sharp'
the last given octave resets attribute 'octRef',
so: '7c','7g','8e' is the same as: '7c','g','8e',
or 'c','g','8e' if you set 'octRef' to '7'
(as a string!). |
| |
- __call__(self, a=None)
- __init__(self, input=0, reference=0, octRef='8')
- __len__(self) from _convert
- _li(self, a) from _convert
- _t_(self, a) from _convert
- _ti_(self, a) from _convert
- _tn_(self, a) from _pch_convert2
- display(self, n=None) from _convert
- getList(self, n=None) from _convert
|
class midinote(_pch_convert2) |
| |
midinote( [input , reference, octRef] )
converts a string with "notename" to midi:
"8a" => 69 |
| |
- __call__(self, a=None)
- __init__(self, input=0, reference=0, octRef='8')
- __len__(self) from _convert
- _li(self, a) from _convert
- _t_(self, a) from _convert
- _ti_(self, a) from _convert
- _tn_(self, a) from _pch_convert2
- display(self, n=None) from _convert
- getList(self, n=None) from _convert
|
class octmidi(_pch_convert) |
| |
octmidi( [input, reference] )
converts from midi to octave point decimal:
69 => 8.75, with 'reference' setting also in
float >midi<. |
| |
- __call__(self, a=None)
- __init__(self, input=0, reference=0)
- __len__(self) from _convert
- _li(self, a) from _convert
- _t_(self, a) from _convert
- _ti_(self, a) from _convert
- display(self, n=None) from _convert
- getList(self, n=None) from _convert
|
class pchmidi(_pch_convert) |
| |
pchmidi( [input, reference] )
converts from pch (in Csound usage) to midi:
8.09 => 69, with "reference" also in floats. |
| |
- __call__(self, a=None)
- __init__(self, input=0, reference=0)
- __len__(self) from _convert
- _li(self, a) from _convert
- _t_(self, a) from _convert
- _ti_(self, a) from _convert
- display(self, n=None) from _convert
- getList(self, n=None) from _convert
|
class pchnote(_pch_convert2) |
| |
pchnote( [input , reference, octRef] )
converts a string with "notename" to pch in
Csound-usage: "8a" => 8.09 |
| |
- __call__(self, a=None)
- __init__(self, input=0, reference=0, octRef='8')
- __len__(self) from _convert
- _li(self, a) from _convert
- _t_(self, a) from _convert
- _ti_(self, a) from _convert
- _tn_(self, a) from _pch_convert2
- display(self, n=None) from _convert
- getList(self, n=None) from _convert
| |