## AgsFxLv2Audio

AgsFxLv2Audio — fx lv2 audio

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_FX_LV2_AUDIO_SCOPE_DATA()
#define | AGS_FX_LV2_AUDIO_SCOPE_DATA_GET_STRCT_MUTEX()
#define | AGS_FX_LV2_AUDIO_CHANNEL_DATA()
#define | AGS_FX_LV2_AUDIO_CHANNEL_DATA_GET_STRCT_MUTEX()
#define | AGS_FX_LV2_AUDIO_INPUT_DATA()
#define | AGS_FX_LV2_AUDIO_INPUT_DATA_GET_STRCT_MUTEX()
AgsFxLv2AudioScopeData * | ags_fx_lv2_audio_scope_data_alloc ()
void | ags_fx_lv2_audio_scope_data_free ()
AgsFxLv2AudioChannelData * | ags_fx_lv2_audio_channel_data_alloc ()
void | ags_fx_lv2_audio_channel_data_free ()
AgsFxLv2AudioInputData * | ags_fx_lv2_audio_input_data_alloc ()
void | ags_fx_lv2_audio_input_data_free ()
gboolean | ags_fx_lv2_audio_test_flags ()
void | ags_fx_lv2_audio_set_flags ()
void | ags_fx_lv2_audio_unset_flags ()
void | ags_fx_lv2_audio_forge_midi_message ()
LV2_Atom_Forge_Ref | ags_lv2_midiin_atom_sink ()
LV2_Atom * | ags_lv2_midiin_atom_sink_deref ()
void | ags_fx_lv2_audio_load_plugin ()
void | ags_fx_lv2_audio_load_port ()
void | ags_fx_lv2_audio_change_program ()
AgsFxLv2Audio * | ags_fx_lv2_audio_new ()

## Types and Values

#define | AGS_FX_LV2_AUDIO_DEFAULT_MIDI_LENGHT
enum | AgsFxLv2AudioFlags
struct | AgsFxLv2AudioScopeData
struct | AgsFxLv2AudioChannelData
struct | AgsFxLv2AudioInputData
const uint32_t | offset

## Object Hierarchy

        GObject
        ╰── AgsRecall
            ╰── AgsRecallAudio
                ╰── AgsFxNotationAudio
                    ╰── AgsFxLv2Audio

## Includes

    #include <ags/audio/fx/ags_fx_lv2_audio.h>

## Description

The AgsFxLv2Audio class provides ports to the effect processor.

## Functions

### AGS_FX_LV2_AUDIO_SCOPE_DATA()

    #define AGS_FX_LV2_AUDIO_SCOPE_DATA(ptr) ((AgsFxLv2AudioScopeData *) (ptr))

### AGS_FX_LV2_AUDIO_SCOPE_DATA_GET_STRCT_MUTEX()

    #define AGS_FX_LV2_AUDIO_SCOPE_DATA_GET_STRCT_MUTEX(ptr) (&(((AgsFxLv2AudioScopeData *)(ptr))->strct_mutex))

### AGS_FX_LV2_AUDIO_CHANNEL_DATA()

    #define AGS_FX_LV2_AUDIO_CHANNEL_DATA(ptr) ((AgsFxLv2AudioChannelData *) (ptr))

### AGS_FX_LV2_AUDIO_CHANNEL_DATA_GET_STRCT_MUTEX()

    #define AGS_FX_LV2_AUDIO_CHANNEL_DATA_GET_STRCT_MUTEX(ptr) (&(((AgsFxLv2AudioChannelData *)(ptr))->strct_mutex))

### AGS_FX_LV2_AUDIO_INPUT_DATA()

    #define AGS_FX_LV2_AUDIO_INPUT_DATA(ptr) ((AgsFxLv2AudioInputData *) (ptr))

### AGS_FX_LV2_AUDIO_INPUT_DATA_GET_STRCT_MUTEX()

    #define AGS_FX_LV2_AUDIO_INPUT_DATA_GET_STRCT_MUTEX(ptr) (&(((AgsFxLv2AudioInputData *)(ptr))->strct_mutex))

### ags_fx_lv2_audio_scope_data_alloc ()

    AgsFxLv2AudioScopeData *
    ags_fx_lv2_audio_scope_data_alloc ();

Allocate AgsFxLv2AudioScopeData

#### Returns

the new AgsFxLv2AudioScopeData

Since: 3.3.0

### ags_fx_lv2_audio_scope_data_free ()

    void
    ags_fx_lv2_audio_scope_data_free (AgsFxLv2AudioScopeData *scope_data);

Free `scope_data` .

#### Parameters

scope_data | the AgsFxLv2AudioScopeData |

Since: 3.3.0

### ags_fx_lv2_audio_channel_data_alloc ()

    AgsFxLv2AudioChannelData *
    ags_fx_lv2_audio_channel_data_alloc ();

Allocate AgsFxLv2AudioChannelData

#### Returns

the new AgsFxLv2AudioChannelData

Since: 3.3.0

### ags_fx_lv2_audio_channel_data_free ()

    void
    ags_fx_lv2_audio_channel_data_free (AgsFxLv2AudioChannelData *channel_data);

Free `channel_data` .

#### Parameters

channel_data | the AgsFxLv2AudioChannelData |

Since: 3.3.0

### ags_fx_lv2_audio_input_data_alloc ()

    AgsFxLv2AudioInputData *
    ags_fx_lv2_audio_input_data_alloc ();

Allocate AgsFxLv2AudioInputData

#### Returns

the new AgsFxLv2AudioInputData

Since: 3.3.0

### ags_fx_lv2_audio_input_data_free ()

    void
    ags_fx_lv2_audio_input_data_free (AgsFxLv2AudioInputData *input_data);

Free `input_data` .

#### Parameters

input_data | the AgsFxLv2AudioInputData |

Since: 3.3.0

### ags_fx_lv2_audio_test_flags ()

    gboolean
    ags_fx_lv2_audio_test_flags (AgsFxLv2Audio *fx_lv2_audio,
                                 AgsFxLv2AudioFlags flags);

Test `flags` of `fx_lv2_audio` .

#### Parameters

fx_lv2_audio | the AgsFxLv2Audio |
flags | the flags |

#### Returns

`TRUE` on success, otherwise `FALSE`

Since: 3.3.0

### ags_fx_lv2_audio_set_flags ()

    void
    ags_fx_lv2_audio_set_flags (AgsFxLv2Audio *fx_lv2_audio,
                                AgsFxLv2AudioFlags flags);

Set `flags` of `fx_lv2_audio` .

#### Parameters

fx_lv2_audio | the AgsFxLv2Audio |
flags | the flags |

Since: 3.3.0

### ags_fx_lv2_audio_unset_flags ()

    void
    ags_fx_lv2_audio_unset_flags (AgsFxLv2Audio *fx_lv2_audio,
                                  AgsFxLv2AudioFlags flags);

Unset `flags` of `fx_lv2_audio` .

#### Parameters

fx_lv2_audio | the AgsFxLv2Audio |
flags | the flags |

Since: 3.3.0

### ags_fx_lv2_audio_forge_midi_message ()

    void
    ags_fx_lv2_audio_forge_midi_message (AgsFxLv2Audio *fx_lv2_audio,
                                         AgsFxLv2AudioChannelData *channel_data,
                                         uint32_t offset,
                                         const uint8_t * const midi_buffer,
                                         uint32_t midi_buffer_size);

Forge midi message `channel_data` .

#### Parameters

fx_lv2_audio | the AgsFxLv2Audio |
channel_data | the AgsFxLv2AudioChannelData |
offset | the offset |
midi_buffer | the MIDI buffer |
midi_buffer_size | the MIDI buffer size |

Since: 7.4.8

### ags_lv2_midiin_atom_sink ()

    LV2_Atom_Forge_Ref
    ags_lv2_midiin_atom_sink (LV2_Atom_Forge_Sink_Handle handle,
                              const void *buf);

### ags_lv2_midiin_atom_sink_deref ()

    LV2_Atom *
    ags_lv2_midiin_atom_sink_deref (LV2_Atom_Forge_Sink_Handle handle);

### ags_fx_lv2_audio_load_plugin ()

    void
    ags_fx_lv2_audio_load_plugin (AgsFxLv2Audio *fx_lv2_audio);

Load plugin of `fx_lv2_audio` .

#### Parameters

fx_lv2_audio | the AgsFxLv2Audio |

Since: 3.3.0

### ags_fx_lv2_audio_load_port ()

    void
    ags_fx_lv2_audio_load_port (AgsFxLv2Audio *fx_lv2_audio);

Load port of `fx_lv2_audio` .

#### Parameters

fx_lv2_audio | the AgsFxLv2Audio |

Since: 3.3.0

### ags_fx_lv2_audio_change_program ()

    void
    ags_fx_lv2_audio_change_program (AgsFxLv2Audio *fx_lv2_audio,
                                     guint bank_index,
                                     guint program_index);

Change program of `fx_lv2_audio` .

#### Parameters

fx_lv2_audio | the AgsFxLv2Audio |
bank_index | the bank index |
program_index | the program index |

Since: 3.3.0

### ags_fx_lv2_audio_new ()

    AgsFxLv2Audio *
    ags_fx_lv2_audio_new (AgsAudio *audio);

Create a new instance of AgsFxLv2Audio

#### Parameters

audio | the AgsAudio |

#### Returns

the new AgsFxLv2Audio

Since: 3.3.0

## Types and Values

### AGS_FX_LV2_AUDIO_DEFAULT_MIDI_LENGHT

    #define AGS_FX_LV2_AUDIO_DEFAULT_MIDI_LENGHT (4096)

### enum AgsFxLv2AudioFlags

#### Members

AGS_FX_LV2_AUDIO_LIVE_INSTRUMENT |  |

### struct AgsFxLv2AudioScopeData

    struct AgsFxLv2AudioScopeData {
      GRecMutex strct_mutex;

      gpointer parent;

      guint audio_channels;

      AgsFxLv2AudioChannelData **channel_data;
    };

### struct AgsFxLv2AudioChannelData

    struct AgsFxLv2AudioChannelData {
      GRecMutex strct_mutex;

      gpointer parent;

      guint event_count;

      float *output;
      guint output_size;

      float *input;
      guint input_size;

      gpointer midiin_event_port;
      gpointer midiout_event_port;

      LV2_Atom_Forge forge;
      LV2_Atom_Forge_Frame frame;

      uint8_t *forge_buffer;
      uint32_t forge_buffer_size;

      LV2_URID_Map *urid_map;

      LV2_URID atom_Blank;
      LV2_URID atom_Object;
      LV2_URID atom_Sequence;
      LV2_URID midi_MidiEvent;

      LV2_URID atom_Float;
      LV2_URID atom_Int;
      LV2_URID atom_Long;
      LV2_URID time_Position;
      LV2_URID time_bar;
      LV2_URID time_barBeat;
      LV2_URID time_beatUnit;
      LV2_URID time_beatsPerBar;
      LV2_URID time_beatsPerMinute;
      LV2_URID time_speed;

      uint8_t *midiin_atom_port;
      uint32_t midiin_atom_port_size;

      uint8_t *midiout_atom_port;
      uint32_t midiout_atom_port_size;

      LV2_Handle *lv2_handle;

      AgsFxLv2AudioInputData* input_data[AGS_SEQUENCER_MAX_MIDI_KEYS];
    };

### struct AgsFxLv2AudioInputData

    struct AgsFxLv2AudioInputData {
      GRecMutex strct_mutex;

      gpointer parent;

      float *output;
      guint output_size;

      float *input;
      guint input_size;

      gpointer midiin_event_port;
      gpointer midiout_event_port;

      gpointer midiin_atom_port;
      gpointer midiout_atom_port;

      LV2_Handle *lv2_handle;

      snd_seq_event_t *event_buffer;
      guint key_on;
    };

### offset

      const uint32_t offset = lv2_atom_total_size(atom);