AgsPattern

AgsPattern — Pattern representing tones

Functions

Properties

gboolean current-bit Read
guint first-index Read / Write
guint offset Read / Write
AgsPort * port Read / Write
guint second-index Read / Write
AgsTimestamp * timestamp Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── AgsPattern

Implemented Interfaces

AgsPattern implements AgsConnectable, AgsTactable and AgsPortlet.

Includes

#include <ags/audio/ags_pattern.h>

Description

AgsPattern represents an audio pattern of tones.

Functions

ags_pattern_find_near_timestamp ()

GList *
ags_pattern_find_near_timestamp (GList *pattern,
                                 GObject *timestamp);

Retrieve appropriate pattern for timestamp.

Parameters

pattern

a GList containing AgsPattern

 

timestamp

the matching timestamp

 

Returns

Next match.

Since: 1.0.0


ags_pattern_set_dim ()

void
ags_pattern_set_dim (AgsPattern *pattern,
                     guint dim0,
                     guint dim1,
                     guint length);

Reallocates the pattern's dimensions.

Parameters

pattern

an AgsPattern

 

dim0

bank 0 size

 

dim1

bank 1 size

 

length

amount of beats

 

Since: 1.0.0


ags_pattern_is_empty ()

gboolean
ags_pattern_is_empty (AgsPattern *pattern,
                      guint i,
                      guint j);

ags_pattern_get_bit ()

gboolean
ags_pattern_get_bit (AgsPattern *pattern,
                     guint i,
                     guint j,
                     guint bit);

Check for tic to be played.

Parameters

pattern

an AgsPattern

 

i

bank index 0

 

j

bank index 1

 

bit

the tic to check

 

Returns

TRUE if tone is enabled.

Since: 1.0.0


ags_pattern_toggle_bit ()

void
ags_pattern_toggle_bit (AgsPattern *pattern,
                        guint i,
                        guint j,
                        guint bit);

Toggle tone.

Parameters

pattern

an AgsPattern

 

i

bank index 0

 

j

bank index 1

 

bit

the tic to toggle

 

Since: 1.0.0


ags_pattern_new ()

AgsPattern *
ags_pattern_new ();

Creates an AgsPattern

Returns

a new AgsPattern

Since: 1.0.0


AGS_IS_PATTERN()

#define AGS_IS_PATTERN(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_PATTERN))

AGS_PATTERN()

#define AGS_PATTERN(obj)                (G_TYPE_CHECK_INSTANCE_CAST(obj, AGS_TYPE_PATTERN, AgsPattern))

AGS_PATTERN_CLASS()

#define AGS_PATTERN_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST(class, AGS_TYPE_PATTERN, AgsPatternClass))

AGS_PATTERN_GET_CLASS()

#define AGS_PATTERN_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), AGS_TYPE_PATTERN, AgsPatternClass))

ags_pattern_get_type ()

GType
ags_pattern_get_type ();

Types and Values

AGS_PATTERN_DEFAULT_BPM

#define AGS_PATTERN_DEFAULT_BPM (120.0)

AGS_PATTERN_TICS_PER_BEAT

#define AGS_PATTERN_TICS_PER_BEAT (1.0)

AGS_PATTERN_MINIMUM_NOTE_LENGTH

#define AGS_PATTERN_MINIMUM_NOTE_LENGTH (1.0 / 16.0)

AGS_PATTERN_MAXIMUM_NOTE_LENGTH

#define AGS_PATTERN_MAXIMUM_NOTE_LENGTH (16.0)

AGS_PATTERN_DEFAULT_LENGTH

#define AGS_PATTERN_DEFAULT_LENGTH (65535.0 / AGS_PATTERN_TICS_PER_BEAT - AGS_PATTERN_MAXIMUM_NOTE_LENGTH)

AGS_PATTERN_DEFAULT_JIFFIE

#define AGS_PATTERN_DEFAULT_JIFFIE (60.0 / AGS_PATTERN_DEFAULT_BPM / AGS_PATTERN_TICS_PER_BEAT)

AGS_PATTERN_DEFAULT_DURATION

#define AGS_PATTERN_DEFAULT_DURATION (AGS_PATTERN_DEFAULT_LENGTH * AGS_PATTERN_DEFAULT_JIFFIE * AGS_MICROSECONDS_PER_SECOND)

enum AgsPatternFlags

Enum values to control the behavior or indicate internal state of AgsPattern by enable/disable as flags.

Members

AGS_PATTERN_CONNECTED

indicates the pattern was connected by calling AgsConnectable::connect()

 

AGS_TYPE_PATTERN

#define AGS_TYPE_PATTERN                (ags_pattern_get_type())

struct AgsPattern

struct AgsPattern;

struct AgsPatternClass

struct AgsPatternClass {
  GObjectClass gobject;
};

Property Details

The “current-bit” property

  “current-bit”              gboolean

Offset of current position.

Flags: Read

Default value: FALSE

Since: 1.0.0


The “first-index” property

  “first-index”              guint

Selected bank 0.

Flags: Read / Write

Allowed values: <= 256

Default value: 0

Since: 1.0.0


The “offset” property

  “offset”                   guint

Position of pattern.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “port” property

  “port”                     AgsPort *

The pattern's port.

Flags: Read / Write

Since: 1.0.0


The “second-index” property

  “second-index”             guint

Selected bank 1.

Flags: Read / Write

Allowed values: <= 256

Default value: 0

Since: 1.0.0


The “timestamp” property

  “timestamp”                AgsTimestamp *

The pattern's timestamp.

Flags: Read / Write

Since: 1.0.0