Top | ![]() |
![]() |
![]() |
![]() |
BtPatternBtPattern — class for an event pattern of a BtMachine instance |
A pattern contains a grid of events. Events are parameter changes in
BtMachine objects. The events are stored as GValues. Cells containing NULL
have no event for the parameter at the time.
Patterns can have individual lengths. The length is measured in ticks. How much that is in e.g. milliseconds is determined by “bpm” and “tpb”.
A pattern might consist of several groups. These are mapped to the global parameters of a machine and the voice parameters for each machine voice (if any). The number of voices (tracks) is the same in all patterns of a machine. If the voices are changed on the machine patterns resize themselves.
The patterns are used in the BtSequence to form the score of a song.
BtPattern *
bt_pattern_copy (const BtPattern * const self
);
Create a new instance as a copy of the given instance.
void bt_pattern_delete_row (const BtPattern * const self
,const gulong tick
);
Delete row for all parameters.
Since: 0.3
gchar * bt_pattern_get_global_event (const BtPattern * const self
,const gulong tick
,const gulong param
);
Returns the string representation of the specified cell. Free it when done.
GValue * bt_pattern_get_global_event_data (const BtPattern * const self
,const gulong tick
,const gulong param
);
Fetches a cell from the given location in the pattern. If there is no event
there, then the GValue
is uninitialized. Test with BT_IS_GVALUE(event).
Do not modify the contents!
BtValueGroup *
bt_pattern_get_global_group (const BtPattern * const self
);
Get the BtValueGroup for global parameters.
BtValueGroup * bt_pattern_get_group_by_parameter_group (const BtPattern * const self
,BtParameterGroup *param_group
);
Get the BtValueGroup for the given param_group
.
gchar * bt_pattern_get_voice_event (const BtPattern * const self
,const gulong tick
,const gulong voice
,const gulong param
);
Returns the string representation of the specified cell. Free it when done.
GValue * bt_pattern_get_voice_event_data (const BtPattern * const self
,const gulong tick
,const gulong voice
,const gulong param
);
Fetches a cell from the given location in the pattern. If there is no event
there, then the GValue
is uninitialized. Test with BT_IS_GVALUE(event).
Do not modify the contents!
BtValueGroup * bt_pattern_get_voice_group (const BtPattern * const self
,const gulong voice
);
Get the BtValueGroup for voice parameters.
gchar * bt_pattern_get_wire_event (const BtPattern * const self
,const gulong tick
,const BtWire *wire
,const gulong param
);
Returns the string representation of the specified cell. Free it when done.
GValue * bt_pattern_get_wire_event_data (const BtPattern * const self
,const gulong tick
,const BtWire *wire
,const gulong param
);
Fetches a cell from the given location in the pattern. If there is no event
there, then the GValue
is uninitialized. Test with BT_IS_GVALUE(event).
Do not modify the contents!
BtValueGroup * bt_pattern_get_wire_group (const BtPattern * const self
,const BtWire *wire
);
Get the BtValueGroup for wire parameters.
void bt_pattern_insert_row (const BtPattern * const self
,const gulong tick
);
Insert one empty row for all parameters.
Since: 0.3
BtPattern * bt_pattern_new (const BtSong * const song
,const gchar * const name
,const gulong length
,const BtMachine * const machine
);
Create a new instance. It will be automatically added to the machines pattern list.
void bt_pattern_serialize_columns (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
,GString *data
);
Serializes values from start_tick
to end_tick
for all params into data
.
self |
the pattern |
|
start_tick |
the start position for the range |
|
end_tick |
the end position for the range |
|
data |
the target |
Since: 0.6
gboolean bt_pattern_set_global_event (const BtPattern * const self
,const gulong tick
,const gulong param
,const gchar * const value
);
Stores the supplied value into the specified pattern cell.
gboolean bt_pattern_set_voice_event (const BtPattern * const self
,const gulong tick
,const gulong voice
,const gulong param
,const gchar * const value
);
Stores the supplied value into the specified pattern cell.
gboolean bt_pattern_set_wire_event (const BtPattern * const self
,const gulong tick
,const BtWire *wire
,const gulong param
,const gchar * const value
);
Stores the supplied value into the specified pattern cell.
gboolean bt_pattern_test_global_event (const BtPattern * const self
,const gulong tick
,const gulong param
);
Tests if there is an event in the specified cell.
gboolean bt_pattern_test_tick (const BtPattern * const self
,const gulong tick
);
Check if there are any event in the given pattern-row.
gboolean bt_pattern_test_voice_event (const BtPattern * const self
,const gulong tick
,const gulong voice
,const gulong param
);
Tests if there is an event in the specified cell.
gboolean bt_pattern_test_wire_event (const BtPattern * const self
,const gulong tick
,const BtWire *wire
,const gulong param
);
Tests if there is an event in the specified cell.
void bt_pattern_transform_colums (const BtPattern * const self
,BtValueGroupOp op
,const gulong start_tick
,const gulong end_tick
);
Applies op
to values from start_tick
to end_tick
to all parameters in the
pattern.
self |
the pattern |
|
op |
the transform operation |
|
start_tick |
the start position for the range |
|
end_tick |
the end position for the range |
Since: 0.11
“copy-source”
property“copy-source” BtPattern *
pattern to copy data from.
Owner: BtPattern
Flags: Write / Construct Only
“length”
property“length” gulong
length of the pattern in ticks.
Owner: BtPattern
Flags: Read / Write / Construct
“group-changed”
signalvoid user_function (BtPattern *self, BtParameterGroup *param_group, gboolean intermediate, gpointer user_data)
Signals that a group of this pattern has been changed (more than in one
place).
When doing e.g. line inserts, one will receive two updates, one before and
one after. The first will have intermediate
=TRUE
. Applications can use
that to defer change-consolidation.
self |
the pattern object that emitted the signal |
|
param_group |
the parameter group |
|
intermediate |
flag that is |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks
“param-changed”
signalvoid user_function (BtPattern *self, BtParameterGroup *param_group, gulong tick, gulong param, gpointer user_data)
Signals that a param of this pattern has been changed.
self |
the pattern object that emitted the signal |
|
param_group |
the parameter group |
|
tick |
the tick position inside the pattern |
|
param |
the parameter index |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks
“pattern-changed”
signalvoid user_function (BtPattern *self, gboolean intermediate, gpointer user_data)
Signals that this pattern has been changed (more than in one place).
When doing e.g. line inserts, one will receive two updates, one before and
one after. The first will have intermediate
=TRUE
. Applications can use
that to defer change-consolidation.
self |
the pattern object that emitted the signal |
|
intermediate |
flag that is |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks