SchedEvent#
- class csoundengine.schedevent.SchedEvent(instrname='', start=0.0, dur=-1, args=None, p1=0, uniqueId=0, parent=None, priority=0, controls=None, controlsSlot=-1, username='')[source]#
Bases:
BaseSchedEventRepresents a scheduled event.
It is used to control / automate / keep track of scheduled events. Used as is to represent offline events, it is the base class for realtime events (
Synth)- Parameters:
p1 (
float|str) – the p1 of the scheduled eventstart (
float) – start timedur (
float) – durationargs (
Optional[Sequence[float|str]]) – pfields starting with p4controls (
dict[str,float] |None) – the dynamic controls used to schedule this eventuniqueId (
int) – an integer unique to this eventparent (
AbstractRenderer) – the renderer which scheduled this eventinstrname (
str) – the instr name of this event (if applies)priority (
int) – the priority at which this event was scheduled (if applies)controlsSlot (
int) – the slot/token assigned for dynamic controlsusername – a name given by the user to identify this event. Normally not set
Attributes Summary
Args used for this event (p4, p5, ...)
The dynamic controls used to schedule this event
The slot/token assigned for dynamic controls
The Instr corresponding to this Event, if applicable
The instrument template this event was created from, if applicable
p1 of this event
The Renderer to which this event belongs (can be None)
The priority of this event, if applicable
A unique id of this event, as integer
A user given name to identify this event, normally not set
Methods Summary
aliases()automate(param, pairs[, mode, delay, overtake])Automate any named parameter of this Synth
clone(**kws)controlNames([aliases, aliased])The names of all controls
dynamicParamNames([aliases, aliased])The set of all dynamic parameters accepted by this Synth
paramNames([aliases, aliased])Set of all named parameters :rtype:
frozenset[str]paramValue(param)Query the value of a parameter, if possible
pfieldNames([aliases, aliased])Returns a set of all named pfields
Returns the playing status of this event (offline, playing, stopped or future)
stop([delay])Stop this event
Attributes Documentation
- args#
Args used for this event (p4, p5, …)
-
automations:
list[SchedAutomation] |None#
-
controls:
dict[str,float] |None# The dynamic controls used to schedule this event
-
controlsSlot:
int# The slot/token assigned for dynamic controls
- instr#
The Instr corresponding to this Event, if applicable
Raises ValueError if this event cannot access to the Instr instance (if it has no parent or its instrument name is invalid)
-
instrname:
str# The instrument template this event was created from, if applicable
- p1#
p1 of this event
-
parent:
AbstractRenderer|None# The Renderer to which this event belongs (can be None)
-
priority:
int# The priority of this event, if applicable
-
uniqueId:
int# A unique id of this event, as integer
- username#
A user given name to identify this event, normally not set
Methods Documentation
- automate(param, pairs, mode='linear', delay=None, overtake=False)[source]#
Automate any named parameter of this Synth
This method will automate this synth’s pfields / param table, depending of how the instrument was defined.
- Parameters:
param (
str) – the name of the parameter to automate, or the param indexpairs (
Union[Sequence[float],ndarray,tuple[ndarray,ndarray]]) – automation data as a flat array with the form [time0, value0, time1, value1, …]mode – one of ‘linear’, ‘cos’. Determines the curve between values
delay (
float|None) – when to start the automationovertake – if True, do not use the first value in pairs but overtake the current value
- Return type:
float- Returns:
the eventid of the automation event
- controlNames(aliases=True, aliased=False)[source]#
The names of all controls
- Parameters:
aliases – if True, included control names aliases (if applicable)
aliased – if True, include the aliased names
- Return type:
frozenset[str]- Returns:
the names of all controls. Returns an empty set if this event does not have any controls
- dynamicParamNames(aliases=True, aliased=False)[source]#
The set of all dynamic parameters accepted by this Synth
- Parameters:
aliases – if True, include aliases
aliased – include the original names of parameters which have an alias. If both aliases and aliased params are included, there are two names to access the same parameter
- Return type:
frozenset[str]- Returns:
a set of the dynamic (modifiable) parameters accepted by this synth
- paramNames(aliases=True, aliased=False)[source]#
Set of all named parameters :rtype:
frozenset[str]See also
dynamicParams(),set(),automate()
- paramValue(param)[source]#
Query the value of a parameter, if possible
If the event is live the actual value is queried; otherwise, the value used at event initialization
- Parameters:
query (the parameter to)
- Return type:
float|str|None- Returns:
the value of the parameter.
TODO: check if it actual returns None and why
- pfieldNames(aliases=True, aliased=False)[source]#
Returns a set of all named pfields
- Parameters:
aliases – if True, included aliases for pfields (if applicable)
aliased – if True, include the aliased names. Otherwise if aliases are defined and included (aliases=True), the original names will be excluded
- Return type:
frozenset[str]- Returns:
a set with the all pfield names.
- playStatus()[source]#
Returns the playing status of this event (offline, playing, stopped or future)
For offline events this will always return ‘offline’
- Return type:
str- Returns:
‘playing’ if currently playing, ‘stopped’ if this event has already stopped or ‘future’ if it has not started. For offline events always returns ‘offline’