AgsNote

AgsNote — Note class.

Functions

Properties

AgsComplex * attack Read / Write
AgsComplex * decay Read / Write
gchar * note-name Read / Write
AgsComplex * ratio Read / Write
AgsComplex * release Read / Write
guint stream-attack Read / Write
gdouble stream-delay Read / Write
AgsComplex * sustain Read / Write
guint x0 Read / Write
guint x1 Read / Write
guint y Read / Write

Types and Values

enum AgsNoteFlags
#define AGS_TYPE_NOTE
struct AgsNote
struct AgsNoteClass

Object Hierarchy

    GObject
    ╰── AgsNote

Implemented Interfaces

AgsNote implements AgsConnectable.

Includes

#include <ags/audio/ags_note.h>

Description

AgsNote represents a tone.

Functions

ags_note_sort_func ()

gint
ags_note_sort_func (gconstpointer a,
                    gconstpointer b);

Sort notes.

Parameters

a

an AgsNote

 

b

an AgsNote

 

Returns

0 if equal, -1 if smaller and 1 if bigger offset

Since: 1.0.0


ags_note_find_prev ()

GList *
ags_note_find_prev (GList *note,
                    guint x0,
                    guint y);

Find prev note having the same y offset.

Parameters

note

a GList containing AgsNote

 

x0

x offset

 

y

y offset

 

Returns

the matching entry as GList if first entry's x offset bigger than x0 , else NULL

Since: 1.0.0


ags_note_find_next ()

GList *
ags_note_find_next (GList *note,
                    guint x0,
                    guint y);

Find next note having the same y offset.

Parameters

note

a GList containing AgsNote

 

x0

x offset

 

y

y offset

 

Returns

the matching entry as GList if last entry's x offset smaller than x0 , else NULL

Since: 1.0.0


ags_note_length_to_smf_delta_time ()

glong
ags_note_length_to_smf_delta_time (guint note_length,
                                   gdouble bpm,
                                   gdouble delay_factor,
                                   glong nn,
                                   glong dd,
                                   glong cc,
                                   glong bb,
                                   glong tempo);

Convert note length to SMF delta-time.

Parameters

note_length

the note length to convert

 

bpm

the source bpm

 

delay_factor

the source delay factor

 

nn

numerator

 

dd

denominator

 

cc

clocks

 

bb

beats

 

tempo

tempo

 

Returns

the delta-time

Since: 1.0.0


ags_note_smf_delta_time_to_length ()

guint
ags_note_smf_delta_time_to_length (glong delta_time,
                                   glong nn,
                                   glong dd,
                                   glong cc,
                                   glong bb,
                                   glong tempo,
                                   gdouble bpm,
                                   gdouble delay_factor);

Convert SMF delta-time to note length.

Parameters

delta_time

delta-time

 

nn

numerator

 

dd

denominator

 

cc

clocks

 

bb

beats

 

tempo

tempo

 

bpm

the target bpm

 

delay_factor

the target delay factor

 

Returns

the note length

Since: 1.0.0


ags_note_to_raw_midi ()

unsigned char *
ags_note_to_raw_midi (AgsNote *note,
                      gdouble bpm,
                      gdouble delay_factor,
                      guint *buffer_length);

ags_note_to_raw_midi_extended ()

unsigned char *
ags_note_to_raw_midi_extended (AgsNote *note,
                               gdouble bpm,
                               gdouble delay_factor,
                               glong nn,
                               glong dd,
                               glong cc,
                               glong bb,
                               glong tempo,
                               guint *buffer_length);

Convert note to raw-midi.

Parameters

note

the AgsNote

 

bpm

the source bpm

 

delay_factor

the source delay factor

 

nn

numerator

 

dd

denominator

 

cc

clocks

 

bb

beats

 

tempo

tempo

 

buffer_length

the return location of buffer length

 

Returns

the raw-midi buffer

Since: 1.0.0


ags_note_to_seq_event ()

snd_seq_event_t *
ags_note_to_seq_event (AgsNote *note,
                       gdouble bpm,
                       gdouble delay_factor,
                       guint *n_events);

Convert note to ALSA sequencer events and set the number of events in the array as n_events .

Parameters

note

the AgsNote

 

bpm

the bpm to use

 

delay_factor

the segmentation delay factor

 

n_events

the count of events

 

Returns

The sequencer events as array.

Since: 1.0.0


ags_note_to_seq_event_extended ()

snd_seq_event_t *
ags_note_to_seq_event_extended (AgsNote *note,
                                gdouble bpm,
                                gdouble delay_factor,
                                glong nn,
                                glong dd,
                                glong cc,
                                glong bb,
                                glong tempo,
                                guint *n_events);

Convert note to raw-midi.

Parameters

note

the AgsNote

 

bpm

the source bpm

 

delay_factor

the source delay factor

 

nn

numerator

 

dd

denominator

 

cc

clocks

 

bb

beats

 

tempo

tempo

 

n_events

the return location of event count

 

Returns

an array of snd_seq_event_t structs

Since: 1.0.0


ags_note_from_raw_midi ()

GList *
ags_note_from_raw_midi (unsigned char *raw_midi,
                        gdouble bpm,
                        gdouble delay_factor,
                        guint length);

Parse raw_midi data and convert to AgsNote.

Parameters

raw_midi

the data array

 

bpm

the bpm to use

 

delay_factor

the segmentation delay factor

 

length

the length of the array

 

Returns

a GList containing the notes

Since: 1.0.0


ags_note_from_raw_midi_extended ()

GList *
ags_note_from_raw_midi_extended (unsigned char *raw_midi,
                                 glong nn,
                                 glong dd,
                                 glong cc,
                                 glong bb,
                                 glong tempo,
                                 gdouble bpm,
                                 gdouble delay_factor,
                                 guint length);

Parse raw_midi data and convert to AgsNote.

Parameters

raw_midi

the data array

 

nn

numerator

 

dd

denominator

 

cc

clocks

 

bb

beats

 

tempo

tempo

 

bpm

the bpm to use

 

delay_factor

the segmentation delay factor

 

length

the length of the array

 

Returns

a GList containing the notes

Since: 1.0.0


ags_note_from_seq_event ()

GList *
ags_note_from_seq_event (snd_seq_event_t *event,
                         gdouble bpm,
                         gdouble delay_factor,
                         guint n_events);

Convert ALSA sequencer data event to AgsNote.

Parameters

event

ALSA sequencer events as array

 

bpm

the bpm to use

 

delay_factor

the segmentation delay factor

 

n_events

the arrays length

 

Returns

a GList containing the notes

Since: 1.0.0


ags_note_from_seq_event_extended ()

GList *
ags_note_from_seq_event_extended (snd_seq_event_t *event,
                                  glong nn,
                                  glong dd,
                                  glong cc,
                                  glong bb,
                                  glong tempo,
                                  gdouble bpm,
                                  gdouble delay_factor,
                                  guint n_events);

Parse raw_midi data and convert to AgsNote.

Parameters

event

the snd_seq_event_t struct array

 

nn

numerator

 

dd

denominator

 

cc

clocks

 

bb

beats

 

tempo

tempo

 

bpm

the bpm to use

 

delay_factor

the segmentation delay factor

 

n_events

the count snd_seq_event_t structs

 

Returns

a GList containing the notes

Since: 1.0.0


ags_note_duplicate ()

AgsNote *
ags_note_duplicate (AgsNote *note);

Duplicate a note.

Parameters

note

an AgsNote

 

Returns

the duplicated AgsNote.

Since: 1.0.0


ags_note_new ()

AgsNote *
ags_note_new ();

Creates an AgsNote

Returns

a new AgsNote

Since: 1.0.0


ags_note_new_with_offset ()

AgsNote *
ags_note_new_with_offset (guint x0,
                          guint x1,
                          guint y,
                          gdouble stream_delay,
                          guint stream_attack);

AGS_IS_NOTE()

#define AGS_IS_NOTE(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_NOTE))

AGS_NOTE()

#define AGS_NOTE(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_NOTE, AgsNote))

AGS_NOTE_CLASS()

#define AGS_NOTE_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_NOTE, AgsNoteClass))

AGS_NOTE_GET_CLASS()

#define AGS_NOTE_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_NOTE, AgsNoteClass))

ags_note_get_type ()

GType
ags_note_get_type ();

Types and Values

enum AgsNoteFlags

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

Members

AGS_NOTE_CONNECTED

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

 

AGS_NOTE_GUI

gui format

 

AGS_NOTE_RUNTIME

runtime format

 

AGS_NOTE_HUMAN_READABLE

human readable format

 

AGS_NOTE_DEFAULT_LENGTH

default length

 

AGS_NOTE_IS_SELECTED

is selected

 

AGS_NOTE_FEED

feed note

 

AGS_NOTE_ENVELOPE

do envelope

 

AGS_TYPE_NOTE

#define AGS_TYPE_NOTE                (ags_note_get_type())

struct AgsNote

struct AgsNote;

struct AgsNoteClass

struct AgsNoteClass {
  GObjectClass object;
};

Property Details

The “attack” property

  “attack”                   AgsComplex *

Envelope attack.

Flags: Read / Write

Since: 1.0.0


The “decay” property

  “decay”                    AgsComplex *

Envelope decay.

Flags: Read / Write

Since: 1.0.0


The “note-name” property

  “note-name”                gchar *

The note's name.

Flags: Read / Write

Default value: NULL

Since: 1.0.0


The “ratio” property

  “ratio”                    AgsComplex *

Envelope ratio.

Flags: Read / Write

Since: 1.0.0


The “release” property

  “release”                  AgsComplex *

Envelope release.

Flags: Read / Write

Since: 1.0.0


The “stream-attack” property

  “stream-attack”            guint

The stream's attack.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “stream-delay” property

  “stream-delay”             gdouble

The stream's delay.

Flags: Read / Write

Allowed values: [0,65535]

Default value: 0

Since: 1.0.0


The “sustain” property

  “sustain”                  AgsComplex *

Envelope sustain.

Flags: Read / Write

Since: 1.0.0


The “x0” property

  “x0”                       guint

Note offset x0.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “x1” property

  “x1”                       guint

Note offset x1.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “y” property

  “y”                        guint

Note offset y.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0