omde.csound
index
/usr/local/lib/python2.1/site-packages/omde/csound.py

Csound support for OMDE/pmask.

 
Modules
            
math
omde
os
re
sys
types

 
Classes
            
omde.score.Aggregate(omde.score.Event)
ScoreSection(omde.score.Aggregate, CsoundObject)
CsoundObject
CsoundEvent(omde.score.Event, CsoundObject)
I
IFactory
CsoundSpot(omde.score.Spot, CsoundObject)
F
BpfTable
ComplexHarmonicSpectrum
SharcTable
HarmonicSpectrum
Sinusoid
Sample
ScoreSection(omde.score.Aggregate, CsoundObject)
omde.score.Event(omde.score.Spot)
CsoundEvent(omde.score.Event, CsoundObject)
I
IFactory
File
Instrument
Orchestra
omde.score.Spot
CsoundSpot(omde.score.Spot, CsoundObject)
F
BpfTable
ComplexHarmonicSpectrum
SharcTable
HarmonicSpectrum
Sinusoid
Sample
Tempo

 
class BpfTable(F)
       
  
__init__(self, bp, onset=0, number=None, length=8192, interpolation='linear', action=None)
__str__(self) from CsoundSpot
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot

 
class ComplexHarmonicSpectrum(F)
       
  
__init__(self, amplitudes, phases, onset=0, number=None, length=8192, scale='amplitude', action=None)
__str__(self) from CsoundSpot
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot

 
class CsoundEvent(omde.score.Event, CsoundObject)
      Represent Csound score events as OMDE events
 
  
__init__(self, type, number, onset, duration, *args)
Return a CsoundEvent instance.
 
Syntax:
CsoundEvent(type, number, onset, duration, ...)
__str__(self)
Convert this object in standard numeric score notation.
 
>>> print ScoreEvent('i', 1, 0, 10, 9,8,7)
i 1 0 10 9 8 7
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
duration(self, duration=None) from omde.score.Event
end(self, end=None) from omde.score.Event
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot
stretch(self, alpha, mode='absolute', direction='forward') from omde.score.Event
stretch_absolute_backward(self, time) from omde.score.Event
stretch_absolute_forward(self, time) from omde.score.Event
stretch_relative_backward(self, alpha) from omde.score.Event
stretch_relative_forward(self, alpha) from omde.score.Event

 
class CsoundObject
      Base class for Csound score objects.
 
  

 
class CsoundSpot(omde.score.Spot, CsoundObject)
      Represent Csound score events as OMDE spots.
 
  
__init__(self, type, number, onset, *args)
Return a CsoundSpot instance.
 
Syntax:
CsoundSpot(type, number, onset, ...)
__str__(self)
Convert this object in standard numeric score notation.
 
>>> print ScoreEvent('f', 1, 0, 8192, 10, 1)
f 1 0 8192 10 1
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot

 
class F(CsoundSpot)
      CsoundSpot used for csound f statements.
 
  
__init__(self, number, onset, length, genNumber, *args)
Return a F instance.
 
If number is None, the table number is automatically
set to the lowest number not used by any other table.
 
Example:
>>> print F(1, 0, 512, 10, 1)
f 1 0 512 10 1
>>> print F(None, 0, 512, 11, 1)
f 2 0 512 11 1
>>> print F(None, 0, 512, 12, 1)
f 3 0 512 12 1
__str__(self) from CsoundSpot
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot

 
class File
       
  
__del__(self)
__init__(self, file_or_filename, section=None)
close(self)
print_score_event(self, event)
write(self, object)

 
class HarmonicSpectrum(F)
       
  
__init__(self, amplitudes, onset=0, number=None, length=8192, scale='amplitude', action=None)
__str__(self) from CsoundSpot
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot

 
class I(CsoundEvent)
      CsoundEvent representing Csound i statements.
 
  
__init__(self, number, onset, duration, *args)
Return a I instance.
 
Syntax:
I(number, onset, duration, ...)
 
Example:
>>> print I(11, 0.0, 3, 440, 32000)
i 11 0.0 3 440 32000
__str__(self) from CsoundEvent
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
duration(self, duration=None) from omde.score.Event
end(self, end=None) from omde.score.Event
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot
stretch(self, alpha, mode='absolute', direction='forward') from omde.score.Event
stretch_absolute_backward(self, time) from omde.score.Event
stretch_absolute_forward(self, time) from omde.score.Event
stretch_relative_backward(self, alpha) from omde.score.Event
stretch_relative_forward(self, alpha) from omde.score.Event

 
class IFactory(I)
     
 
This class is a factory of I events with a given
instrument number.
 
  
__call__(self, onset, duration, *args)
Return an I event.
__init__(self, number, npfields=None)
Return a IFactory instance.
 
Syntax:
IFactory(number [, npfields])
 
number
is the instrument number itself
 
npfields (optiona)
If present, the npfields value is the number of
pfield expected by this kind of i-events.
the factory will check that you pass exactly
such number of pfields. The pfields are counted
from the onset on.
__str__(self) from CsoundEvent
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
duration(self, duration=None) from omde.score.Event
end(self, end=None) from omde.score.Event
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot
stretch(self, alpha, mode='absolute', direction='forward') from omde.score.Event
stretch_absolute_backward(self, time) from omde.score.Event
stretch_absolute_forward(self, time) from omde.score.Event
stretch_relative_backward(self, alpha) from omde.score.Event
stretch_relative_forward(self, alpha) from omde.score.Event

 
class Instrument
       
  
__init__(self, name, weight, definition)

 
class Orchestra
       
  
__init__(self, sr=44100, ksmps=10, nchnls=2, name=None, author=None)
__str__(self)
add_path(self, *paths)
include_instrument(self, definition_filename, weight, name)
instr(self, name)
read_definition(self, filename0)
save(self, filename)

 
class Sample(F)
      Represent a sample (GEN1) table.
 
  
__init__(self, filename, onset=0, number=None, length=None, action=0, channels=1, offset=0, srate=44100)
Return a Sample instance.
 
filename is the sample file name.
 
onset if the table onset.
 
number is the table number. If number is None (default) a unused
table number is automatically picked.
 
length is the length of the table in samples. If length is None
(default), the minimum power-of-two length is computed.
 
If action is 'normalize' or 'norm' or 'n' the table is normalized.
 
channels is the number of channels (default is 1) to be used.
 
offset is a skip time in seconds (default is 0).
 
srate is the sampling rate (default is 44100).
__str__(self) from CsoundSpot
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot
play(self)
Play the sample using the omde.audio.play facility (see).

 
class ScoreSection(omde.score.Aggregate, CsoundObject)
       
  
__add__(self, object) from omde.score.Aggregate
__init__(self, *args)
__len__(self) from omde.score.Aggregate
_invalidate_cache(self) from omde.score.Aggregate
_is_cache_valid(self) from omde.score.Aggregate
_update_cache(self) from omde.score.Aggregate
add(self, *objects) from omde.score.Aggregate
append(self, *objects) from omde.score.Aggregate
apply(self, callable, *args) from omde.score.Aggregate
apply_for_real(self, callable, *args) from omde.score.Aggregate
calc_begin_duration(self) from omde.score.Aggregate
calc_begin_end(self) from omde.score.Aggregate
calc_onset_min_max(self) from omde.score.Aggregate
clone(self) from omde.score.Aggregate
disjoint(self) from omde.score.Aggregate
dump(self, file_or_filename) from omde.score.Aggregate
duration(self, duration=None) from omde.score.Aggregate
end(self, end=None) from omde.score.Aggregate
extend(self, aggregate) from omde.score.Aggregate
extract_event_if(self, predicate) from omde.score.Aggregate
flatten(self) from omde.score.Aggregate
load(self, file_or_filename) from omde.score.Aggregate
move(self, time, mode='absolute') from omde.score.Aggregate
move_absolute(self, time) from omde.score.Aggregate
move_relative(self, time) from omde.score.Aggregate
onset(self, onset=None) from omde.score.Aggregate
read(self, arg)
stretch(self, alpha, mode='absolute', direction='forward') from omde.score.Event
stretch_absolute_backward(self, time) from omde.score.Event
stretch_absolute_forward(self, time) from omde.score.Aggregate
stretch_relative_backward(self, alpha) from omde.score.Event
stretch_relative_forward(self, alpha) from omde.score.Aggregate
timewarp(self, time, mode='absolute') from omde.score.Aggregate
unwind(self) from omde.score.Aggregate

 
class SharcTable(ComplexHarmonicSpectrum)
       
  
__init__(self, name, pitch, onset=0, number=None, length=8192, scale='amplitude', action=None)
__str__(self) from CsoundSpot
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot

 
class Sinusoid(HarmonicSpectrum)
       
  
__init__(self, onset=0, number=None, length=8192)
__str__(self) from CsoundSpot
apply(self, callable, *args) from omde.score.Spot
apply_for_real(self, callable, *args) from omde.score.Spot
move(self, time, mode='absolute') from omde.score.Spot
move_absolute(self, onset) from omde.score.Spot
move_relative(self, time) from omde.score.Spot
onset(self, onset=None) from omde.score.Spot

 
class Tempo
       
  
__call__(self, beat)
__init__(self, *pairs)

 
Functions
            
get_SSDIR_from_environment()
Attempt to retrieve SSDIR environment variable.
 
Return a (Python) list of paths.
pfield_is(pfield, value)
Predicate factory.
 
The returned predicate check if the given pfield
has the specified value.
 
Return the predicate as callable.
read_score(filename_or_file)
read_score(filename) or read_score(file)
 
where filename a file name (a string) and file is a file object, already open
in read mode.
 
This function reads a Csound score from the specified file and
returns an Aggregate object.
save(filename, object)
save(filename, object)
 
Open a file, save the object in csound numeric score notation,
then close the file.

 
Data
             __file__ = '/usr/local/lib/python2.1/site-packages/omde/csound.pyc'
__name__ = 'omde.csound'
event_separator = '\n'
feventRE = <SRE_Pattern object>
ieventRE = <SRE_Pattern object>
pfield_separator = ' '
stdout = <omde.csound.File instance>