## AgsMidiSmfUtil

AgsMidiSmfUtil — MIDI SMF buffer util

## Stability Level

Stable, unless otherwise indicated

## Functions

AgsMidiSmfUtil * | ags_midi_smf_util_alloc ()
void | ags_midi_smf_util_free ()
AgsMidiSmfUtil * | ags_midi_smf_util_copy ()
guint | ags_midi_smf_util_get_varlength_size ()
void | ags_midi_smf_util_put_varlength ()
guint | ags_midi_smf_util_get_varlength ()
void | ags_midi_smf_util_put_int16 ()
void | ags_midi_smf_util_get_int16 ()
void | ags_midi_smf_util_put_int24 ()
void | ags_midi_smf_util_get_int24 ()
void | ags_midi_smf_util_put_int32 ()
void | ags_midi_smf_util_get_int32 ()
void | ags_midi_smf_util_put_header ()
guint | ags_midi_smf_util_get_header ()
void | ags_midi_smf_util_put_track ()
guint | ags_midi_smf_util_get_track ()
void | ags_midi_smf_util_put_key_on ()
guint | ags_midi_smf_util_get_key_on ()
void | ags_midi_smf_util_put_key_off ()
guint | ags_midi_smf_util_get_key_off ()
void | ags_midi_smf_util_put_key_pressure ()
guint | ags_midi_smf_util_get_key_pressure ()
void | ags_midi_smf_util_put_change_parameter ()
guint | ags_midi_smf_util_get_change_parameter ()
void | ags_midi_smf_util_put_pitch_bend ()
guint | ags_midi_smf_util_get_pitch_bend ()
void | ags_midi_smf_util_put_change_program ()
guint | ags_midi_smf_util_get_change_program ()
void | ags_midi_smf_util_put_change_pressure ()
guint | ags_midi_smf_util_get_change_pressure ()
void | ags_midi_smf_util_put_sysex ()
guint | ags_midi_smf_util_get_sysex ()
void | ags_midi_smf_util_put_quarter_frame ()
guint | ags_midi_smf_util_get_quarter_frame ()
void | ags_midi_smf_util_put_song_position ()
guint | ags_midi_smf_util_get_song_position ()
void | ags_midi_smf_util_put_song_select ()
guint | ags_midi_smf_util_get_song_select ()
void | ags_midi_smf_util_put_tune_request ()
guint | ags_midi_smf_util_get_tune_request ()
void | ags_midi_smf_util_put_sequence_number ()
guint | ags_midi_smf_util_get_sequence_number ()
void | ags_midi_smf_util_put_smtpe ()
guint | ags_midi_smf_util_get_smtpe ()
void | ags_midi_smf_util_put_tempo ()
guint | ags_midi_smf_util_get_tempo ()
void | ags_midi_smf_util_put_time_signature ()
guint | ags_midi_smf_util_get_time_signature ()
void | ags_midi_smf_util_put_key_signature ()
guint | ags_midi_smf_util_get_key_signature ()
void | ags_midi_smf_util_put_sequencer_meta_event ()
guint | ags_midi_smf_util_get_sequencer_meta_event ()
void | ags_midi_smf_util_put_text_event ()
guint | ags_midi_smf_util_get_text_event ()
guint | ags_midi_smf_util_get_undefined ()
void | ags_midi_smf_util_put_midi_channel_prefix ()
guint | ags_midi_smf_util_get_midi_channel_prefix ()
void | ags_midi_smf_util_put_end_of_track ()
guint | ags_midi_smf_util_get_end_of_track ()
guchar * | ags_midi_smf_util_seek_message ()
guint | ags_midi_smf_util_decode ()

## Types and Values

enum | AgsMidiSmfUtilMtcQuarterFrameMessageType
enum | AgsMidiSmfUtilSmtpeFrameRate

## Object Hierarchy

        GBoxed
        ╰── AgsMidiSmfUtil

## Includes

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

## Description

Utility functions for MIDI SMF buffers.

## Functions

### ags_midi_smf_util_alloc ()

    AgsMidiSmfUtil *
    ags_midi_smf_util_alloc ();

Allocate MIDI util.

#### Returns

the newly allocated AgsMidiSmfUtil.

[transfer full]

Since: 6.0.0

### ags_midi_smf_util_free ()

    void
    ags_midi_smf_util_free (AgsMidiSmfUtil *midi_smf_util);

Free MIDI util.

#### Parameters

midi_smf_util | the MIDI util |

Since: 6.0.0

### ags_midi_smf_util_copy ()

    AgsMidiSmfUtil *
    ags_midi_smf_util_copy (AgsMidiSmfUtil *midi_smf_util);

Copy MIDI util.

#### Parameters

midi_smf_util | the MIDI util |

#### Returns

the newly allocated AgsMidiSmfUtil.

[transfer full]

Since: 6.0.0

### ags_midi_smf_util_get_varlength_size ()

    guint
    ags_midi_smf_util_get_varlength_size (AgsMidiSmfUtil *midi_smf_util,
                                          gint varlength);

Retrieve the size needed to store the variable length.

#### Parameters

midi_smf_util | the MIDI util |
varlength | the variable length |

#### Returns

the size needed to be allocated

Since: 6.0.0

### ags_midi_smf_util_put_varlength ()

    void
    ags_midi_smf_util_put_varlength (AgsMidiSmfUtil *midi_smf_util,
                                     guchar *buffer,
                                     gint varlength);

Put the variable lenght value to `buffer` .

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
varlength | the value to put |

Since: 6.0.0

### ags_midi_smf_util_get_varlength ()

    guint
    ags_midi_smf_util_get_varlength (AgsMidiSmfUtil *midi_smf_util,
                                     guchar *buffer,
                                     gint *varlength);

Get the variable lenght value from `buffer` .

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
varlength | the return location |

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_int16 ()

    void
    ags_midi_smf_util_put_int16 (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint val);

Put signed 16 bit integer.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
val | the integer |

Since: 6.0.0

### ags_midi_smf_util_get_int16 ()

    void
    ags_midi_smf_util_get_int16 (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint *val);

Get signed 32 bit integer.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
val | return location of the integer. | [out]

Since: 6.0.0

### ags_midi_smf_util_put_int24 ()

    void
    ags_midi_smf_util_put_int24 (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint val);

Put signed 24 bit integer.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
val | the integer |

Since: 6.0.0

### ags_midi_smf_util_get_int24 ()

    void
    ags_midi_smf_util_get_int24 (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint *val);

Get signed 24 bit integer.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
val | return location of the integer. | [out]

Since: 6.0.0

### ags_midi_smf_util_put_int32 ()

    void
    ags_midi_smf_util_put_int32 (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint val);

Put signed 32 bit integer.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
val | the integer |

Since: 6.0.0

### ags_midi_smf_util_get_int32 ()

    void
    ags_midi_smf_util_get_int32 (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint *val);

Get signed 32 bit integer.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
val | return location of the integer. | [out]

Since: 6.0.0

### ags_midi_smf_util_put_header ()

    void
    ags_midi_smf_util_put_header (AgsMidiSmfUtil *midi_smf_util,
                                  guchar *buffer,
                                  gint chunk_length,
                                  gint format,
                                  gint track_count,
                                  gint division);

Puts the midi header.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
chunk_length | header chunk length |
format | either 0, 1 or 2. |
track_count | the number of tracks |
division | timing division |

Since: 6.0.0

### ags_midi_smf_util_get_header ()

    guint
    ags_midi_smf_util_get_header (AgsMidiSmfUtil *midi_smf_util,
                                  guchar *buffer,
                                  gint *chunk_length,
                                  gint *format,
                                  gint *track_count,
                                  gint *division);

Gets the midi header

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
chunk_length | the return location of header chunk length. | [out]
format | the return location of format either 0, 1 or 2. | [out]
track_count | the return location of the number of tracks. | [out]
division | the return location of timing division. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_track ()

    void
    ags_midi_smf_util_put_track (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint chunk_length);

Put track.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
chunk_length | track chunk length |

Since: 6.0.0

### ags_midi_smf_util_get_track ()

    guint
    ags_midi_smf_util_get_track (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint *chunk_length);

Get track

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
chunk_length | the return location of track chunk length. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_key_on ()

    void
    ags_midi_smf_util_put_key_on (AgsMidiSmfUtil *midi_smf_util,
                                  guchar *buffer,
                                  gint delta_time,
                                  gint channel,
                                  gint key,
                                  gint velocity);

Puts the given values to `buffer` with appropriate channel message.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
channel | valid channels from 0-15 |
key | valid keys to play 0-128 |
velocity | the key dynamics |

Since: 6.0.0

### ags_midi_smf_util_get_key_on ()

    guint
    ags_midi_smf_util_get_key_on (AgsMidiSmfUtil *midi_smf_util,
                                  guchar *buffer,
                                  gint *delta_time,
                                  gint *channel,
                                  gint *key,
                                  gint *velocity);

Get the key-on message from `buffer` .

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
channel | the return location of channel. | [out]
key | the return location of key. | [out]
velocity | the return location of velocity. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_key_off ()

    void
    ags_midi_smf_util_put_key_off (AgsMidiSmfUtil *midi_smf_util,
                                   guchar *buffer,
                                   gint delta_time,
                                   gint channel,
                                   gint key,
                                   gint velocity);

Puts the given values to `buffer` with appropriate channel message.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
channel | valid channels from 0-15 |
key | valid keys to play 0-128 |
velocity | the key dynamics |

Since: 6.0.0

### ags_midi_smf_util_get_key_off ()

    guint
    ags_midi_smf_util_get_key_off (AgsMidiSmfUtil *midi_smf_util,
                                   guchar *buffer,
                                   gint *delta_time,
                                   gint *channel,
                                   gint *key,
                                   gint *velocity);

Get the key-off message from `buffer` .

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
channel | the return location of channel. | [out]
key | the return location of key. | [out]
velocity | the return location of velocity. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_key_pressure ()

    void
    ags_midi_smf_util_put_key_pressure (AgsMidiSmfUtil *midi_smf_util,
                                        guchar *buffer,
                                        gint delta_time,
                                        gint channel,
                                        gint key,
                                        gint pressure);

Puts the given values to `buffer` with appropriate channel message.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
channel | valid channels from 0-15 |
key | valid keys to play 0-128 |
pressure | the key dynamics |

Since: 6.0.0

### ags_midi_smf_util_get_key_pressure ()

    guint
    ags_midi_smf_util_get_key_pressure (AgsMidiSmfUtil *midi_smf_util,
                                        guchar *buffer,
                                        gint *delta_time,
                                        gint *channel,
                                        gint *key,
                                        gint *pressure);

Get the key-pressure message from `buffer` .

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
channel | the return location of channel. | [out]
key | the return location of key. | [out]
pressure | the return location of pressure. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_change_parameter ()

    void
    ags_midi_smf_util_put_change_parameter
                                   (AgsMidiSmfUtil *midi_smf_util,
                                    guchar *buffer,
                                    gint delta_time,
                                    gint channel,
                                    gint control,
                                    gint value);

Put change parameter.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
channel | channel |
control | the control |
value | the value |

Since: 6.0.0

### ags_midi_smf_util_get_change_parameter ()

    guint
    ags_midi_smf_util_get_change_parameter
                                   (AgsMidiSmfUtil *midi_smf_util,
                                    guchar *buffer,
                                    gint *delta_time,
                                    gint *channel,
                                    gint *control,
                                    gint *value);

Get change parameter.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
channel | the return location of channel. | [out]
control | the return location of the control. | [out]
value | the return location the value. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_pitch_bend ()

    void
    ags_midi_smf_util_put_pitch_bend (AgsMidiSmfUtil *midi_smf_util,
                                      guchar *buffer,
                                      gint delta_time,
                                      gint channel,
                                      gint transmitter);

Put pitch bend.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
channel | channel |
transmitter | the transmitter |

Since: 6.0.0

### ags_midi_smf_util_get_pitch_bend ()

    guint
    ags_midi_smf_util_get_pitch_bend (AgsMidiSmfUtil *midi_smf_util,
                                      guchar *buffer,
                                      gint *delta_time,
                                      gint *channel,
                                      gint *transmitter);

Get pitch bend.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
channel | the return location of channel. | [out]
transmitter | the return location the transmitter signed 14 bit integer. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_change_program ()

    void
    ags_midi_smf_util_put_change_program (AgsMidiSmfUtil *midi_smf_util,
                                          guchar *buffer,
                                          gint delta_time,
                                          gint channel,
                                          gint program);

Put change program.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
channel | channel |
program | the program |

Since: 6.0.0

### ags_midi_smf_util_get_change_program ()

    guint
    ags_midi_smf_util_get_change_program (AgsMidiSmfUtil *midi_smf_util,
                                          guchar *buffer,
                                          gint *delta_time,
                                          gint *channel,
                                          gint *program);

Get change program.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
channel | the return location of channel. | [out]
program | the return location of the program. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_change_pressure ()

    void
    ags_midi_smf_util_put_change_pressure (AgsMidiSmfUtil *midi_smf_util,
                                           guchar *buffer,
                                           gint delta_time,
                                           gint channel,
                                           gint pressure);

Put change pressure.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
channel | channel |
pressure | the pressure |

Since: 6.0.0

### ags_midi_smf_util_get_change_pressure ()

    guint
    ags_midi_smf_util_get_change_pressure (AgsMidiSmfUtil *midi_smf_util,
                                           guchar *buffer,
                                           gint *delta_time,
                                           gint *channel,
                                           gint *pressure);

Get change pressure.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
channel | the return location of channel. | [out]
pressure | the return location of the pressure. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_sysex ()

    void
    ags_midi_smf_util_put_sysex (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint delta_time,
                                 guchar *data,
                                 gint length);

Put sysex.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
data | the data |
length | the data's length |

Since: 6.0.0

### ags_midi_smf_util_get_sysex ()

    guint
    ags_midi_smf_util_get_sysex (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint *delta_time,
                                 guchar **data,
                                 gint *length);

Get sysex.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
data | the return location of data. | [out]
length | the return location of length. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_quarter_frame ()

    void
    ags_midi_smf_util_put_quarter_frame (AgsMidiSmfUtil *midi_smf_util,
                                         guchar *buffer,
                                         gint delta_time,
                                         gint message_type,
                                         gint values);

Put quarter frame.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
message_type | the message type |
values | the values |

Since: 6.0.0

### ags_midi_smf_util_get_quarter_frame ()

    guint
    ags_midi_smf_util_get_quarter_frame (AgsMidiSmfUtil *midi_smf_util,
                                         guchar *buffer,
                                         gint *delta_time,
                                         gint *message_type,
                                         gint *values);

Get quarter frame.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
message_type | the return location of the message type. | [out]
values | the return location of the values. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_song_position ()

    void
    ags_midi_smf_util_put_song_position (AgsMidiSmfUtil *midi_smf_util,
                                         guchar *buffer,
                                         gint delta_time,
                                         gint song_position);

Put song position.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
song_position | the song position |

Since: 6.0.0

### ags_midi_smf_util_get_song_position ()

    guint
    ags_midi_smf_util_get_song_position (AgsMidiSmfUtil *midi_smf_util,
                                         guchar *buffer,
                                         gint *delta_time,
                                         gint *song_position);

Get song position.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
song_position | the return location of the song position. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_song_select ()

    void
    ags_midi_smf_util_put_song_select (AgsMidiSmfUtil *midi_smf_util,
                                       guchar *buffer,
                                       gint delta_time,
                                       gint song_select);

Put song select.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
song_select | the song select |

Since: 6.0.0

### ags_midi_smf_util_get_song_select ()

    guint
    ags_midi_smf_util_get_song_select (AgsMidiSmfUtil *midi_smf_util,
                                       guchar *buffer,
                                       gint *delta_time,
                                       gint *song_select);

Get song select.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
song_select | the return location of the song select. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_tune_request ()

    void
    ags_midi_smf_util_put_tune_request (AgsMidiSmfUtil *midi_smf_util,
                                        guchar *buffer,
                                        gint delta_time);

Put tune request

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |

Since: 6.0.0

### ags_midi_smf_util_get_tune_request ()

    guint
    ags_midi_smf_util_get_tune_request (AgsMidiSmfUtil *midi_smf_util,
                                        guchar *buffer,
                                        gint *delta_time);

Get tune request.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_sequence_number ()

    void
    ags_midi_smf_util_put_sequence_number (AgsMidiSmfUtil *midi_smf_util,
                                           guchar *buffer,
                                           gint delta_time,
                                           gint sequence);

Put sequence number.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
sequence | the sequence |

Since: 6.0.0

### ags_midi_smf_util_get_sequence_number ()

    guint
    ags_midi_smf_util_get_sequence_number (AgsMidiSmfUtil *midi_smf_util,
                                           guchar *buffer,
                                           gint *delta_time,
                                           gint *sequence);

Get sequence number.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
sequence | the return location of the sequence. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_smtpe ()

    void
    ags_midi_smf_util_put_smtpe (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint delta_time,
                                 gint rr,
                                 gint hr,
                                 gint mn,
                                 gint se,
                                 gint fr);

Put smtpe timestamp.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
rr | frame rate |
hr | hour |
mn | minute |
se | second |
fr | frame number |

Since: 6.0.0

### ags_midi_smf_util_get_smtpe ()

    guint
    ags_midi_smf_util_get_smtpe (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint *delta_time,
                                 gint *rr,
                                 gint *hr,
                                 gint *mn,
                                 gint *se,
                                 gint *fr);

Get smtpe timestamp.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
rr | the return location of frame rate. | [out]
hr | the return location of hour. | [out]
mn | the return location of minute. | [out]
se | the return location of second. | [out]
fr | the return location of frame number. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_tempo ()

    void
    ags_midi_smf_util_put_tempo (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint delta_time,
                                 gint tempo);

Put tempo.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
tempo | the tempo |

Since: 6.0.0

### ags_midi_smf_util_get_tempo ()

    guint
    ags_midi_smf_util_get_tempo (AgsMidiSmfUtil *midi_smf_util,
                                 guchar *buffer,
                                 gint *delta_time,
                                 gint *tempo);

Get tempo.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
tempo | the tempo |

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_time_signature ()

    void
    ags_midi_smf_util_put_time_signature (AgsMidiSmfUtil *midi_smf_util,
                                          guchar *buffer,
                                          gint delta_time,
                                          gint nn,
                                          gint dd,
                                          gint cc,
                                          gint bb);

Put time signature

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
nn | numerator |
dd | denominator |
cc | clocks |
bb | beats |

Since: 6.0.0

### ags_midi_smf_util_get_time_signature ()

    guint
    ags_midi_smf_util_get_time_signature (AgsMidiSmfUtil *midi_smf_util,
                                          guchar *buffer,
                                          gint *delta_time,
                                          gint *nn,
                                          gint *dd,
                                          gint *cc,
                                          gint *bb);

Get time signature.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
nn | the return location of numerator. | [out]
dd | the return location of denominator. | [out]
cc | the return location of clocks. | [out]
bb | the return location of beats. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_key_signature ()

    void
    ags_midi_smf_util_put_key_signature (AgsMidiSmfUtil *midi_smf_util,
                                         guchar *buffer,
                                         gint delta_time,
                                         gint sf,
                                         gint mi);

Put key signature.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
sf | flats or sharps |
mi | 1 equals minor or 0 means major |

Since: 6.0.0

### ags_midi_smf_util_get_key_signature ()

    guint
    ags_midi_smf_util_get_key_signature (AgsMidiSmfUtil *midi_smf_util,
                                         guchar *buffer,
                                         gint *delta_time,
                                         gint *sf,
                                         gint *mi);

Get key signature.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
sf | the return location of flats or sharps. | [out]
mi | the return location of minor or major. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_sequencer_meta_event ()

    void
    ags_midi_smf_util_put_sequencer_meta_event
                                   (AgsMidiSmfUtil *midi_smf_util,
                                    guchar *buffer,
                                    gint delta_time,
                                    gint len,
                                    gint id,
                                    gint data);

Put sequencer meta event.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
len | the length of data |
id | the manufacturer id |
data | the data |

Since: 6.0.0

### ags_midi_smf_util_get_sequencer_meta_event ()

    guint
    ags_midi_smf_util_get_sequencer_meta_event
                                   (AgsMidiSmfUtil *midi_smf_util,
                                    guchar *buffer,
                                    gint *delta_time,
                                    gint *len,
                                    gint *id,
                                    gint *data);

Get sequencer meta event.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
len | the return location of the length of data. | [out]
id | the return location of the manufacturer id. | [out]
data | the return location of the data. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_put_text_event ()

    void
    ags_midi_smf_util_put_text_event (AgsMidiSmfUtil *midi_smf_util,
                                      guchar *buffer,
                                      gint delta_time,
                                      gchar *text,
                                      gint length);

Put text event.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
text | the text |
length | the length |

Since: 6.0.0

### ags_midi_smf_util_get_text_event ()

    guint
    ags_midi_smf_util_get_text_event (AgsMidiSmfUtil *midi_smf_util,
                                      guchar *buffer,
                                      gint *delta_time,
                                      gchar **text,
                                      gint *length);

Get text event.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
text | the return location of the text. | [out]
length | the return location of the length. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_get_undefined ()

    guint
    ags_midi_smf_util_get_undefined (AgsMidiSmfUtil *midi_smf_util,
                                     guchar *buffer,
                                     gint *delta_time);

Get undefined.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]

#### Returns

the number of bytes read.

Since: 6.16.18

### ags_midi_smf_util_put_midi_channel_prefix ()

    void
    ags_midi_smf_util_put_midi_channel_prefix
                                   (AgsMidiSmfUtil *midi_smf_util,
                                    guchar *buffer,
                                    gint delta_time,
                                    gint midi_channel);

Put MIDI channel prefix.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |
midi_channel | the MIDI channel |

Since: 6.16.18

### ags_midi_smf_util_get_midi_channel_prefix ()

    guint
    ags_midi_smf_util_get_midi_channel_prefix
                                   (AgsMidiSmfUtil *midi_smf_util,
                                    guchar *buffer,
                                    gint *delta_time,
                                    gint *midi_channel);

Get MIDI channel prefix.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]
midi_channel | the return location MIDI channel. | [out]

#### Returns

the number of bytes read.

Since: 6.16.18

### ags_midi_smf_util_put_end_of_track ()

    void
    ags_midi_smf_util_put_end_of_track (AgsMidiSmfUtil *midi_smf_util,
                                        guchar *buffer,
                                        gint delta_time);

Put end of track.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | timing information |

Since: 6.0.0

### ags_midi_smf_util_get_end_of_track ()

    guint
    ags_midi_smf_util_get_end_of_track (AgsMidiSmfUtil *midi_smf_util,
                                        guchar *buffer,
                                        gint *delta_time);

Get end of track.

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
delta_time | the return location of timing information. | [out]

#### Returns

the number of bytes read.

Since: 6.0.0

### ags_midi_smf_util_seek_message ()

    guchar *
    ags_midi_smf_util_seek_message (AgsMidiSmfUtil *midi_smf_util,
                                    guchar *buffer,
                                    guint message_count,
                                    gint *delta_time);

Seek MIDI messages from `buffer`

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the buffer to seek |
message_count | seek count messages |
delta_time | the return location of current delta time. | [out]

#### Returns

the buffer at offset at `message_count` ahead

Since: 6.0.0

### ags_midi_smf_util_decode ()

    guint
    ags_midi_smf_util_decode (AgsMidiSmfUtil *midi_smf_util,
                              guchar *buffer,
                              snd_seq_event_t *event);

Decode `event` to `buffer`

#### Parameters

midi_smf_util | the AgsMidiSmfUtil |
buffer | the MIDI buffer |
event | the ALSA sequencer event |

#### Returns

the bytes written

Since: 6.0.0

## Types and Values

### enum AgsMidiSmfUtilMtcQuarterFrameMessageType

#### Members

AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_FRAME_NUMBER_LSB |  |
AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_FRAME_NUMBER_MSB |  |
AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_SECONDS_LSB |  |
AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_SECONDS_MSB |  |
AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_MINUTES_LSB |  |
AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_MINUTES_MSB |  |
AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_HOURS_LSB |  |
AGS_MIDI_SMF_UTIL_MTC_QUARTER_FRAME_HOURS_MSB |  |

### enum AgsMidiSmfUtilSmtpeFrameRate

#### Members

AGS_MIDI_SMF_UTIL_SMTPE_FRAME_RATE_24_FPS |  |
AGS_MIDI_SMF_UTIL_SMTPE_FRAME_RATE_25_FPS |  |
AGS_MIDI_SMF_UTIL_SMTPE_FRAME_RATE_30_FPS |  |
AGS_MIDI_SMF_UTIL_SMTPE_FRAME_RATE_30_FPS_DROP_FRAME |  |