Top | ![]() |
![]() |
![]() |
![]() |
BtPatternBtPattern — class for an event pattern of a BtMachine instance |
void | global-param-changed | No Hooks |
void | pattern-changed | No Hooks |
void | voice-param-changed | No Hooks |
A pattern contains a grid of events. Events are parameter changes in
BtMachine objects. The events are stored as GValues. Cells contaning NULL
have no event for the parameter at the time.
Patterns can have individual length. The length is meassured in ticks. How much that is in e.g. milliseconds is determined by “bpm” and “tpm”.
The number of voices (tracks) is the same in all patterns of a machine. If the voices are changed on the machine patterns resize themself.
The patterns are used in the BtSequence to form the score of a song.
void bt_pattern_blend_column (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
,const gulong param
);
Fade values from start_tick
to end_tick
for param
.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
|
param |
the parameter |
Since 0.3
void bt_pattern_blend_columns (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
);
Fade values from start_tick
to end_tick
for all params.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
Since 0.3
BtPattern *
bt_pattern_copy (const BtPattern * const self
);
Create a new instance as a copy of the given instance.
void bt_pattern_delete_column (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
,const gulong param
);
Randomize values from start_tick
to end_tick
for param
.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
|
param |
the parameter |
Since 0.6
void bt_pattern_delete_columns (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
);
Clear values from start_tick
to end_tick
for all params.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
Since 0.6
void bt_pattern_delete_full_row (const BtPattern * const self
,const gulong tick
);
Delete row for all parameters.
Since 0.3
void bt_pattern_delete_row (const BtPattern * const self
,const gulong tick
,const gulong param
);
Delete row for given param
.
Since 0.3
gboolean bt_pattern_deserialize_column (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
,const gulong param
,const gchar *data
);
Deserializes values to start_tick
to end_tick
for param
from data
.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
|
param |
the parameter |
|
data |
the source data |
TRUE
for success, FALSE
e.g. to indicate incompative GType values
for the column specified by param
and the data
.
Since 0.6
void bt_pattern_flip_column (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
,const gulong param
);
Flips values from start_tick
to end_tick
for param
up-side down.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
|
param |
the parameter |
Since 0.6
void bt_pattern_flip_columns (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
);
Flips values from start_tick
to end_tick
for all params up-side down.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
Since 0.5
BtPatternCmd bt_pattern_get_cmd (const BtPattern * const self
,const gulong tick
);
Returns the command id in the specified tick row.
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).
gulong bt_pattern_get_global_param_index (const BtPattern * const self
,const gchar * const name
,GError **error
);
Searches the list of registered dparam of the machine the pattern belongs to for a global dparam of the given name and returns the index if found.
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).
gulong bt_pattern_get_voice_param_index (const BtPattern * const self
,const gchar * const name
,GError **error
);
Searches the list of registered dparam of the machine the pattern belongs to for a voice dparam of the given name and returns the index if found.
void bt_pattern_insert_full_row (const BtPattern * const self
,const gulong tick
);
Insert one empty row for all parameters.
Since 0.3
void bt_pattern_insert_row (const BtPattern * const self
,const gulong tick
,const gulong param
);
Insert one empty row for given param
.
Since 0.3
BtPattern * bt_pattern_new (const BtSong * const song
,const gchar * const id
,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.
BtPattern * bt_pattern_new_with_event (const BtSong * const song
,const BtMachine * const machine
,const BtPatternCmd cmd
);
Create a new default pattern instance containg the given cmd
event.
It will be automatically added to the machines pattern list.
If cmd
is BT_PATTERN_CMD_NORMAL
use bt_pattern_new()
instead.
Don't call this from applications.
void bt_pattern_randomize_column (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
,const gulong param
);
Randomize values from start_tick
to end_tick
for param
.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
|
param |
the parameter |
Since 0.3
void bt_pattern_randomize_columns (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
);
Randomize values from start_tick
to end_tick
for all params.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
Since 0.3
void bt_pattern_serialize_column (const BtPattern * const self
,const gulong start_tick
,const gulong end_tick
,const gulong param
,GString *data
);
Serializes values from start_tick
to end_tick
for param
into data
.
self |
the pattern |
|
start_tick |
the start postion for the range |
|
end_tick |
the end postion for the range |
|
param |
the parameter |
|
data |
the target |
Since 0.6
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 postion for the range |
|
end_tick |
the end postion 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_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_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_tick_has_data (const BtPattern * const self
,const gulong tick
);
Check if there are any event in the given pattern-row.
“id”
property “id” gchar *
pattern identifier (unique per song).
Flags: Read / Write / Construct
Default value: "unamed pattern"
“is-internal”
property “is-internal” gboolean
internal (cmd-pattern) indicator.
Flags: Read / Write / Construct Only
Default value: FALSE
“length”
property “length” gulong
length of the pattern in ticks.
Flags: Read / Write / Construct
Allowed values: >= 1
“machine”
property“machine” BtMachine *
Machine object, the pattern belongs to.
Flags: Read / Write / Construct Only
“name”
property “name” gchar *
the display-name of the pattern.
Flags: Read / Write / Construct
Default value: "unamed"
“song”
property“song” BtSong *
Song object, the pattern belongs to.
Flags: Read / Write / Construct Only
“global-param-changed”
signalvoid user_function (BtPattern *self, gulong tick, gulong param, gpointer user_data)
signals that a global param of this pattern has been changed
self |
the pattern object that emitted the signal |
|
tick |
the tick position inside the pattern |
|
param |
the global 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. lin inserts, one will receive two updtes, 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 |
boolean flag that is |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks
“voice-param-changed”
signalvoid user_function (BtPattern *self, gulong tick, gulong voice, gulong param, gpointer user_data)
signals that a voice param of this pattern has been changed
self |
the pattern object that emitted the signal |
|
tick |
the tick position inside the pattern |
|
voice |
the voice number |
|
param |
the voice parameter index |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Hooks