Sequence Events¶
This page describes the sequence event classes within
ndspy.soundSequence
. All are subclasses of SequenceEvent
.
-
class
ndspy.soundSequence.
SequenceEvent
(type)[source]¶ An abstract base class representing any sequence event in a SSEQ or SSAR file. This class should not be used directly; it just defines a consistent interface for sequence event classes.
Parameters: type – The initial value for the type
attribute.-
dataLength
¶ The number of bytes this sequence event would take if it were to be saved (
save()
) right now. Some subclasses’ data lengths depend on the specific values of their other attributes; for such classes, this attribute may actually be a dynamic property.Type: int
Default: 1
-
type
¶ This sequence event’s “type” value. In general, this identifies a sequence event’s class (although
NoteSequenceEvent
in particular can use a variety of type values).Type: int
-
classmethod
fromData
(type, data[, startOffset])[source]¶ Create an instance of the
SequenceEvent
subclass this function is called on, using a particular type value and reading data beginning at some offset.This base class implementation simply raises
NotImplementedError
. All subclasses that can override it, should. Some, such asJumpSequenceEvent
, would need more information about context than this function’s parameters provide, and thus must be created using different means.Parameters: Returns: A sequence event representing the data.
Return type: Subclass of
SequenceEvent
-
save
([eventsToOffsets])[source]¶ Generate data representing this sequence event. This base class implementation simply returns a single byte containing
type
. Subclasses should reimplement this function to append their own data to this byte.Parameters: eventsToOffsets ( dict
:{event: offset}
(whereevent
is of typeSequenceEvent
andoffset
is of typeint
)) –A dictionary mapping other sequence events in the same file as this one to offsets. This can be necessary for certain events that reference other events to be able to save themselves.
default: {}
Returns: Data representing this sequence event. Return type: bytes
-
-
class
ndspy.soundSequence.
NoteSequenceEvent
(type, velocityAndFlag, duration)[source]¶ Base class: SequenceEvent
A sequence event that plays a note defined in a sound bank.
This class represents sequence event types 0x00 through 0x7F; the type value actually determines the pitch. (For convenience, then,
type
is aliased aspitch
.)Parameters: - type – The initial value for the
type
attribute. - velocityAndFlag (int) – Contains the initial values for the
velocity
andunknownFlag
attributes.velocity
will be set tovelocityAndFlag & 0x7F
, andunknownFlag
will be set tobool(velocityAndFlag & 0x80)
. - duration – The initial value for the
duration
attribute.
-
duration
¶ The amount of time this note should be played for. The units depend on the tempo the song is currently being played at. Setting this to 0 will cause the note to play forever, until forcibly stopped by something else.
Type: int
-
name
¶ A human-readable name of this note’s pitch, such as
"F#"
. Note names in this attribute may indicate the octave in some way. This is a read-only property.Warning
The representation of note names used in this attribute may be changed in the future. If you want human-readable note names that are guaranteed to be consistent across ndspy updates, please write your own code for generating them.
Type: str
-
pitch
¶ The pitch this note should be played at. Valid values are between 0 and 127, inclusive. 60 conventionally represents middle C.
Type: int
-
type
¶ This sequence event’s “type” value. Valid values for note sequence events are between 0 and 127, inclusive. The choice of type value in that range determines the note’s pitch.
Type: int
-
unknownFlag
¶ A flag with an unknown purpose that seems to produce glitchy behavior. Notes with this flag set may continue playing after their
duration
is over, or do other odd things. Accordingly, you should set this toFalse
unless you have a very good reason not to.Note
This value represents the most significant bit of the byte containing the
velocity
value.Type: bool
-
velocity
¶ The volume this sequence event should be played at. Valid values are between 0 and 127, inclusive. If you’re unsure, 127 is generally a good choice.
Note
The most significant bit of the byte containing this value can be found in the
unknownFlag
attribute.Type: int
- type – The initial value for the
-
class
ndspy.soundSequence.
RestSequenceEvent
(duration)[source]¶ Base class: SequenceEvent
A sequence event that causes SSEQ execution to pause for some amount of time before moving on. This is sequence event type 0x80.
Parameters: duration – The initial value for the duration
attribute.
-
class
ndspy.soundSequence.
InstrumentSwitchSequenceEvent
(bankID, instrumentID)[source]¶ Base class: SequenceEvent
A sequence event that causes the track it’s placed in to switch to using a different instrument (possibly in a different SBNK). This is sequence event type 0x81.
A track can have multiple of these events located at different times. This lets a single track use different instruments at different times, which is one way of partially working around the 16-track limit.
Parameters: - bankID – The initial value for the
bankID
attribute. - instrumentID – The initial value for the
instrumentID
attribute.
- bankID – The initial value for the
-
class
ndspy.soundSequence.
BeginTrackSequenceEvent
(trackNumber, firstEvent)[source]¶ Base class: SequenceEvent
A sequence event that declares the location in the sequence event data at which a particular track should begin executing. This is sequence event type 0x93.
Parameters: - trackNumber – The initial value for the
trackNumber
attribute. - firstEvent – The initial value for the
firstEvent
attribute.
See also
Multi-track Sequences – for more information about how to use this event.
-
firstEvent
¶ A reference to the event at which the track should begin executing.
Warning
This event must appear somewhere in the list of sequence events you’re building, or else you’ll experience errors that prevent you from saving your SSEQ or SSAR!
Type: SequenceEvent
-
trackNumber
¶ The ID of the track number that this event is referring to. This track should have already been defined with a
DefineTracksSequenceEvent
earlier in the sequence.Type: int
- trackNumber – The initial value for the
-
class
ndspy.soundSequence.
JumpSequenceEvent
(destination)[source]¶ Base class: SequenceEvent
A sequence event that causes execution of the current track to jump to some other location. This is sequence event type 0x94.
These are often used to create sequences that loop infinitely.
Parameters: destination – The initial value for the destination
attribute.See also
CallSequenceEvent
– a similar event that also pushes the current event’s address to a return-address stack.-
destination
¶ A reference to the event that execution should jump to.
Warning
This event must appear somewhere in the list of sequence events you’re building, or else you’ll experience errors that prevent you from saving your SSEQ or SSAR!
Type: SequenceEvent
-
-
class
ndspy.soundSequence.
CallSequenceEvent
(destination)[source]¶ Base class: SequenceEvent
A sequence event that causes execution of the current track to jump to some other location, and pushes the current event’s address to a return-address stack. This is sequence event type 0x95.
This can be used with
ReturnSequenceEvent
to implement function calls.Parameters: destination – The initial value for the destination
attribute.See also
JumpSequenceEvent
– a similar event that does not affect the return-address stack.-
destination
¶ A reference to the event that execution should jump to.
Warning
This event must appear somewhere in the list of sequence events you’re building, or else you’ll experience errors that prevent you from saving your SSEQ or SSAR!
Type: SequenceEvent
-
-
class
ndspy.soundSequence.
RandomSequenceEvent
(subType, args, randMin, randMax)[source]¶ Base class: SequenceEvent
A sequence event that executes some other event with a randomized last argument. This is sequence event type 0xA0.
This is a complicated sequence event. Set
subType
to the type value of some other sequence event, which will be executed with a randomized last argument. Then put all of the arguments except for the last one intoargs
. Finally, userandMin
andrandMax
to choose the minimum and maximum values for the randomized last argument.Parameters: Todo
This information is based on some variable names from sseq2mid’s source code, and on a few examples studied in a hex editor. This event should really be tested more carefully.
-
class
ndspy.soundSequence.
FromVariableSequenceEvent
(subType, variableID[, unknown])[source]¶ Base class: SequenceEvent
A sequence event that executes some other event with its last argument taken from a variable. This is sequence event type 0xA1.
This is a complicated sequence event. Set
subType
to the type value of some other sequence event, which will be executed with its last argument taken from a variable. Then put the variable ID that will contain the desired value intovariableID
.Parameters: - subType – The initial value for the
subType
attribute. - variableID – The initial value for the
variableID
attribute. - unknown – The initial value for the
unknown
attribute.
Todo
This sequence event is in serious need of further research.
- subType – The initial value for the
-
class
ndspy.soundSequence.
IfSequenceEvent
[source]¶ Base class: SequenceEvent
A sequence event that causes the next event to be skipped if the conditional flag is currently false. This is sequence event type 0xA2.
See also
Sequence Variables – for more information about how to use this event.
-
class
ndspy.soundSequence.
VariableAssignmentSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets a variable to a given value. This is sequence event type 0xB0.
This essentially does
(variable) = value
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableAdditionSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that increments a variable by a given value. This is sequence event type 0xB1.
This essentially does
(variable) += value
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableSubtractionSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that decrements a variable by a given value. This is sequence event type 0xB2.
This essentially does
(variable) -= value
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableMultiplicationSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that multiplies a variable by a given value. This is sequence event type 0xB3.
This essentially does
(variable) *= value
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableDivisionSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that divides a variable by a given value. This is sequence event type 0xB4.
This essentially does
(variable) /= value
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableShiftSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that left-shifts a variable by a given value. If the value is negative, it is right-shifted (arithmetic, not logical) instead. This is sequence event type 0xB4.
Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableRandSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets a variable to a random value between 0 and a specified outer limit (inclusive). This is sequence event type 0xB6.
Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
Warning
If called soon after the game boots, the ARM7 CPU may have low enough entropy that this event will behave deterministically. This is the root cause of a bug in Mario Kart DS – the sound effect that plays upon game boot is intended to be randomized, but in practice, it always selects the same sound on a given DS hardware model.
Warning
Due to an overflow bug, this event does not work as expected if
value
is set to -32768 – instead of selecting from the range [-32768, 0], it uses [0, 32767]. This bug has been verified to exist in a selection of games from 2005 to 2012, so it probably affects all games.- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableUnknownB7SequenceEvent
(variableID, value)¶ Base class: SequenceEvent
Deprecated since version 3.0.0: As code analysis has shown that this sequence event probably never existed, this class will be removed in the future.
A sequence event that has no code associated with it at all (verified in a selection of games from 2005 to 2012), and does nothing. This is sequence event type 0xB7.
Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableEqualSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets the conditional flag to true if the specified variable contains a given value, or to false otherwise. This is sequence event type 0xB8.
This essentially does
condFlag = ((variable) == value)
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableGreaterThanOrEqualSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets the conditional flag to true if the specified variable contains a value greater than or equal to a given value, or to false otherwise. This is sequence event type 0xB9.
This essentially does
condFlag = ((variable) >= value)
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableGreaterThanSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets the conditional flag to true if the specified variable contains a value greater than a given value, or to false otherwise. This is sequence event type 0xBA.
This essentially does
condFlag = ((variable) > value)
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableLessThanOrEqualSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets the conditional flag to true if the specified variable contains a value less than or equal to a given value, or to false otherwise. This is sequence event type 0xBB.
This essentially does
condFlag = ((variable) <= value)
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableLessThanSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets the conditional flag to true if the specified variable contains a value less than a given value, or to false otherwise. This is sequence event type 0xBC.
This essentially does
condFlag = ((variable) < value)
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
VariableNotEqualSequenceEvent
(variableID, value)¶ Base class: SequenceEvent
A sequence event that sets the conditional flag to true if the specified variable does not contain a given value, or to false otherwise. This is sequence event type 0xBD.
This essentially does
condFlag = ((variable) != value)
.Parameters: - variableID – The initial value for the
variableID
attribute. - value – The initial value for the
value
attribute.
See also
Sequence Variables – for more information about how to use this event.
- variableID – The initial value for the
-
class
ndspy.soundSequence.
PanSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the stereo panning value for the current track. This is sequence event type 0xC0.
Parameters: value – The initial value for the value
attribute.Note
SBNK instruments can also specify panning values. The interplay between instrument and track panning may cause your track’s sounds to ultimately be panned differently from how your
PanSequenceEvent
dictates.Todo
Is this actually per-track, or is it global?
-
class
ndspy.soundSequence.
TrackVolumeSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the volume of the current track. This is sequence event type 0xC1.
Parameters: value – The initial value for the value
attribute.
-
class
ndspy.soundSequence.
GlobalVolumeSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the global volume, for all tracks. This is sequence event type 0xC2.
Parameters: value – The initial value for the value
attribute.
-
class
ndspy.soundSequence.
TransposeSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that causes
NoteSequenceEvent
s following it in the current track to be transposed. This is sequence event type 0xC3.Parameters: value – The initial value for the value
attribute.Todo
If I have a
ndspy.soundBank.RangeInstrument
with separate note definitions for E and F, and I use this sequence event to transpose upward one half-step and then play an E, does it play the E at a higher pitch, or does it play the F?Todo
Is this actually per-track, or is it global?
-
class
ndspy.soundSequence.
PortamentoSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event related to portamentos. This is sequence event type 0xC4.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to portamentos:
PortamentoRangeSequenceEvent
,PortamentoFromSequenceEvent
,PortamentoOnOffSequenceEvent
,PortamentoDurationSequenceEvent
,TieSequenceEvent
.Todo
How does this actually work?
-
class
ndspy.soundSequence.
PortamentoRangeSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event related to portamentos. This is sequence event type 0xC5.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to portamentos:
PortamentoSequenceEvent
,PortamentoFromSequenceEvent
,PortamentoOnOffSequenceEvent
,PortamentoDurationSequenceEvent
,TieSequenceEvent
.Todo
How does this actually work?
-
class
ndspy.soundSequence.
TrackPrioritySequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the priority of the current track. Tracks with higher priority values will be favored over those with lower priorities if the sound system runs out of hardware channels and needs to cut off some sounds early. This is sequence event type 0xC6.
Parameters: value – The initial value for the value
attribute.Todo
I haven’t tested this very much. Is that explanation accurate? Also, what are the minimum and maximum priority values, and what’s the default? If the valid range isn’t 0-255, what happens if you choose a priority outside of the range?
-
class
ndspy.soundSequence.
MonoPolySequenceEvent
(value)[source]¶ Base class: SequenceEvent
A sequence event that switches the current track to mono mode or poly mode. This is sequence event type 0xC7.
The default mode is mono mode.
Parameters: value – The initial value for the value
attribute.See also
MonoPolySequenceEvent.Value
– for an explanation about the difference between mono and poly mode-
value
¶ The mode to set the track to.
Type: MonoPolySequenceEvent.Value
(orint
)
-
-
class
MonoPolySequenceEvent.
Value
[source]¶ Base class: enum.IntEnum
An enumeration that distinguishes between “mono” and “poly” track modes.
Mono mode is simpler to use, but less powerful. In mono mode,
NoteSequenceEvent
s are blocking – that is, if you play aNoteSequenceEvent
, execution will pause on that event until the note has finished playing. Thus, in this mode, you can just put a bunch ofNoteSequenceEvent
s in a row to play a simple tune. This mode is often used in SSAR sound effects.Poly mode is a bit more complicated, but more flexible. In poly mode,
NoteSequenceEvent
s are non-blocking – that is, if you play aNoteSequenceEvent
, execution will keep going while the note is being played. This lets you play multiple notes at once to produce chords. In this mode, the only way to cause a delay between events is to useRestSequenceEvent
s. This mode is usually used in SSEQ music files.The default mode is mono mode.
-
MONO
¶ Value 1: indicates mono mode.
-
POLY
¶ Value 0: indicates poly mode.
-
-
class
ndspy.soundSequence.
TieSequenceEvent
(value)[source]¶ Base class: SequenceEvent
A sequence event that enables or disables “tie” mode on the current track. This is sequence event type 0xC8.
If tie mode is enabled and the track is in mono mode (
MonoPolySequenceEvent
), consecutive notes (NoteSequenceEvent
) will be merged together into one long note. This can be used with portamentos to create a note that bends in arbitrarily complex ways.It’s unclear if this can also work correctly in poly mode, or if there are more uses for this mode than just portamentos.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to portamentos:
PortamentoSequenceEvent
,PortamentoRangeSequenceEvent
,PortamentoFromSequenceEvent
,PortamentoOnOffSequenceEvent
,PortamentoDurationSequenceEvent
.
-
class
ndspy.soundSequence.
PortamentoFromSequenceEvent
(value)[source]¶ Base class: SequenceEvent
A sequence event related to portamentos. This is sequence event type 0xC9.
Parameters: value – The initial value for the value
attribute.Todo
This needs further testing. Based on some SSARs I looked at (e.g.
SAR_VS_COMMON_MENU
in NSMB), it appears as though this sets the pitch that the next note will bend from (over its entire duration), but some tests didn’t seem to agree. For what it’s worth, this event is called “portamento control” by some sources.See also
Other sequence events related to portamentos:
PortamentoSequenceEvent
,PortamentoRangeSequenceEvent
,PortamentoOnOffSequenceEvent
,PortamentoDurationSequenceEvent
,TieSequenceEvent
.
-
class
ndspy.soundSequence.
VibratoDepthSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event related to vibratos. This is sequence event type 0xCA.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to vibratos:
VibratoSpeedSequenceEvent
,VibratoTypeSequenceEvent
,VibratoRangeSequenceEvent
,VibratoDelaySequenceEvent
.Todo
This needs testing. I don’t really know how vibrato effects work.
-
class
ndspy.soundSequence.
VibratoSpeedSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event related to vibratos. This is sequence event type 0xCB.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to vibratos:
VibratoDepthSequenceEvent
,VibratoTypeSequenceEvent
,VibratoRangeSequenceEvent
,VibratoDelaySequenceEvent
.Todo
This needs testing. I don’t really know how vibrato effects work.
-
class
ndspy.soundSequence.
VibratoTypeSequenceEvent
(value)[source]¶ Base class: SequenceEvent
A sequence event that sets the current vibrato type. This is sequence event type 0xCC.
Parameters: value – The initial value for the value
attribute.Todo
This needs testing. I don’t really know how vibrato effects work.
Also, what’s the default vibrato type?
-
value
¶ The new vibrato type.
Type: VibratoTypeSequenceEvent.Value
(orint
)
-
-
class
VibratoTypeSequenceEvent.
Value
[source]¶ Base class: enum.IntEnum
An enumeration that distinguishes between the types of vibrato effects that can be played.
See also
Other sequence events related to vibratos:
VibratoDepthSequenceEvent
,VibratoSpeedSequenceEvent
,VibratoRangeSequenceEvent
,VibratoDelaySequenceEvent
.Todo
What’s the default?
-
PITCH
¶ Value 0: notes’ pitches will be vibrated.
-
VOLUME
¶ Value 1: notes’ volumes will be vibrated.
-
PAN
¶ Value 2: notes’ panning values will be vibrated.
See also
PanSequenceEvent
– for more information about panning.
-
-
class
ndspy.soundSequence.
VibratoRangeSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event related to vibratos. This is sequence event type 0xCD.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to vibratos:
VibratoDepthSequenceEvent
,VibratoSpeedSequenceEvent
,VibratoTypeSequenceEvent
,VibratoDelaySequenceEvent
.Todo
This needs testing. I don’t really know how vibrato effects work.
-
class
ndspy.soundSequence.
PortamentoOnOffSequenceEvent
(value)[source]¶ Base class: SequenceEvent
A sequence event that enables or disables portamento mode. This is sequence event type 0xCE.
While a track is in this mode, every note (
NoteSequenceEvent
) will bend from the previous note’s pitch to its own, over its entire duration. This is most useful in mono mode, and withTieSequenceEvent
s.Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to portamentos:
PortamentoSequenceEvent
,PortamentoRangeSequenceEvent
,PortamentoFromSequenceEvent
,PortamentoDurationSequenceEvent
,TieSequenceEvent
.
-
class
ndspy.soundSequence.
PortamentoDurationSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event related to portamentos. This is sequence event type 0xCF.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to portamentos:
PortamentoSequenceEvent
,PortamentoRangeSequenceEvent
,PortamentoFromSequenceEvent
,PortamentoOnOffSequenceEvent
,TieSequenceEvent
.Todo
How does this actually work?
-
class
ndspy.soundSequence.
AttackRateSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the attack rate for notes (
NoteSequenceEvent
) in the current track. This is sequence event type 0xD0.Parameters: value – The initial value for the value
attribute.See also
The Wikipedia page on envelope explains attack, decay, sustain, and release values.
Todo
How does this actually work? Is this actually per-track, or global? How does this relate to the attack rates set in the note definitions? What’s the default attack rate value?
-
class
ndspy.soundSequence.
DecayRateSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the decay rate for notes (
NoteSequenceEvent
) in the current track. This is sequence event type 0xD1.Parameters: value – The initial value for the value
attribute.See also
The Wikipedia page on envelope explains attack, decay, sustain, and release values.
Todo
How does this actually work? Is this actually per-track, or global? How does this relate to the decay rates set in the note definitions? What’s the default decay rate value?
-
class
ndspy.soundSequence.
SustainRateSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the sustain rate for notes (
NoteSequenceEvent
) in the current track. This is sequence event type 0xD2.Parameters: value – The initial value for the value
attribute.See also
The Wikipedia page on envelope explains attack, decay, sustain, and release values.
Todo
How does this actually work? Is this actually per-track, or global? How does this relate to the sustain rates set in the note definitions? What’s the default sustain rate value?
-
class
ndspy.soundSequence.
ReleaseRateSequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event that sets the release rate for notes (
NoteSequenceEvent
) in the current track. This is sequence event type 0xD3.Parameters: value – The initial value for the value
attribute.See also
The Wikipedia page on envelope explains attack, decay, sustain, and release values.
Todo
How does this actually work? Is this actually per-track, or global? How does this relate to the release rates set in the note definitions? What’s the default release rate value?
-
class
ndspy.soundSequence.
BeginLoopSequenceEvent
(loopCount)[source]¶ Base class: SequenceEvent
A sequence event that begins a loop in the current track. This is sequence event type 0xD4.
The end of the loop must be marked by an
EndLoopSequenceEvent
.Parameters: loopCount – The initial value for the loopCount
attribute.
-
class
ndspy.soundSequence.
ExpressionSequenceEvent
(value)¶ Base class: SequenceEvent
An unknown sequence event type. This is sequence event type 0xD5.
Parameters: value – The initial value for the value
attribute.Todo
What on earth is this?
-
class
ndspy.soundSequence.
PrintVariableSequenceEvent
(value)¶ Base class: SequenceEvent
An unknown sequence event type. This is sequence event type 0xD6.
Parameters: value – The initial value for the value
attribute.Todo
What on earth is this?
-
class
ndspy.soundSequence.
VibratoDelaySequenceEvent
(value)¶ Base class: SequenceEvent
A sequence event related to vibratos. This is sequence event type 0xE0.
Parameters: value – The initial value for the value
attribute.See also
Other sequence events related to vibratos:
VibratoDepthSequenceEvent
,VibratoSpeedSequenceEvent
,VibratoTypeSequenceEvent
,VibratoRangeSequenceEvent
.Todo
This needs testing. I don’t really know how vibrato effects work.
-
class
ndspy.soundSequence.
TempoSequenceEvent
(value)[source]¶ Base class: SequenceEvent
A sequence event that sets the tempo for all tracks in the sequence. This is sequence event type 0xE1.
Parameters: value – The initial value for the value
attribute.
-
class
ndspy.soundSequence.
SweepPitchSequenceEvent
(value)[source]¶ Base class: SequenceEvent
An unknown sequence event type. This is sequence event type 0xE3.
Parameters: value – The initial value for the value
attribute.Todo
What on earth is this?
-
class
ndspy.soundSequence.
EndLoopSequenceEvent
[source]¶ Base class: SequenceEvent
A sequence event that ends a loop previously begun with a
BeginLoopSequenceEvent
. This is sequence event type 0xFC.
-
class
ndspy.soundSequence.
ReturnSequenceEvent
[source]¶ Base class: SequenceEvent
A sequence event that causes execution of the current track to jump back to the most recently encountered
CallSequenceEvent
. This is sequence event type 0xFD.
-
class
ndspy.soundSequence.
DefineTracksSequenceEvent
(trackNumbers)[source]¶ Base class: SequenceEvent
A sequence event that defines the track IDs that will be used in the sequence. This is sequence event type 0xFE.
Parameters: trackNumbers – The initial value for the trackNumbers
attribute.See also
Multi-track Sequences – for more information about how to use this event.
-
class
ndspy.soundSequence.
EndTrackSequenceEvent
[source]¶ Base class: SequenceEvent
A sequence event that ends execution of the current track. This is sequence event type 0xFF.
When this is encountered, any
NoteSequenceEvent
s that are currently playing are stopped immediately. If you’re in poly mode (seeMonoPolySequenceEvent
), you may need to add one lastRestSequenceEvent
just before the end-track event in order to prevent the last note from getting cut off.This event is only required if your track is supposed to end after a finite amount of time. Tracks that use
JumpSequenceEvent
to loop infinitely do not need one of these.
-
class
ndspy.soundSequence.
RawDataSequenceEvent
(data)[source]¶ Base class: SequenceEvent
A dummy sequence event that represents raw binary data that seems to be unreachable as far as ndspy can tell.
Parameters: data – The initial value for the data
attribute.