![]() |
![]() |
![]() |
GPS04 Reference Manual | ![]() |
---|---|---|---|---|
#include <PS04-rhythm-pattern.h> PS04RhythmPattern; #define PS04_PULSES_PER_QUARTER_NOTE PS04RhythmPattern* ps04_rhythm_pattern_new (void); void ps04_rhythm_pattern_add_event (PS04RhythmPattern *self, PS04RhythmPatternEvent *event); void ps04_rhythm_pattern_clear (PS04RhythmPattern *self); PS04BassProgram ps04_rhythm_pattern_get_bass_program (const PS04RhythmPattern *self); guint ps04_rhythm_pattern_get_bass_volume (const PS04RhythmPattern *self); guint ps04_rhythm_pattern_get_beats_per_bar (const PS04RhythmPattern *self); PS04DrumKit ps04_rhythm_pattern_get_drum_kit (const PS04RhythmPattern *self); guint ps04_rhythm_pattern_get_drum_volume (const PS04RhythmPattern *self); const GList* ps04_rhythm_pattern_get_events (const PS04RhythmPattern *self); guint ps04_rhythm_pattern_get_length_in_ticks (const PS04RhythmPattern *self); guint ps04_rhythm_pattern_get_n_bars (const PS04RhythmPattern *self); guint ps04_rhythm_pattern_get_n_events (const PS04RhythmPattern *self); const char* ps04_rhythm_pattern_get_name (const PS04RhythmPattern *self); PS04RelativeBassPitch ps04_rhythm_pattern_get_org_root (const PS04RhythmPattern *self); const char* ps04_rhythm_pattern_get_org_root_as_string (const PS04RhythmPattern *self); guint ps04_rhythm_pattern_get_start_event_index (const PS04RhythmPattern *self); gboolean ps04_rhythm_pattern_has_note_with_pitch (const PS04RhythmPattern *self, guint pitch); gboolean ps04_rhythm_pattern_is_empty (const PS04RhythmPattern *self); void ps04_rhythm_pattern_set_name (PS04RhythmPattern *self, const char *name);
The PS04RhythmPattern class represents a pattern in the PS-04 sequencer. It contains zero or more events (PS04RhythmPatternEvent).
PS04RhythmPattern* ps04_rhythm_pattern_new (void);
Creates a new rhythm pattern.
Returns : | a new PS04RhythmPattern. |
void ps04_rhythm_pattern_add_event (PS04RhythmPattern *self, PS04RhythmPatternEvent *event);
Adds an event to the rhythm pattern, which assumes ownership of it.
self : |
A PS04RhythmPattern. |
event : |
A PS04RhythmPatternEvent to be added. |
void ps04_rhythm_pattern_clear (PS04RhythmPattern *self);
Deletes all events from the pattern.
self : |
A PS04RhythmPattern. |
PS04BassProgram ps04_rhythm_pattern_get_bass_program (const PS04RhythmPattern *self);
Gets the pattern's selected bass program.
self : |
A PS04RhythmPattern. |
Returns : | the bass program. |
guint ps04_rhythm_pattern_get_bass_volume (const PS04RhythmPattern *self);
Gets the bass volume.
self : |
A PS04RhythmPattern. |
Returns : | the bass volume (0-15). |
guint ps04_rhythm_pattern_get_beats_per_bar (const PS04RhythmPattern *self);
Gets the number of beats per bar.
self : |
A PS04RhythmPattern. |
Returns : | the number of beats (1-8). |
PS04DrumKit ps04_rhythm_pattern_get_drum_kit (const PS04RhythmPattern *self);
Gets the pattern's selected drum kit.
self : |
A PS04RhythmPattern. |
Returns : | the drum kit. |
guint ps04_rhythm_pattern_get_drum_volume (const PS04RhythmPattern *self);
Gets the drum volume.
self : |
A PS04RhythmPattern. |
Returns : | the drum volume (0-15). |
const GList* ps04_rhythm_pattern_get_events (const PS04RhythmPattern *self);
Gets the pattern events as a GList.
self : |
a PS04RhythmPattern. |
Returns : | a GList, owned by the pattern. |
guint ps04_rhythm_pattern_get_length_in_ticks (const PS04RhythmPattern *self);
Calculates the total pattern length in PS-04 ticks (1/48 of a beat).
self : |
A PS04RhythmPattern. |
Returns : | the length in ticks (or 0 if empty). |
guint ps04_rhythm_pattern_get_n_bars (const PS04RhythmPattern *self);
self : |
A PS04RhythmPattern. |
Returns : | the number of bars in the pattern. |
guint ps04_rhythm_pattern_get_n_events (const PS04RhythmPattern *self);
Gets the number of events in the pattern.
self : |
A PS04RhythmPattern. |
Returns : | the number of events. |
const char* ps04_rhythm_pattern_get_name (const PS04RhythmPattern *self);
Gets the name of the pattern.
self : |
A PS04RhythmPattern. |
Returns : | a pointer to a static buffer, owned by the class. This method is thus not thread-safe. |
PS04RelativeBassPitch ps04_rhythm_pattern_get_org_root (const PS04RhythmPattern *self);
self : |
|
Returns : |
const char* ps04_rhythm_pattern_get_org_root_as_string (const PS04RhythmPattern *self);
Gets the original chord root as a string (like "C", "F#", etc.).
self : |
A PS04RhythmPattern. |
Returns : | the chord root string (a constant). |
guint ps04_rhythm_pattern_get_start_event_index (const PS04RhythmPattern *self);
self : |
|
Returns : |
gboolean ps04_rhythm_pattern_has_note_with_pitch (const PS04RhythmPattern *self, guint pitch);
self : |
|
pitch : |
|
Returns : |
gboolean ps04_rhythm_pattern_is_empty (const PS04RhythmPattern *self);
Checks if the pattern is empty (non-defined).
self : |
A PS04RhythmPattern. |
Returns : | TRUE if the pattern is empty, otherwise FALSE .
|
void ps04_rhythm_pattern_set_name (PS04RhythmPattern *self, const char *name);
Sets the name of the pattern. The name will be converted to upper case and truncated to 5 characters or padded with spaces as needed. Only ASCII chars are allowed.
self : |
A PS04RhythmPattern. |
name : |
The new name of the pattern. |