BaseSequence#
BaseSequence
is the parent class of the Sequence
, Rhythm
, and SoundSequence
classes.
- class thebeat.core.BaseSequence(iois, first_onset=0.0, end_with_interval=False, name=None)[source]#
This is the most basic of classes that the
Sequence
,Rhythm
, andSoundSequence
classes inherit from. It cannot do many things, apart from holding a number of inter-onset intervals (IOIs).The BaseSequence class dictates that a sequence can either end with an interval or not. The default is to end with an event, meaning that if there are n onset values (i.e. t values), there are n-1 IOIs. This is what people will need in most cases. Sequences that end with an interval have an IOI at the end (so they end with a gap of silence). This is what you will need in cases with e.g. rhythmical/musical sequences.
The BaseSequence class protects against impossible values for the IOIs, as well as for the event onsets (t values).
- iois#
Contains the inter-onset intervals (IOIs). This is the bread and butter of the BaseSequence class. Sequences that end with an event have n onsets and n-1 IOIs. Sequences that end with an interval have an equal number of IOIs and onsets.
- Type:
NumPy 1-D array
- end_with_interval#
If
False
, sequence has n-1 inter-onset intervals (IOIs) for n event onsets. IfTrue
, sequence has an equal number of IOIs and event onsets.- Type:
- name#
If desired, one can give the object a name. This is for instance used when printing the sequence, or when plotting the sequence. It can always be retrieved and changed via this attribute.
- Type:
- __init__(iois, first_onset=0.0, end_with_interval=False, name=None)[source]#
Initialization of BaseSequence class.
- copy(deep=True)[source]#
Returns a copy of itself. See
copy.copy()
for more information.- Parameters:
deep (
bool
, default:True
) – IfTrue
, a deep copy is returned. IfFalse
, a shallow copy is returned.
- property duration: float64#
Property that returns the summed total of the inter-onset intervals.
- property mean_ioi: float64#
The average inter-onset interval (IOI).