AgsSF2SynthUtil

AgsSF2SynthUtil — SF2 synth util

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── AgsSF2SynthUtil

Includes

#include <ags/audio/ags_sf2_synth_util.h>

Description

Utility functions to compute SF2 synths.

Functions

ags_sf2_synth_util_midi_locale_find_sample_near_midi_key ()

AgsIpatchSample *
ags_sf2_synth_util_midi_locale_find_sample_near_midi_key
                               (AgsIpatch *ipatch,
                                gint bank,
                                gint program,
                                gint midi_key,
                                gchar **preset,
                                gchar **instrument,
                                gchar **sample);

Find sample near MIDI key.

Parameters

ipatch

the AgsIpatch

 

bank

the bank

 

program

the program

 

midi_key

the MIDI key

 

preset

the preset.

[out]

instrument

the instrument.

[out]

sample

the sample.

[out]

Since: 3.4.0


ags_sf2_synth_util_copy_s8 ()

void
ags_sf2_synth_util_copy_s8 (gint8 *buffer,
                            guint buffer_size,
                            AgsIpatchSample *ipatch_sample,
                            gdouble note,
                            gdouble volume,
                            guint samplerate,
                            guint offset,
                            guint n_frames,
                            guint loop_mode,
                            gint loop_start,
                            gint loop_end);

ags_sf2_synth_util_copy_s8 is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy_s16 ()

void
ags_sf2_synth_util_copy_s16 (gint16 *buffer,
                             guint buffer_size,
                             AgsIpatchSample *ipatch_sample,
                             gdouble note,
                             gdouble volume,
                             guint samplerate,
                             guint offset,
                             guint n_frames,
                             guint loop_mode,
                             gint loop_start,
                             gint loop_end);

ags_sf2_synth_util_copy_s16 is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy_s24 ()

void
ags_sf2_synth_util_copy_s24 (gint32 *buffer,
                             guint buffer_size,
                             AgsIpatchSample *ipatch_sample,
                             gdouble note,
                             gdouble volume,
                             guint samplerate,
                             guint offset,
                             guint n_frames,
                             guint loop_mode,
                             gint loop_start,
                             gint loop_end);

ags_sf2_synth_util_copy_s24 is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy_s32 ()

void
ags_sf2_synth_util_copy_s32 (gint32 *buffer,
                             guint buffer_size,
                             AgsIpatchSample *ipatch_sample,
                             gdouble note,
                             gdouble volume,
                             guint samplerate,
                             guint offset,
                             guint n_frames,
                             guint loop_mode,
                             gint loop_start,
                             gint loop_end);

ags_sf2_synth_util_copy_s32 is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy_s64 ()

void
ags_sf2_synth_util_copy_s64 (gint64 *buffer,
                             guint buffer_size,
                             AgsIpatchSample *ipatch_sample,
                             gdouble note,
                             gdouble volume,
                             guint samplerate,
                             guint offset,
                             guint n_frames,
                             guint loop_mode,
                             gint loop_start,
                             gint loop_end);

ags_sf2_synth_util_copy_s64 is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy_float ()

void
ags_sf2_synth_util_copy_float (gfloat *buffer,
                               guint buffer_size,
                               AgsIpatchSample *ipatch_sample,
                               gdouble note,
                               gdouble volume,
                               guint samplerate,
                               guint offset,
                               guint n_frames,
                               guint loop_mode,
                               gint loop_start,
                               gint loop_end);

ags_sf2_synth_util_copy_float is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy_double ()

void
ags_sf2_synth_util_copy_double (gdouble *buffer,
                                guint buffer_size,
                                AgsIpatchSample *ipatch_sample,
                                gdouble note,
                                gdouble volume,
                                guint samplerate,
                                guint offset,
                                guint n_frames,
                                guint loop_mode,
                                gint loop_start,
                                gint loop_end);

ags_sf2_synth_util_copy_double is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy_complex ()

void
ags_sf2_synth_util_copy_complex (AgsComplex *buffer,
                                 guint buffer_size,
                                 AgsIpatchSample *ipatch_sample,
                                 gdouble note,
                                 gdouble volume,
                                 guint samplerate,
                                 guint offset,
                                 guint n_frames,
                                 guint loop_mode,
                                 gint loop_start,
                                 gint loop_end);

ags_sf2_synth_util_copy_complex is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the audio buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

loop start

 

loop_end

loop end

 

Since: 3.4.0


ags_sf2_synth_util_copy ()

void
ags_sf2_synth_util_copy (void *buffer,
                         guint buffer_size,
                         AgsIpatchSample *ipatch_sample,
                         gdouble note,
                         gdouble volume,
                         guint samplerate,
                         guint audio_buffer_util_format,
                         guint offset,
                         guint n_frames,
                         guint loop_mode,
                         gint loop_start,
                         gint loop_end);

ags_sf2_synth_util_copy is deprecated and should not be used in newly-written code.

Generate Soundfont2 wave.

Parameters

buffer

the audio buffer

 

buffer_size

the buffer size

 

ipatch_sample

the AgsIpatchSample

 

note

the note

 

volume

the volume of the sin wave

 

samplerate

the samplerate

 

audio_buffer_util_format

the audio data format

 

offset

start frame

 

n_frames

generate n frames

 

loop_mode

the loop mode

 

loop_start

the loop start

 

loop_end

the loop end

 

Since: 3.4.0


ags_sf2_synth_util_get_type ()

GType
ags_sf2_synth_util_get_type (void);

Types and Values

enum AgsSF2SynthUtilLoopMode

Enum values to specify loop mode.

Members

AGS_SF2_SYNTH_UTIL_LOOP_NONE

loop none

 

AGS_SF2_SYNTH_UTIL_LOOP_STANDARD

loop standard

 

AGS_SF2_SYNTH_UTIL_LOOP_RELEASE

loop release

 

AGS_SF2_SYNTH_UTIL_LOOP_PINGPONG

loop pingpong

 

AGS_TYPE_SF2_SYNTH_UTIL

#define AGS_TYPE_SF2_SYNTH_UTIL         (ags_sf2_synth_util_get_type())

struct AgsSF2SynthUtil

struct AgsSF2SynthUtil {
  AgsIpatchSample *ipatch_sample;

  gpointer source;
  guint source_stride;

  gpointer sample_buffer;
  gpointer im_buffer;

  guint buffer_length;
  guint format;
  guint samplerate;

  gchar *preset;
  gchar *instrument;
  gchar *sample;

  gint bank;
  gint program;

  gint midi_key;

  gdouble note;

  gdouble volume;

  guint frame_count;
  guint offset;

  guint loop_mode;

  gint loop_start;
  gint loop_end;

  AgsResampleUtil *resample_util;
  AgsGenericPitchUtil *generic_pitch_util;
};