AgsMidiUtil

AgsMidiUtil — MIDI util

Functions

Includes

#include <ags/audio/midi/ags_midi_util.h>

Description

Utility functions for MIDI.

Functions

ags_midi_util_is_key_on ()

gboolean
ags_midi_util_is_key_on (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_key_off ()

gboolean
ags_midi_util_is_key_off (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_key_pressure ()

gboolean
ags_midi_util_is_key_pressure (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_change_parameter ()

gboolean
ags_midi_util_is_change_parameter (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_pitch_bend ()

gboolean
ags_midi_util_is_pitch_bend (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_change_program ()

gboolean
ags_midi_util_is_change_program (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_change_pressure ()

gboolean
ags_midi_util_is_change_pressure (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_sysex ()

gboolean
ags_midi_util_is_sysex (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_quarter_frame ()

gboolean
ags_midi_util_is_quarter_frame (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_song_position ()

gboolean
ags_midi_util_is_song_position (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_song_select ()

gboolean
ags_midi_util_is_song_select (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_tune_request ()

gboolean
ags_midi_util_is_tune_request (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_is_meta_event ()

gboolean
ags_midi_util_is_meta_event (unsigned char *buffer);

Parameters

buffer

the midi buffer

 

Returns

TRUE on success, otherwise FALSE

Since: 1.0.0


ags_midi_util_to_smf ()

unsigned char *
ags_midi_util_to_smf (unsigned char *midi_buffer,
                      guint buffer_length,
                      glong delta_time,
                      guint *smf_buffer_length);

Convert real-time MIDI to SMF.

Parameters

midi_buffer

the midi buffer

 

buffer_length

the buffer length

 

delta_time

the delta time

 

smf_buffer_length

the return location of resulting length

 

Returns

the SMF buffer

Since: 1.0.0


ags_midi_util_envelope_to_velocity ()

glong
ags_midi_util_envelope_to_velocity (AgsComplex *attack,
                                    AgsComplex *decay,
                                    AgsComplex *sustain,
                                    AgsComplex *release,
                                    AgsComplex *ratio,
                                    guint samplerate,
                                    guint start_frame,
                                    guint end_frame);

Envelope to velocity.

Parameters

attack

attack

 

decay

decay

 

sustain

sustain

 

release

release

 

ratio

ratio

 

samplerate

samplerate

 

start_frame

start frame

 

end_frame

end frame

 

Returns

the velocity

Since: 1.0.0


ags_midi_util_velocity_to_envelope ()

void
ags_midi_util_velocity_to_envelope (glong delta_time,
                                    gboolean is_release,
                                    AgsComplex **attack,
                                    AgsComplex **decay,
                                    AgsComplex **sustain,
                                    AgsComplex **release,
                                    AgsComplex **ratio,
                                    guint *samplerate,
                                    guint *start_frame,
                                    guint *end_frame);

Velocity to envelope.

Parameters

delta_time

delta time

 

is_release

is release

 

attack

attack

 

decay

decay

 

sustain

sustain

 

release

release

 

ratio

ratio

 

samplerate

samplerate

 

start_frame

start frame

 

end_frame

end frame

 

Since: 1.0.0


ags_midi_util_envelope_to_pressure ()

glong
ags_midi_util_envelope_to_pressure (AgsComplex *attack,
                                    AgsComplex *decay,
                                    AgsComplex *sustain,
                                    AgsComplex *release,
                                    AgsComplex *ratio,
                                    guint samplerate,
                                    guint start_frame,
                                    guint end_frame);

Envelope to pressure.

Parameters

attack

attack

 

decay

decay

 

sustain

sustain

 

release

release

 

ratio

ratio

 

samplerate

samplerate

 

start_frame

start frame

 

end_frame

end frame

 

Returns

the pressure

Since: 1.0.0


ags_midi_util_pressure_to_envelope ()

void
ags_midi_util_pressure_to_envelope (glong delta_time,
                                    gboolean is_sustain,
                                    AgsComplex **attack,
                                    AgsComplex **decay,
                                    AgsComplex **sustain,
                                    AgsComplex **release,
                                    AgsComplex **ratio,
                                    guint *samplerate,
                                    guint *start_frame,
                                    guint *end_frame);

Pressure to envelope.

Parameters

delta_time

delta time

 

is_sustain

is sustain

 

attack

attack

 

decay

decay

 

sustain

sustain

 

release

release

 

ratio

ratio

 

samplerate

samplerate

 

start_frame

start frame

 

end_frame

end frame

 

Since: 1.0.0


ags_midi_util_delta_time_to_offset ()

guint
ags_midi_util_delta_time_to_offset (glong division,
                                    glong tempo,
                                    glong bpm,
                                    glong delta_time);

Delta time to offset

Parameters

division

division

 

tempo

tempo

 

bpm

bpm

 

delta_time

delta time

 

Returns

the offset

Since: 1.0.0


ags_midi_util_offset_to_delta_time ()

glong
ags_midi_util_offset_to_delta_time (glong division,
                                    glong tempo,
                                    glong bpm,
                                    guint x);

Offset to delta time

Parameters

division

division

 

tempo

tempo

 

bpm

bpm

 

x

note offset

 

Returns

the delta time

Since: 1.0.0

Types and Values