AgsNotation

AgsNotation — Notation class supporting selection and clipboard.

Functions

Properties

AgsAudio * audio Read / Write
guint audio-channel Read / Write
gpointer current-notes Read / Write
gpointer next-notes Read / Write
AgsNote * note Read / Write
AgsPort * port Read / Write
AgsTimestamp * timestamp Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── AgsNotation

Implemented Interfaces

AgsNotation implements AgsConnectable, AgsTactable and AgsPortlet.

Includes

#include <ags/audio/ags_notation.h>

Description

AgsNotation acts as a container of AgsNote.

Functions

ags_notation_find_near_timestamp ()

GList *
ags_notation_find_near_timestamp (GList *notation,
                                  guint audio_channel,
                                  GObject *timestamp);

Retrieve appropriate notation for timestamp.

Parameters

notation

a GList containing AgsNotation

 

audio_channel

the matching audio channel

 

timestamp

the matching timestamp

 

Returns

Next match.

Since: 1.0.0


ags_notation_add_note ()

void
ags_notation_add_note (AgsNotation *notation,
                       AgsNote *note,
                       gboolean use_selection_list);

Adds a note to notation.

Parameters

notation

an AgsNotation

 

note

the AgsNote to add

 

use_selection_list

if TRUE add to selection, else to default notation

 

Since: 1.0.0


ags_notation_remove_note ()

void
ags_notation_remove_note (AgsNotation *notation,
                          AgsNote *note,
                          gboolean use_selection_list);

Removes a note from notation.

Parameters

notation

an AgsNotation

 

note

the AgsNote to remove

 

use_selection_list

if TRUE remove from selection, else from default notation

 

Since: 1.0.0


ags_notation_remove_note_at_position ()

gboolean
ags_notation_remove_note_at_position (AgsNotation *notation,
                                      guint x,
                                      guint y);

Removes one AgsNote of notation.

Parameters

notation

an AgsNotation

 

x

offset

 

y

note

 

Returns

TRUE if successfully removed note.

Since: 1.0.0


ags_notation_get_selection ()

GList *
ags_notation_get_selection (AgsNotation *notation);

Retrieve selection.

Parameters

notation

the AgsNotation

 

Returns

the selection.

Since: 1.0.0


ags_notation_is_note_selected ()

gboolean
ags_notation_is_note_selected (AgsNotation *notation,
                               AgsNote *note);

Check selection for note.

Parameters

notation

the AgsNotation

 

note

the AgsNote to check for

 

Returns

TRUE if selected

Since: 1.0.0


ags_notation_find_point ()

AgsNote *
ags_notation_find_point (AgsNotation *notation,
                         guint x,
                         guint y,
                         gboolean use_selection_list);

Find note by offset and tone.

Parameters

notation

an AgsNotation

 

x

offset

 

y

note

 

use_selection_list

if TRUE selection is searched

 

Returns

the matching note.

Since: 1.0.0


ags_notation_find_region ()

GList *
ags_notation_find_region (AgsNotation *notation,
                          guint x0,
                          guint y0,
                          guint x1,
                          guint y1,
                          gboolean use_selection_list);

Find notes by offset and tone region.

Parameters

notation

an AgsNotation

 

x0

start offset

 

y0

start tone

 

x1

end offset

 

y1

end tone

 

use_selection_list

if TRUE selection is searched

 

Returns

the matching notes as GList.

Since: 1.0.0


ags_notation_free_selection ()

void
ags_notation_free_selection (AgsNotation *notation);

Clear selection.

Parameters

notation

an AgsNotation

 

Since: 1.0.0


ags_notation_add_all_to_selection ()

void
ags_notation_add_all_to_selection (AgsNotation *notation);

Select all.

Parameters

notation

an AgsNotation

 

Since: 1.0.0


ags_notation_add_point_to_selection ()

void
ags_notation_add_point_to_selection (AgsNotation *notation,
                                     guint x,
                                     guint y,
                                     gboolean replace_current_selection);

Select notes at position.

Parameters

notation

an AgsNotation

 

x

offset

 

y

tone

 

replace_current_selection

if TRUE selection is replaced

 

Since: 1.0.0


ags_notation_remove_point_from_selection ()

void
ags_notation_remove_point_from_selection
                               (AgsNotation *notation,
                                guint x,
                                guint y);

Remove notes at position of selection.

Parameters

notation

an AgsNotation

 

x

offset

 

y

tone

 

Since: 1.0.0


ags_notation_add_region_to_selection ()

void
ags_notation_add_region_to_selection (AgsNotation *notation,
                                      guint x0,
                                      guint y0,
                                      guint x1,
                                      guint y1,
                                      gboolean replace_current_selection);

Select notes within region.

Parameters

notation

an AgsNotation

 

x0

start offset

 

y0

start tone

 

x1

end offset

 

y1

end tone

 

replace_current_selection

if TRUE selection is replaced

 

Since: 1.0.0


ags_notation_remove_region_from_selection ()

void
ags_notation_remove_region_from_selection
                               (AgsNotation *notation,
                                guint x0,
                                guint y0,
                                guint x1,
                                guint y1);

Remove notes within region of selection.

Parameters

notation

an AgsNotation

 

x0

start offset

 

y0

start tone

 

x1

end offset

 

y1

end tone

 

Since: 1.0.0


ags_notation_copy_selection ()

xmlNodePtr
ags_notation_copy_selection (AgsNotation *notation);

Copy selection to clipboard.

Parameters

notation

an AgsNotation

 

Returns

the selection as XML.

Since: 1.0.0


ags_notation_cut_selection ()

xmlNodePtr
ags_notation_cut_selection (AgsNotation *notation);

Cut selection to clipboard.

Parameters

notation

an AgsNotation

 

Returns

the selection as XML.

Since: 1.0.0


ags_notation_insert_from_clipboard ()

void
ags_notation_insert_from_clipboard (AgsNotation *notation,
                                    xmlNodePtr notation_node,
                                    gboolean reset_x_offset,
                                    guint x_offset,
                                    gboolean reset_y_offset,
                                    guint y_offset);

Paste previously copied notes.

Parameters

notation

an AgsNotation

 

notation_node

the clipboard XML data

 

reset_x_offset

if TRUE x_offset used as cursor

 

x_offset

region start cursor offset

 

reset_y_offset

if TRUE y_offset used as cursor

 

y_offset

region start cursor tone

 

Since: 1.0.0


ags_notation_get_current ()

GList *
ags_notation_get_current (AgsNotation *notation);

ags_notation_to_raw_midi ()

unsigned char *
ags_notation_to_raw_midi (AgsNotation *notation,
                          gdouble bpm,
                          gdouble delay_factor,
                          glong nn,
                          glong dd,
                          glong cc,
                          glong bb,
                          glong tempo,
                          guint *buffer_length);

Convert notation to raw-midi.

Parameters

notation

the AgsNotation

 

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_notation_from_raw_midi ()

AgsNotation *
ags_notation_from_raw_midi (unsigned char *raw_midi,
                            glong nn,
                            glong dd,
                            glong cc,
                            glong bb,
                            glong tempo,
                            gdouble bpm,
                            gdouble delay_factor,
                            guint buffer_length);

Parse raw_midi data and convert to AgsNotation.

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

 

buffer_length

the buffer length

 

Returns

the AgsNotation

Since: 1.0.0


ags_notation_new ()

AgsNotation *
ags_notation_new (GObject *audio,
                  guint audio_channel);

Creates a AgsNotation, assigned to audio_channel .

Parameters

audio

the assigned AgsAudio

 

audio_channel

the audio channel to be used

 

Returns

a new AgsNotation

Since: 1.0.0


AGS_IS_NOTATION()

#define AGS_IS_NOTATION(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_NOTATION))

AGS_NOTATION()

#define AGS_NOTATION(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_NOTATION, AgsNotation))

AGS_NOTATION_CLASS()

#define AGS_NOTATION_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_NOTATION, AgsNotationClass))

AGS_NOTATION_GET_CLASS()

#define AGS_NOTATION_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_NOTATION, AgsNotationClass))

ags_notation_get_type ()

GType
ags_notation_get_type ();

Types and Values

AGS_NOTATION_DEFAULT_BPM

#define AGS_NOTATION_DEFAULT_BPM (120.0)

AGS_NOTATION_TICS_PER_BEAT

#define AGS_NOTATION_TICS_PER_BEAT (1.0)

AGS_NOTATION_MINIMUM_NOTE_LENGTH

#define AGS_NOTATION_MINIMUM_NOTE_LENGTH (1.0 / 16.0)

AGS_NOTATION_MAXIMUM_NOTE_LENGTH

#define AGS_NOTATION_MAXIMUM_NOTE_LENGTH (16.0)

AGS_NOTATION_DEFAULT_LENGTH

#define AGS_NOTATION_DEFAULT_LENGTH (65535.0 / AGS_NOTATION_TICS_PER_BEAT - AGS_NOTATION_MAXIMUM_NOTE_LENGTH)

AGS_NOTATION_DEFAULT_JIFFIE

#define AGS_NOTATION_DEFAULT_JIFFIE (60.0 / AGS_NOTATION_DEFAULT_BPM / AGS_NOTATION_TICS_PER_BEAT)

AGS_NOTATION_DEFAULT_DURATION

#define AGS_NOTATION_DEFAULT_DURATION (AGS_NOTATION_DEFAULT_LENGTH * AGS_NOTATION_DEFAULT_JIFFIE * AGS_MICROSECONDS_PER_SECOND)

AGS_NOTATION_CLIPBOARD_VERSION

#define AGS_NOTATION_CLIPBOARD_VERSION "0.4.2\0"

AGS_NOTATION_CLIPBOARD_TYPE

#define AGS_NOTATION_CLIPBOARD_TYPE "AgsNotationClipboardXml\0"

AGS_NOTATION_CLIPBOARD_FORMAT

#define AGS_NOTATION_CLIPBOARD_FORMAT "AgsNotationNativePiano\0"

enum AgsNotationFlags

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

Members

AGS_NOTATION_CONNECTED

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

 

AGS_NOTATION_STICKY

sticky

 

AGS_NOTATION_PATTERN_MODE

pattern mode

 

AGS_TYPE_NOTATION

#define AGS_TYPE_NOTATION                (ags_notation_get_type())

struct AgsNotation

struct AgsNotation;

struct AgsNotationClass

struct AgsNotationClass {
  GObjectClass object;
};

Property Details

The “audio” property

  “audio”                    AgsAudio *

The assigned AgsAudio

Flags: Read / Write

Since: 1.0.0


The “audio-channel” property

  “audio-channel”            guint

The effect's audio-channel.

Flags: Read / Write

Allowed values: <= 65535

Default value: 0

Since: 1.0.0


The “current-notes” property

  “current-notes”            gpointer

Offset of current position.

Flags: Read / Write

Since: 1.0.0


The “next-notes” property

  “next-notes”               gpointer

Offset of next position.

Flags: Read / Write

Since: 1.0.0


The “note” property

  “note”                     AgsNote *

The assigned AgsNote

Flags: Read / Write

Since: 1.0.0


The “port” property

  “port”                     AgsPort *

The assigned AgsPort

Flags: Read / Write

Since: 1.0.0


The “timestamp” property

  “timestamp”                AgsTimestamp *

The timestamp of pattern.

Flags: Read / Write