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 as JumpSequenceEvent, would need more information about context than this function’s parameters provide, and thus must be created using different means.

Parameters:
  • type – The initial value for the type attribute.
  • data (bytes) – The data to read from, which contains the data for this sequence event.
  • startOffset (int) –

    The offset in data to begin reading at. This should point to the byte containing the event’s type value.

    default:0
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} (where event is of type SequenceEvent and offset is of type int)) –

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 as pitch.)

Parameters:
  • type – The initial value for the type attribute.
  • velocityAndFlag (int) – Contains the initial values for the velocity and unknownFlag attributes. velocity will be set to velocityAndFlag & 0x7F, and unknownFlag will be set to bool(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 to False 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
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.
duration

The amount of time the rest will take. The units depend on the tempo the song is currently being played at.

Type:int
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 ID of the SBNK file that the desired instrument is located in. The SBNK needs to already be loaded, or else this track will stop playing.

Type:int
instrumentID

The ID of the instrument within the SBNK that this track should begin using.

Type:int
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
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 into args. Finally, use randMin and randMax to choose the minimum and maximum values for the randomized last argument.

Parameters:
  • subType – The initial value for the subType attribute.
  • args – The initial value for the args attribute.
  • randMin – The initial value for the randMin attribute.
  • randMax – The initial value for the randMax attribute.

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.

subType

The type value of the sequence event that will be executed.

Type:int
args

The arguments to the sequence event, except for the last one.

Type:list of int
randMin

The minimum value that can be chosen for the randomized last argument.

Type:int
randMax

The maximum value that can be chosen for the randomized last argument.

Todo

Is this inclusive or exclusive?

Type:int
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 into variableID.

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 type value of the sequence event that will be executed.

Type:int
variableID

The game will use the value contained in the variable specified here as the last argument to the sequence event.

Type:int
unknown

No idea what this is. According to sseq2mid, this is only present in the data if subType is between 0xB0 and 0xBD?

Type:int
Default:None
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.

value

The value to set the variable to.

Type:int
variableID

The ID of the variable that the value will be put into.

Type:int
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.

value

How much to increment the variable’s value.

Type:int
variableID

The ID of the variable that will be incremented.

Type:int
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.

value

How much to decrement the variable’s value.

Type:int
variableID

The ID of the variable that will be decremented.

Type:int
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.

value

The factor to multiply the variable’s value by.

Type:int
variableID

The ID of the variable that will be multiplied.

Type:int
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.

value

The divisor to divide the variable’s value by.

Type:int
variableID

The ID of the variable that will be divided.

Type:int
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.

value

The shift amount. Positive values result in left-shift, negative values result in arithmetic right-shift.

Type:int
variableID

The ID of the variable that will be shifted.

Type:int
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.

value

The random value chosen at runtime will be between 0 and this value (inclusive). This therefore behaves as an upper limit if positive, and a lower limit if negative.

Setting this to -32768 is not recommended; see the warning above.

Type:int
variableID

The ID of the variable that will be set to a random value.

Type:int
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.
value

A value that does nothing.

Type:int
variableID

The ID of the variable this sequence event will (not) act upon.

Type:int
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.

value

The value to compare the variable’s against.

Type:int
variableID

The ID of the variable to check.

Type:int
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.

value

The value to compare the variable’s against.

Type:int
variableID

The ID of the variable to check.

Type:int
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.

value

The value to compare the variable’s against.

Type:int
variableID

The ID of the variable to check.

Type:int
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.

value

The value to compare the variable’s against.

Type:int
variableID

The ID of the variable to check.

Type:int
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.

value

The value to compare the variable’s against.

Type:int
variableID

The ID of the variable to check.

Type:int
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.

value

The value to compare the variable’s against.

Type:int
variableID

The ID of the variable to check.

Type:int
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?

value

The panning value. A value of 64 is centered. Smaller values pan to the left, and larger values pan to the right.

Todo

This is stored as a byte; what happens if you use values above 127?

Type:int
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.
value

The value to set the track volume to. 0 is silent, and 127 is maximum loudness.

Todo

This is stored as a byte; what happens if you use values above 127?

Type:int
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.
value

The value to set the global volume to. 0 is silent, and 127 is maximum loudness.

Todo

This is stored as a byte; what happens if you use values above 127?

Type:int
class ndspy.soundSequence.TransposeSequenceEvent(value)
Base class:SequenceEvent

A sequence event that causes NoteSequenceEvents 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?

value

A value related to the track transposition.

Todo

How does this work?

Here’s a guess: 64 is no transposition, and lower values transpose downward and higher values transpose upward?

Type:int
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.

Todo

How does this actually work?

value

A value related to the portamento.

Type:int
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.

Todo

How does this actually work?

value

A value related to the portamento.

Type:int
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?

value

The new priority for the current track.

Type:int
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 (or int)
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, NoteSequenceEvents are blocking – that is, if you play a NoteSequenceEvent, execution will pause on that event until the note has finished playing. Thus, in this mode, you can just put a bunch of NoteSequenceEvents 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, NoteSequenceEvents are non-blocking – that is, if you play a NoteSequenceEvent, 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 use RestSequenceEvents. 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.
value

Whether tie mode should be enabled.

Type:bool (or int)
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.

value

A value related to the portamento.

Type:int
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.

Todo

This needs testing. I don’t really know how vibrato effects work.

value

A value related to the vibrato.

Type:int
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.

Todo

This needs testing. I don’t really know how vibrato effects work.

value

A value related to the vibrato.

Type:int
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 (or int)
class VibratoTypeSequenceEvent.Value[source]
Base class:enum.IntEnum

An enumeration that distinguishes between the types of vibrato effects that can be played.

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.

Todo

This needs testing. I don’t really know how vibrato effects work.

value

A value related to the vibrato.

Type:int
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 with TieSequenceEvents.

Parameters:value – The initial value for the value attribute.
value

Whether portamento mode should be enabled.

Type:bool (or int)
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.

Todo

How does this actually work?

value

A value related to the portamento.

Type:int
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?

value

A value related to the attack rate.

Type:int
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?

value

A value related to the decay rate.

Type:int
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?

value

A value related to the sustain rate.

Type:int
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?

value

A value related to the release rate.

Type:int
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.
loopCount

The number of times the loop should execute.

Todo

Or is it the number of times that execution should jump back to the beginning of the loop?

Type:int
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?

value

An unknown value.

Type:int
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?

value

An unknown value.

Type:int
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.

Todo

This needs testing. I don’t really know how vibrato effects work.

value

A value related to the vibrato.

Type:int
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.
value

The new tempo to use.

Todo

I think this is measured in BPM, but that needs to be double-checked.

Type:int
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?

value

An unknown value.

Type:int
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.

trackNumbers

The set of track IDs that will be used in the sequence, including track 0. All numbers in this set should be between 0 and 15 inclusive.

Type:set of int
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 NoteSequenceEvents that are currently playing are stopped immediately. If you’re in poly mode (see MonoPolySequenceEvent), you may need to add one last RestSequenceEvent 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.
data

The raw binary data this sequence event represents.

Type:bytes