PS04RhythmPattern

PS04RhythmPattern — Drum/bass rhythm pattern

Synopsis


#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);

Object Hierarchy


  GObject
   +----PS04RhythmPattern

Implemented Interfaces

PS04RhythmPattern implements PS04Streamable.

Description

The PS04RhythmPattern class represents a pattern in the PS-04 sequencer. It contains zero or more events (PS04RhythmPatternEvent).

Details

PS04RhythmPattern

typedef struct _PS04RhythmPattern PS04RhythmPattern;


PS04_PULSES_PER_QUARTER_NOTE

#define PS04_PULSES_PER_QUARTER_NOTE 48


ps04_rhythm_pattern_new ()

PS04RhythmPattern* ps04_rhythm_pattern_new  (void);

Creates a new rhythm pattern.

Returns : a new PS04RhythmPattern.

ps04_rhythm_pattern_add_event ()

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.

ps04_rhythm_pattern_clear ()

void        ps04_rhythm_pattern_clear       (PS04RhythmPattern *self);

Deletes all events from the pattern.

self : A PS04RhythmPattern.

ps04_rhythm_pattern_get_bass_program ()

PS04BassProgram ps04_rhythm_pattern_get_bass_program
                                            (const PS04RhythmPattern *self);

Gets the pattern's selected bass program.

self : A PS04RhythmPattern.
Returns : the bass program.

ps04_rhythm_pattern_get_bass_volume ()

guint       ps04_rhythm_pattern_get_bass_volume
                                            (const PS04RhythmPattern *self);

Gets the bass volume.

self : A PS04RhythmPattern.
Returns : the bass volume (0-15).

ps04_rhythm_pattern_get_beats_per_bar ()

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

ps04_rhythm_pattern_get_drum_kit ()

PS04DrumKit ps04_rhythm_pattern_get_drum_kit
                                            (const PS04RhythmPattern *self);

Gets the pattern's selected drum kit.

self : A PS04RhythmPattern.
Returns : the drum kit.

ps04_rhythm_pattern_get_drum_volume ()

guint       ps04_rhythm_pattern_get_drum_volume
                                            (const PS04RhythmPattern *self);

Gets the drum volume.

self : A PS04RhythmPattern.
Returns : the drum volume (0-15).

ps04_rhythm_pattern_get_events ()

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.

ps04_rhythm_pattern_get_length_in_ticks ()

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

ps04_rhythm_pattern_get_n_bars ()

guint       ps04_rhythm_pattern_get_n_bars  (const PS04RhythmPattern *self);

self : A PS04RhythmPattern.
Returns : the number of bars in the pattern.

ps04_rhythm_pattern_get_n_events ()

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.

ps04_rhythm_pattern_get_name ()

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.

ps04_rhythm_pattern_get_org_root ()

PS04RelativeBassPitch ps04_rhythm_pattern_get_org_root
                                            (const PS04RhythmPattern *self);

self :
Returns :

ps04_rhythm_pattern_get_org_root_as_string ()

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

ps04_rhythm_pattern_get_start_event_index ()

guint       ps04_rhythm_pattern_get_start_event_index
                                            (const PS04RhythmPattern *self);

self :
Returns :

ps04_rhythm_pattern_has_note_with_pitch ()

gboolean    ps04_rhythm_pattern_has_note_with_pitch
                                            (const PS04RhythmPattern *self,
                                             guint pitch);

self :
pitch :
Returns :

ps04_rhythm_pattern_is_empty ()

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.

ps04_rhythm_pattern_set_name ()

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.