Class: FiddleFluidSynth

Inherits:
Object
  • Object
show all
Extended by:
SequencerEventIF, SequencerIF, SoundFontsLoaderIF
Includes:
SequencerEventIF, SequencerIF, SoundFontsLoaderIF
Defined in:
lib/fiddle_fluidsynth.rb,
lib/fiddle_fluidsynth/util.rb,
lib/fiddle_fluidsynth/version.rb,
lib/fiddle_fluidsynth/misc/misc.rb,
lib/fiddle_fluidsynth/misc/misc.rb,
lib/fiddle_fluidsynth/misc/misc.rb,
lib/fiddle_fluidsynth/util/util.rb,
lib/fiddle_fluidsynth/util/util.rb,
lib/fiddle_fluidsynth/util/util.rb,
lib/fiddle_fluidsynth/util/util.rb,
lib/fiddle_fluidsynth/util/util.rb,
lib/fiddle_fluidsynth/util/util.rb,
lib/fiddle_fluidsynth/util/util.rb,
lib/fiddle_fluidsynth/synth/synth.rb,
lib/fiddle_fluidsynth/synth/synth.rb,
lib/fiddle_fluidsynth/synth/synth.rb,
lib/fiddle_fluidsynth/types/types.rb,
lib/fiddle_fluidsynth/types/types.rb,
lib/fiddle_fluidsynth/util/callback.rb,
lib/fiddle_fluidsynth/util/callback.rb,
lib/fiddle_fluidsynth/util/callback.rb,
lib/fiddle_fluidsynth/logging/logging.rb,
lib/fiddle_fluidsynth/logging/logging.rb,
lib/fiddle_fluidsynth/sequencer/events.rb,
lib/fiddle_fluidsynth/sequencer/events.rb,
lib/fiddle_fluidsynth/sequencer/events.rb,
lib/fiddle_fluidsynth/sequencer/events.rb,
lib/fiddle_fluidsynth/sequencer/events.rb,
lib/fiddle_fluidsynth/synth/midi/setup.rb,
lib/fiddle_fluidsynth/synth/midi/setup.rb,
lib/fiddle_fluidsynth/util/module_hier.rb,
lib/fiddle_fluidsynth/util/module_hier.rb,
lib/fiddle_fluidsynth/util/module_hier.rb,
lib/fiddle_fluidsynth/fiddle_fluidsynth.rb,
lib/fiddle_fluidsynth/fiddle_fluidsynth.rb,
lib/fiddle_fluidsynth/fiddle_fluidsynth.rb,
lib/fiddle_fluidsynth/midi_input/driver.rb,
lib/fiddle_fluidsynth/midi_input/driver.rb,
lib/fiddle_fluidsynth/midi_input/events.rb,
lib/fiddle_fluidsynth/midi_input/events.rb,
lib/fiddle_fluidsynth/midi_input/events.rb,
lib/fiddle_fluidsynth/midi_input/events.rb,
lib/fiddle_fluidsynth/midi_input/player.rb,
lib/fiddle_fluidsynth/midi_input/player.rb,
lib/fiddle_fluidsynth/midi_input/player.rb,
lib/fiddle_fluidsynth/midi_input/router.rb,
lib/fiddle_fluidsynth/midi_input/router.rb,
lib/fiddle_fluidsynth/midi_input/router.rb,
lib/fiddle_fluidsynth/midi_input/router.rb,
lib/fiddle_fluidsynth/settings/settings.rb,
lib/fiddle_fluidsynth/settings/settings.rb,
lib/fiddle_fluidsynth/settings/settings.rb,
lib/fiddle_fluidsynth/settings/settings.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/loader.rb,
lib/fiddle_fluidsynth/soundfonts/voices.rb,
lib/fiddle_fluidsynth/soundfonts/voices.rb,
lib/fiddle_fluidsynth/synth/midi/tuning.rb,
lib/fiddle_fluidsynth/synth/midi/tuning.rb,
lib/fiddle_fluidsynth/audio_output/driver.rb,
lib/fiddle_fluidsynth/audio_output/driver.rb,
lib/fiddle_fluidsynth/audio_output/driver.rb,
lib/fiddle_fluidsynth/sequencer/sequencer.rb,
lib/fiddle_fluidsynth/sequencer/sequencer.rb,
lib/fiddle_fluidsynth/sequencer/sequencer.rb,
lib/fiddle_fluidsynth/sequencer/sequencer.rb,
lib/fiddle_fluidsynth/sequencer/sequencer.rb,
lib/fiddle_fluidsynth/synth/effect/chorus.rb,
lib/fiddle_fluidsynth/synth/effect/chorus.rb,
lib/fiddle_fluidsynth/synth/effect/ladspa.rb,
lib/fiddle_fluidsynth/synth/effect/ladspa.rb,
lib/fiddle_fluidsynth/synth/effect/reverb.rb,
lib/fiddle_fluidsynth/synth/effect/reverb.rb,
lib/fiddle_fluidsynth/synth/midi/messages.rb,
lib/fiddle_fluidsynth/synth/midi/messages.rb,
lib/fiddle_fluidsynth/synth/params/params.rb,
lib/fiddle_fluidsynth/synth/params/params.rb,
lib/fiddle_fluidsynth/synth/voice_control.rb,
lib/fiddle_fluidsynth/synth/voice_control.rb,
lib/fiddle_fluidsynth/midi_input/midi_input.rb,
lib/fiddle_fluidsynth/midi_input/midi_input.rb,
lib/fiddle_fluidsynth/soundfonts/generators.rb,
lib/fiddle_fluidsynth/soundfonts/modulators.rb,
lib/fiddle_fluidsynth/soundfonts/modulators.rb,
lib/fiddle_fluidsynth/soundfonts/modulators.rb,
lib/fiddle_fluidsynth/soundfonts/soundfonts.rb,
lib/fiddle_fluidsynth/soundfonts/soundfonts.rb,
lib/fiddle_fluidsynth/synth/audio_rendering.rb,
lib/fiddle_fluidsynth/synth/audio_rendering.rb,
lib/fiddle_fluidsynth/command_interface/shell.rb,
lib/fiddle_fluidsynth/command_interface/shell.rb,
lib/fiddle_fluidsynth/synth/effect/iir_filter.rb,
lib/fiddle_fluidsynth/synth/effect/iir_filter.rb,
lib/fiddle_fluidsynth/util/interface/settings.rb,
lib/fiddle_fluidsynth/util/interface/settings.rb,
lib/fiddle_fluidsynth/command_interface/server.rb,
lib/fiddle_fluidsynth/command_interface/server.rb,
lib/fiddle_fluidsynth/util/interface/soundfont.rb,
lib/fiddle_fluidsynth/command_interface/handler.rb,
lib/fiddle_fluidsynth/command_interface/handler.rb,
lib/fiddle_fluidsynth/command_interface/handler.rb,
lib/fiddle_fluidsynth/audio_output/file_renderer.rb,
lib/fiddle_fluidsynth/audio_output/file_renderer.rb,
lib/fiddle_fluidsynth/audio_output/file_renderer.rb,
lib/fiddle_fluidsynth/synth/soundfont_management.rb,
lib/fiddle_fluidsynth/synth/soundfont_management.rb,
lib/fiddle_fluidsynth/synth/soundfont_management.rb,
lib/fiddle_fluidsynth/util/interface/soundfont_preset.rb,
lib/fiddle_fluidsynth/util/interface/soundfont_sample.rb,
lib/fiddle_fluidsynth/command_interface/command_interface.rb,
lib/fiddle_fluidsynth/command_interface/command_interface.rb

Defined Under Namespace

Modules: C, Interface, SequencerEventIF, SequencerIF, SoundFont_IF, SoundFontsLoaderIF Classes: ModuleBase

Constant Summary collapse

FFS =
FiddleFluidSynth
VERSION =
"0.0.2"
FLUID_FAILED =

Value that indicates failure, used by most libfluidsynth functions.

-1
# Value that indicates success, used by most libfluidsynth functions.
FLUID_OK =

Value that indicates success, used by most libfluidsynth functions.

0
SOUNDFONT_NAME_DEFAULT =
"default.sf2"
URI_DEPRECATED =
"https://www.fluidsynth.org/api/deprecated.html"
BANK_NUM_MIN =
0
BANK_NUM_MAX =
16383
BKNUM_RANGE_WHOLE =
BANK_NUM_MIN..BANK_NUM_MAX
PROG_NUM_MIN =
0
PROG_NUM_MAX =
127
PGNUM_RANGE_WHOLE =
PROG_NUM_MIN..PROG_NUM_MAX
CHAN_NUM_MIN =
0
KEY_NUM_MIN =

CHAN_NUM_MAX = # MIDI channel count -1

0
KEY_NUM_MAX =
127
KEY_RANGE_WHOLE =
KEY_NUM_MIN..KEY_NUM_MAX
VEL_NUM_MIN =
0
VEL_NUM_MAX =
127
VEL_RANGE_WHOLE =
VEL_NUM_MIN..VEL_NUM_MAX
AUDIO_DRIVER_LIST =
[
'alsa', 'oss', 'jack', 'portaudio', 'sndmgr', 'coreaudio',
'Direct Sound']
Midi_router_handle_midi_event_default =
define_midi_event_func{|data, ev|
  midi_router_handle_midi_event(data, ev)
}
Synth_handle_midi_event_default =
define_midi_event_func{|data, ev|
  synth_handle_midi_event(data, ev)
}
FLUID_CHANNEL_MODE_MASK_EXT =

Indicates the mode a basic channel is set to.

(FLUID_CHANNEL_OMNI_OFF|FLUID_CHANNEL_POLY_OFF)
FLUID_HINT_BOUNDED_ABOVE =

Hint FLUID_HINT_BOUNDED_ABOVE indicates that the UpperBound field of the FLUID_PortRangeHint should be considered meaningful.

0x2
FLUID_HINT_BOUNDED_BELOW =

Hint FLUID_HINT_BOUNDED_BELOW indicates that the LowerBound field of the FLUID_PortRangeHint should be considered meaningful.

0x1
FLUID_HINT_OPTIONLIST =

Setting is a list of string options.

0x02
FLUID_HINT_TOGGLED =

Hint FLUID_HINT_TOGGLED indicates that the data item should be considered a Boolean toggle.

0x4
FLUID_INTERP_4THORDER_EXT =

Enumerations.

4
FLUID_INTERP_7THORDER_EXT =
7
@@error_in_callback =
nil

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SequencerEventIF

event_all_notes_off, event_all_sounds_off, event_bank_select, event_channel_pressure, event_chorus_send, event_control_change, event_delete, event_from_midi_event, event_get_bank, event_get_channel, event_get_control, event_get_data, event_get_dest, event_get_duration, event_get_key, event_get_pitch, event_get_program, event_get_scale, event_get_sfont_id, event_get_source, event_get_type, event_get_value, event_get_velocity, event_key_pressure, event_modulation, event_new, event_note, event_noteoff, event_noteon, event_pan, event_pitch_bend, event_pitch_wheelsens, event_program_change, event_program_select, event_reverb_send, event_scale, event_set_dest, event_set_source, event_sustain, event_system_reset, event_timer, event_unregistering, event_volume, seq_event

Methods included from SoundFontsLoaderIF

defsfloader_new, preset_delete, preset_get_banknum, preset_get_data, preset_get_name, preset_get_num, preset_get_sfont, preset_new, preset_set_data, sample_delete, sample_new, sample_set_loop, sample_set_name, sample_set_pitch, sample_set_sound_data, sample_sizeof, sfloader_delete, sfloader_get_data, sfloader_new, sfloader_set_callbacks, sfloader_set_data, sfont_delete, sfont_get_data, sfont_get_id, sfont_get_name, sfont_get_preset, sfont_iteration_next, sfont_iteration_start, sfont_new, sfont_set_data, synth_add_sfloader, synth_get_channel_preset

Methods included from SequencerIF

sequencer_add_midi_event_to_buffer, sequencer_client_is_dest, sequencer_count_clients, sequencer_delete, sequencer_get_client_id, sequencer_get_client_name, sequencer_get_tick, sequencer_get_time_scale, sequencer_get_use_system_timer, sequencer_new, sequencer_new2, sequencer_nouse_system_timer?, sequencer_process, sequencer_register_client, sequencer_register_fluidsynth, sequencer_remove_events, sequencer_send_at, sequencer_send_now, sequencer_set_time_scale, sequencer_unregister_client, sequencer_use_system_timer?

Constructor Details

#initialize(soundfont_name: SOUNDFONT_NAME_DEFAULT, soundfont_path: self.obtain_soundfont_path, soundfont_full_path: "#{soundfont_path}/#{soundfont_name}", gain: nil, samplerate: nil, midi_channels: nil, player_f: true, audio_driver_f: true, audio_driver_name: nil, audio_driver_new2_f: false, audio_driver_callback: nil, reset_presets: true) ⇒ FiddleFluidSynth

Args

soundfont_name

SoundFont file name. do NOT load when nil.

reset_presets

true then presets are updated immediately.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 42

def initialize( soundfont_name: SOUNDFONT_NAME_DEFAULT,
                soundfont_path: self.obtain_soundfont_path,
                soundfont_full_path:
                  "#{soundfont_path}/#{soundfont_name}",
                # gain:          0.2,
                # samplerate:    44100.0,
                # midi_channels: 256,
                gain:          nil,
                samplerate:    nil,
                midi_channels: nil,
                player_f:       true,
                audio_driver_f: true,
                audio_driver_name: nil,
                audio_driver_new2_f:   false,
                audio_driver_callback: nil,
                reset_presets: true )

  ### prepare Settings.
  @settings = self.settings_new
  if self.settings.null?
    $stderr.puts "(**) Failed to create settings."
    self.delete
    exit
  end

  # TODO. in args.?
  #
  #
  self.settings.
    synth_gain           = gain           unless gain.nil?
  self.settings.
    synth_sample__rate   = samplerate     unless samplerate.nil?
  self.settings.
    synth_midi__channels = midi_channels  unless midi_channels.nil?

  ### prepare Synthesizer.
  @synth  = self.synth_new(self.settings)
  if self.synth.null?
    $stderr.puts "(**) Failed to create synthesizer."
    self.delete
    exit
  end

  ### prepare SoundFont.
  @soundfont_full_path = soundfont_full_path
  @reset_presets       = reset_presets
  @sfid_ary = []      # set in sfont_sfload().
  @sfid_latest = nil

  #
  unless soundfont_name.to_s == ""
    tmp = self.synth_sfload(synth, filename: @soundfont_full_path,
                            reset_presets: @reset_presets,
                            verbose_f: true)
    if FLUID_FAILED == tmp
      $stderr.puts "(**) Failed to load the SoundFont."
      self.delete
      exit
    end
  else
    $stderr.puts "(**) SoundFont has NOT been loaded in the initializer."
  end

  ### prepare Player.
  @player = nil
  if player_f
    @player = self.player_new(self.synth)
    if self.player.null?
      $stderr.puts "(**) Failed to create player."
      self.delete
      exit
    end
  end

  ### prepare Audio Driver.
  @audio_driver = nil
  # self.audio_driver_prepare(
  #   audio_driver_name, settings: self.settings, synth: self.synth,
  #   new2_f: audio_driver_new2_f
  # )
  # if self.audio_driver.null?
  #   $stderr.puts "(**) Failed to prepare audio driver."
  #   self.delete
  #   exit
  # end
  if audio_driver_f
    self.audio_driver_prepare(
      audio_driver_name,
      settings: self.settings, synth: self.synth,
      new2_f: audio_driver_new2_f, cb_ptr: audio_driver_callback)

  else
    $stderr.puts "(**) Do prepare audio driver."
  end
  @file_renderer = nil

  ### create module hierarchy.
  self.init_objects(self)

end

Instance Attribute Details

#audio_driverObject (readonly)

Returns the value of attribute audio_driver.



143
144
145
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 143

def audio_driver
  @audio_driver
end

#file_rendererObject (readonly)

Returns the value of attribute file_renderer.



144
145
146
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 144

def file_renderer
  @file_renderer
end

#objectObject (readonly)

Returns the value of attribute object.



48
49
50
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 48

def object
  @object
end

#playerObject (readonly)

Returns the value of attribute player.



142
143
144
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 142

def player
  @player
end

#reset_presetObject (readonly)

Returns the value of attribute reset_preset.



146
147
148
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 146

def reset_preset
  @reset_preset
end

#settingsObject (readonly)

Returns the value of attribute settings.



142
143
144
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 142

def settings
  @settings
end

#sfid_aryObject (readonly)

attr_reader :sfid, :sfid_latest



148
149
150
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 148

def sfid_ary
  @sfid_ary
end

#sfid_latestObject (readonly)

attr_reader :sfid, :sfid_latest



148
149
150
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 148

def sfid_latest
  @sfid_latest
end

#soundfont_full_pathObject (readonly)

Returns the value of attribute soundfont_full_path.



146
147
148
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 146

def soundfont_full_path
  @soundfont_full_path
end

#synthObject (readonly)

Returns the value of attribute synth.



142
143
144
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 142

def synth
  @synth
end

Class Method Details

.__create_func_obj(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 56

def self.__create_func_obj( return_type: , argtypes_ary: [] ,
                            thread_f: false, &blk )
  func_obj = FFI::Function.new(return_type, argtypes_ary) do |*args|
    # NOTE:
    # without Thread.new{...}, the callback is locked at
    # fluid_sequencer_send_at(). i dont know why...
    #
    if thread_f
      Thread.new{
        # error_in_callback = nil
        begin
          blk.(*args)
        rescue ScriptError =>ex
          @@error_in_callback = ex
        rescue =>ex
          @@error_in_callback = ex
        end
      }
    else
      # error_in_callback = nil
      begin
        blk.(*args)
      rescue ScriptError =>ex
        @@error_in_callback = ex
      rescue =>ex
        @@error_in_callback = ex
      end
    end
  end

  # To avoid the GC, we have to have the reference to the object
  # of FFI::Function...
  #
  @func_obj_storage ||= {}
  @func_obj_storage[func_obj.object_id] = func_obj

  ret = func_obj
  ret
end

.audio_driver_delete(driver) ⇒ Object

Deletes an audio driver instance.



80
81
82
83
# File 'lib/fiddle_fluidsynth/audio_output/driver.rb', line 80

def self.audio_driver_delete( driver )
  ret = C.delete_fluid_audio_driver(driver)
  ret
end

.audio_driver_new(synth:, settings:) ⇒ Object

Create a new audio driver.



53
54
55
56
57
58
# File 'lib/fiddle_fluidsynth/audio_output/driver.rb', line 53

def self.audio_driver_new( synth: , settings: )
  ret = C.new_fluid_audio_driver(settings, synth)
  # ret.extend(Interface::AudioOutputDriver)
  #
  ret
end

.audio_driver_new2(settings:, audio_func:, data: nil) ⇒ Object

Create a new audio driver.

Args



67
68
69
70
71
72
# File 'lib/fiddle_fluidsynth/audio_output/driver.rb', line 67

def self.audio_driver_new2( settings: , audio_func: , data: nil )
  ret = C.new_fluid_audio_driver2(settings, audio_func, data)
  # ret.extend(Interface::AudioOutputDriver)
  #
  ret
end

.bknum_range_wholeObject Also known as: bank_range_whole



184
# File 'lib/fiddle_fluidsynth/util/util.rb', line 184

def self.bknum_range_whole;  BKNUM_RANGE_WHOLE; end

.create_func_obj_a1(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



133
134
135
136
137
138
139
140
141
142
143
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 133

def self.create_func_obj_a1( return_type: , argtypes_ary: [] ,
                             thread_f: false, &blk )
  func_obj = __create_func_obj(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f) do |a|
    blk.(a)
  end

  ret = func_obj
  ret
end

.create_func_obj_a3(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



121
122
123
124
125
126
127
128
129
130
131
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 121

def self.create_func_obj_a3( return_type: , argtypes_ary: [] , 
                             thread_f: false, &blk )
  func_obj = __create_func_obj(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f) do |a,b,c|
    blk.(a,b,c)
  end

  ret = func_obj
  ret
end

.create_func_obj_a4(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



109
110
111
112
113
114
115
116
117
118
119
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 109

def self.create_func_obj_a4( return_type: , argtypes_ary: [] ,
                             thread_f: false, &blk )
  func_obj = __create_func_obj(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f) do |a,b,c,d|
    blk.(a,b,c,d)
  end

  ret = func_obj
  ret
end

.create_func_obj_a6(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



146
147
148
149
150
151
152
153
154
155
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 146

def self.create_func_obj_a6( return_type: , argtypes_ary: [] ,
                             thread_f: false, &blk )
  func_obj = __create_func_obj(
    return_type: return_type, argtypes_ary: argtypes_ary) do |a,b,c, d,e,f|
      blk.(a,b,c, d,e,f)
  end

  ret = func_obj
  ret
end

.create_func_obj_ab(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 96

def self.create_func_obj_ab( return_type: , argtypes_ary: [] ,
                             thread_f: false, &blk )
  # func_obj = FFI::Function.new(return_type, argtypes_ary) do |a, b|
  func_obj = __create_func_obj(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f) do |a, b|
    blk.(a,b)
  end

  ret = func_obj
  ret
end

.create_func_ptr(func_obj) ⇒ Object



160
161
162
163
164
165
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 160

def self.create_func_ptr( func_obj )
  #
  ptr_obj = Fiddle::Pointer.new(func_obj.to_ptr.address)
  ret = ptr_obj
  ret
end

.default_log_function(level:, message:, data:) ⇒ Object



64
65
66
67
# File 'lib/fiddle_fluidsynth/logging/logging.rb', line 64

def self.default_log_function( level: , message: , data: )
  ret = C.fluid_default_log_function(level, message, data)
  ret
end

.define_audio_func(&blk) ⇒ Object

fluid_audio_func_t.

Desc

passed to audio_driver_new2().



409
410
411
412
413
414
415
416
417
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 409

def self.define_audio_func( &blk )
  self.define_callback_a6(
    return_type: :int, 
    argtypes_ary: [:pointer, :int,
                   :int, :pointer, :int, :pointer, ]
  ){|data, len, nfx, fx, nout, out|
    blk.(data, len, nfx, fx, nout, out)
  }
end

.define_callback_a1(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 250

def self.define_callback_a1( return_type: , argtypes_ary: [],
                             thread_f: false, &blk)
  #
  func_obj = create_func_obj_a1(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a|
    blk.call(a)
  }

  #
  func_ptr = create_func_ptr(func_obj)

  ret = func_ptr
  ret
end

.define_callback_a3(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 224

def self.define_callback_a3( return_type: , argtypes_ary: [],
                             thread_f: false, &blk)
  #
  func_obj = create_func_obj_a3(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b,c|
    blk.call(a,b,c)
  }

  #
  func_ptr = create_func_ptr(func_obj)
  # @func_ptr_storage[func_ptr.object_id] = func_ptr

  ret = func_ptr
  ret
end

.define_callback_a4(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 200

def self.define_callback_a4( return_type: , argtypes_ary: [],
                             thread_f: false, &blk)
  #
  func_obj = create_func_obj_a4(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b,c,d|
    blk.call(a,b,c,d)
  }

  #
  func_ptr = create_func_ptr(func_obj)
  ret = func_ptr
  ret
end

.define_callback_a6(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 275

def self.define_callback_a6( return_type: , argtypes_ary: [],
                             thread_f: false, &blk)
  #
  func_obj = create_func_obj_a6(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b,c,d,e,f|
    blk.call(a,b,c, d,e,f)
  }

  #
  func_ptr = create_func_ptr(func_obj)

  ret = func_ptr
  ret
end

.define_callback_ab(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object

Desc.

削除される



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 172

def self.define_callback_ab( return_type: , argtypes_ary: [],
                             thread_f: false, &blk)
  # @func_ptr_storage ||= {}

  #
  func_obj = create_func_obj_ab(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b|
    blk.call(a,b)
  }

  #
  func_ptr = create_func_ptr(func_obj)
  # @func_ptr_storage[func_ptr.object_id] = func_ptr

  ret = func_ptr
  ret
end

.define_event_callback(&blk) ⇒ Object

define sequencer client (sequencer event callback).

See Also

  • fluid_sequencer_register_client()

  • API Reference: MIDI sequencer.



438
439
440
441
442
443
444
445
446
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 438

def self.define_event_callback( &blk )
  self.define_callback_a4(
    return_type: :void,
    argtypes_ary: [:uint, :pointer, :pointer, :pointer],
    thread_f: true
  ){|time, event, seq, data|
    blk.(time,event,seq,data)
  }
end

.define_log_function(&blk) ⇒ Object

log function.



565
566
567
568
569
570
571
572
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 565

def self.define_log_function( &blk )
  self.define_callback_a3(
    return_type: :void,
    argtypes_ary: [:int, :pointer, :pointer]
  ){|level, message, data|
      blk.call(level,message,data)
    }
end

.define_midi_event_func(&blk) ⇒ Object

define midi_event_func (handle_midi_event_func_t).

See ALso

  • midi_input/driver.rb

  • midi_input/router.rb



459
460
461
462
463
464
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 459

def self.define_midi_event_func( &blk )
  self.define_callback_ab(
    return_type: :int, argtypes_ary: [:pointer, :pointer,]){|data, ev|
      blk.call(data,ev)
    }
end

.define_midi_tick_func(&blk) ⇒ Object

define midi_tick_func.



481
482
483
484
485
486
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 481

def self.define_midi_tick_func( &blk )
  self.define_callback_ab(
    return_type: :int, argtypes_ary: [:pointer, :int,]){|data, tick|
      blk.call(data,tick)
    }
end

.define_playback_callback(&blk) ⇒ Object

define playback callback function.

See Also

  • fluid_player_set_tick_callback()

  • fluid_synth_handle_midi_event()



392
393
394
395
396
397
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 392

def self.define_playback_callback( &blk )
  self.define_callback_ab(
    return_type: :int, argtypes_ary: [:pointer, :pointer]){|data, event|
      blk.call(data, event)
    }
end

.define_settings_foreach_callback(&blk) ⇒ Object

define callback function for fluid_settings_foreach().

See Also

  • fluid_settings_foreach_option()

  • .#define_tick_callback()



315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 315

def self.define_settings_foreach_callback( &blk )
  self.define_callback_a3(
    return_type: :void,
    argtypes_ary: [:pointer, :string, :int]){|data, name, type|
      begin
        blk.call(data, name, type)
        #blk.call(data, cur_tick)
      rescue =>ex
        raise ex
      end
    }
end

.define_settings_foreach_option_callback(&blk) ⇒ Object

define callback function for fluid_settings_foreach_option().

See Also

  • fluid_settings_foreach()



340
341
342
343
344
345
346
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 340

def self.define_settings_foreach_option_callback( &blk )
  self.define_callback_a3(
    return_type: :void,
    argtypes_ary: [:pointer, :string, :string]){|data, name, option|
      blk.call(data, name, option)
    }
end

.define_sfloader_callback_close(&blk) ⇒ Object

define sfloader callbacks.



497
498
499
500
501
502
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 497

def self.define_sfloader_callback_close( &blk )
  self.define_callback_a1(
    return_type: :int, argtypes_ary: [:pointer,]){|handle|
      blk.call(handle)
    }
end

.define_sfloader_callback_open(&blk) ⇒ Object



509
510
511
512
513
514
515
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 509

def self.define_sfloader_callback_open( &blk )
  self.define_callback_a1(
    return_type: :void,
    argtypes_ary: [:pointer,]){|filename|
      blk.call(filename)
    }
end

.define_sfloader_callback_read(&blk) ⇒ Object



522
523
524
525
526
527
528
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 522

def self.define_sfloader_callback_read( &blk )
  self.define_callback_a3(
    return_type: :int,
    argtypes_ary: [:pointer,:long_long,:pointer,]){|buf,count,handle|
      blk.call(buf,count,handle)
    }
end

.define_sfloader_callback_seek(&blk) ⇒ Object



535
536
537
538
539
540
541
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 535

def self.define_sfloader_callback_seek( &blk )
  self.define_callback_a3(
    return_type: :void,
    argtypes_ary: [:pointer,:long_long,:pointer,]){|handle,offset,origin|
      blk.call(handle,offset,origin)
    }
end

.define_sfloader_callback_tell(&blk) ⇒ Object



548
549
550
551
552
553
554
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 548

def self.define_sfloader_callback_tell( &blk )
  self.define_callback_a1(
    return_type: :long_long,
    argtypes_ary: [:pointer,]){|handle|
      blk.call(handle)
    }
end

.define_tick_callback(&blk) ⇒ Object

define tick callback function for fluid_player_set_tick_callback().

See Also

  • fluid_player_set_tick_callback()

  • fluid_player_set_playback_callback()

  • mid_input/: fluid_synth_handle_midi_event()

  • soundfont/loader: fluid_sfloader_set_callbacks()

  • logging/logging: fluid_set_log_function()



374
375
376
377
378
379
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 374

def self.define_tick_callback( &blk )
  self.define_callback_ab(
    return_type: :int, argtypes_ary: [:pointer, :int]){|data, cur_tick|
      blk.call(data, cur_tick)
    }
end

.deprecated_msg(meth) ⇒ Object



138
139
140
# File 'lib/fiddle_fluidsynth/util/util.rb', line 138

def self.deprecated_msg( meth )
  $stderr.puts "(**) #{meth} is deprecated. See #{URI_DEPRECATED}"
end

.deprecated_msg_instead(instead, meth:) ⇒ Object



146
147
148
# File 'lib/fiddle_fluidsynth/util/util.rb', line 146

def self.deprecated_msg_instead( instead, meth: )
  $stderr.puts "(**) #{meth} is deprecated. Use #{instead} instead."
end

.error_in_callbackObject



18
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 18

def self.error_in_callback; @@error_in_callback; end

.error_in_callback=(v) ⇒ Object



17
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 17

def self.error_in_callback=(v); @@error_in_callback = v; end

.file_renderer_delete(dev) ⇒ Object

Close file and destroy a file renderer object.



54
55
56
57
# File 'lib/fiddle_fluidsynth/audio_output/file_renderer.rb', line 54

def self.file_renderer_delete( dev )
  ret = C.delete_fluid_file_renderer(dev)
  ret
end

.file_renderer_new(synth) ⇒ Object

Create a new file renderer and open the file. def self.file_renderer_new( synth: )



44
45
46
47
# File 'lib/fiddle_fluidsynth/audio_output/file_renderer.rb', line 44

def self.file_renderer_new( synth )
  ret = C.new_fluid_file_renderer(synth)
  ret
end

.fluidsynth_versionObject



138
139
140
141
142
143
144
145
146
147
148
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 138

def self.fluidsynth_version
  ver_maj = Fiddle::Pointer.malloc_i
  ver_mic = Fiddle::Pointer.malloc_i
  ver_min = Fiddle::Pointer.malloc_i

  misc_version(ver_maj, ver_mic, ver_min)
  tmp = [ver_maj, ver_mic, ver_min].map{|e| e.decode1_i }

  ret = tmp
  ret
end

.fluidsynth_version_strObject



151
152
153
154
155
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 151

def self.fluidsynth_version_str
  # ret = C.fluid_version_str()
  ret = misc_version_str()
  ret
end

.free(ptr) ⇒ Object



61
62
63
64
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 61

def self.free( ptr )
  ret = C.fluid_free(ptr)
  ret
end

.get_stdinObject



45
46
47
48
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 45

def self.get_stdin
  ret = C.fluid_get_stdin()
  ret
end

.get_stdoutObject



53
54
55
56
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 53

def self.get_stdout
  ret = C.fluid_get_stdout()
  ret
end

.get_sysconf(buf, len) ⇒ Object

Args

buf

Caller supplied string buffer to store file name to.

len

Length of buf.



66
67
68
69
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 66

def self.get_sysconf( buf, len )
  ret = C.fluid_get_sysconf(buf, len)
  ret
end

.get_userconf(buf, len) ⇒ Object

Args

buf

Caller supplied string buffer to store file name to.

len

Length of buf.



79
80
81
82
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 79

def self.get_userconf( buf, len )
  ret = C.fluid_get_userconf(buf, len)
  ret
end

.is_midifile(file) ⇒ Object



69
70
71
72
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 69

def self.is_midifile( file )
  ret = C.fluid_is_midifile(file)
  ret
end

.is_midifile?(file) ⇒ Boolean

Returns:

  • (Boolean)


77
78
79
80
81
82
83
84
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 77

def self.is_midifile?( file )
  unless File.exist?(file)
    raise "No such file: #{file}"
  end

  #ng. self.is_midifile(file) == C::FLUID_OK
  self.is_midifile(file) != 0
end

.is_soundfont(file) ⇒ Object



93
94
95
96
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 93

def self.is_soundfont( file )
  ret = C.fluid_is_soundfont(file)
  ret
end

.is_soundfont?(file) ⇒ Boolean

Returns:

  • (Boolean)


102
103
104
105
106
107
108
109
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 102

def self.is_soundfont?( file )
  unless File.exist?(file)
    raise "No such file: #{file}"
  end

  # self.is_soundfont(file) == C::FLUID_OK
  self.is_soundfont(file) != 0
end

.key_range_wholeObject



186
# File 'lib/fiddle_fluidsynth/util/util.rb', line 186

def self.key_range_whole;   KEY_RANGE_WHOLE;   end

.log(level:, fmt:, **args) ⇒ Object



69
70
71
72
# File 'lib/fiddle_fluidsynth/logging/logging.rb', line 69

def self.log( level: , fmt: , **args )
  ret = C.fluid_log(level, fmt, args)
  ret
end

.midi_driver_delete(driver) ⇒ Object



66
67
68
69
# File 'lib/fiddle_fluidsynth/midi_input/driver.rb', line 66

def self.midi_driver_delete( driver )
  ret = C.delete_fluid_midi_driver(driver)
  ret
end

.midi_driver_new(settings:, handler: Midi_event_func_default, handler_data: nil) ⇒ Object

See Also

  • util/callback.rb



55
56
57
58
59
# File 'lib/fiddle_fluidsynth/midi_input/driver.rb', line 55

def self.midi_driver_new( settings: ,
                          handler: Midi_event_func_default, handler_data: nil )
  ret = C.new_fluid_midi_driver(settings, handler, handler_data)
  ret
end

.midi_event_delete(ev) ⇒ Object



124
125
126
127
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 124

def self.midi_event_delete( ev )
  ret = C.delete_fluid_midi_event(ev)
  ret
end

.midi_event_newObject



116
117
118
119
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 116

def self.midi_event_new()
  ret = C.new_fluid_midi_event()
  ret
end

.midi_router_delete(router) ⇒ Object



124
125
126
127
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 124

def self.midi_router_delete( router )
  ret = C.delete_fluid_midi_router(router)
  ret
end

.midi_router_handle_midi_event(data, event) ⇒ Object

See Also

  • util/callback.rb



190
191
192
193
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 190

def self.midi_router_handle_midi_event( data, event )
  ret = C.fluid_midi_router_handle_midi_event(data, event)
  ret
end

.midi_router_new(settings:, handler: Synth_handle_midi_event_default, handler_data: nil) ⇒ Object

See Also

  • fluid_synth_handle_midi_event()

  • util/callback.rb

def midi_router_new( handler: , data: , settings: self.settings )



111
112
113
114
115
116
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 111

def self.midi_router_new( settings: ,
                          handler: Synth_handle_midi_event_default,
                          handler_data: nil )
  ret = C.new_fluid_midi_router(settings, handler, handler_data)
  ret
end

.midi_router_rule_delete(rule) ⇒ Object



142
143
144
145
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 142

def self.midi_router_rule_delete( rule )
  ret = C.delete_fluid_midi_router_rule(rule)
  ret
end

.midi_router_rule_newObject

Router Rule.



134
135
136
137
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 134

def self.midi_router_rule_new
  ret = C.new_fluid_midi_router_rule()
  ret
end

.misc_version(major, micro, minor) ⇒ Object



115
116
117
118
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 115

def self.misc_version( major, micro, minor )
  ret = C.fluid_version(major, micro, minor)
  ret
end

.misc_version_strObject



123
124
125
126
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 123

def self.misc_version_str
  ret = C.fluid_version_str().to_s
  ret
end

.notify_error_in_callbackObject



40
41
42
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 40

def self.notify_error_in_callback
  self.raise_error_in_callback(notify_f: true)
end

.obtain_full_path_for_soundfont(sf2_filename = SOUNDFONT_NAME_DEFAULT) ⇒ Object



119
120
121
# File 'lib/fiddle_fluidsynth/util/util.rb', line 119

def self.obtain_full_path_for_soundfont( sf2_filename = SOUNDFONT_NAME_DEFAULT )
  C.full_path_for_soundfont(sf2_filename)
end

.obtain_soundfont_pathObject



112
113
114
# File 'lib/fiddle_fluidsynth/util/util.rb', line 112

def self.obtain_soundfont_path
  C.soundfont_path
end

.pgnum_range_wholeObject Also known as: prog_range_whole



185
# File 'lib/fiddle_fluidsynth/util/util.rb', line 185

def self.pgnum_range_whole;  PGNUM_RANGE_WHOLE; end

.player_delete(player) ⇒ Object



136
137
138
139
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 136

def self.player_delete( player )
  ret = C.delete_fluid_player(player)
  ret
end

.player_new(synth) ⇒ Object



128
129
130
131
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 128

def self.player_new( synth )
  ret = C.new_fluid_player(synth)
  ret
end

.raise_error_in_callback(notify_f: false) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 21

def self.raise_error_in_callback( notify_f: false )
  #raise @@error_in_callback unless @@error_in_callback.nil?
  unless @@error_in_callback.nil?
    unless notify_f
      raise @@error_in_callback
    else
      $stderr.puts "#{@@error_in_callback.message}:" +
        "#{@@error_in_callback.class}"
      @@error_in_callback.backtrace.each do |_e|
        $stderr.puts "#{_e}"
      end
    end
  end
  @@error_in_callback
end

.set_log_function(level:, func:, data:) ⇒ Object



74
75
76
77
# File 'lib/fiddle_fluidsynth/logging/logging.rb', line 74

def self.set_log_function( level: , func: , data: )
  ret = C.fluid_set_log_function(level, func, data)
  ret
end

.setting_hints_is_bounded_above?(hints) ⇒ Boolean

settings_get_hints().

Returns:

  • (Boolean)


313
314
315
316
# File 'lib/fiddle_fluidsynth/util/util.rb', line 313

def self.setting_hints_is_bounded_above?( hints )
  ret = hints & FLUID_HINT_BOUNDED_ABOVE
  ret != 0
end

.setting_hints_is_bounded_below?(hints) ⇒ Boolean

Returns:

  • (Boolean)


317
318
319
320
# File 'lib/fiddle_fluidsynth/util/util.rb', line 317

def self.setting_hints_is_bounded_below?( hints )
  ret = hints & FLUID_HINT_BOUNDED_BELOW
  ret != 0
end

.setting_hints_is_optionlist?(hints) ⇒ Boolean

Returns:

  • (Boolean)


321
322
323
324
# File 'lib/fiddle_fluidsynth/util/util.rb', line 321

def self.setting_hints_is_optionlist?( hints )
  ret = hints & FLUID_HINT_OPTIONLIST
  ret != 0
end

.setting_hints_is_toggled?(hints) ⇒ Boolean

Returns:

  • (Boolean)


325
326
327
328
# File 'lib/fiddle_fluidsynth/util/util.rb', line 325

def self.setting_hints_is_toggled?( hints )
  ret = hints & FLUID_HINT_TOGGLED
  ret != 0
end

.setting_type_is_int?(type) ⇒ Boolean

Returns:

  • (Boolean)


288
289
290
# File 'lib/fiddle_fluidsynth/util/util.rb', line 288

def self.setting_type_is_int?( type )
  type == FiddleFluidSynth::Enum_fluid_types_enum::FLUID_INT_TYPE
end

.setting_type_is_notype?(type) ⇒ Boolean

#settings_get_type().

Returns:

  • (Boolean)


280
281
282
# File 'lib/fiddle_fluidsynth/util/util.rb', line 280

def self.setting_type_is_notype?( type )
  type == FiddleFluidSynth::Enum_fluid_types_enum::FLUID_NO_TYPE
end

.setting_type_is_num?(type) ⇒ Boolean

Returns:

  • (Boolean)


284
285
286
# File 'lib/fiddle_fluidsynth/util/util.rb', line 284

def self.setting_type_is_num?( type )
  type == FiddleFluidSynth::Enum_fluid_types_enum::FLUID_NUM_TYPE
end

.setting_type_is_set?(type) ⇒ Boolean

Returns:

  • (Boolean)


296
297
298
# File 'lib/fiddle_fluidsynth/util/util.rb', line 296

def self.setting_type_is_set?( type )
  type == FiddleFluidSynth::Enum_fluid_types_enum::FLUID_SET_TYPE
end

.setting_type_is_str?(type) ⇒ Boolean

Returns:

  • (Boolean)


292
293
294
# File 'lib/fiddle_fluidsynth/util/util.rb', line 292

def self.setting_type_is_str?( type )
  type == FiddleFluidSynth::Enum_fluid_types_enum::FLUID_STR_TYPE
end

.settings_copystr(settings, name:, str:, len:) ⇒ Object



217
218
219
220
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 217

def self.settings_copystr( settings, name: , str: , len: )
  ret = C.fluid_settings_copystr(settings, name, str, len)
  ret
end

.settings_delete(settings) ⇒ Object



200
201
202
203
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 200

def self.settings_delete( settings )
  ret = C.delete_fluid_settings(settings)
  ret
end

.settings_dupstr(settings:, name:, out: Fiddle::Pointer.malloc_voidp) ⇒ Object

Args

out

must be Fiddle::Pointer.malloc_voidp



229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 229

def self.settings_dupstr( settings: , name: ,
                          out: Fiddle::Pointer.malloc_voidp )
  ret = nil
  tmp = C.fluid_settings_dupstr(settings, name, out)
  if FLUID_OK == tmp
    ret = out.ptr.to_s
  else
    raise "{#{__method__}} API call failed for name:" +
      " #{name}, out: #{out.inspect}."
  end
  ret
end

.settings_foreach(settings, data:, func:) ⇒ Object



248
249
250
251
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 248

def self.settings_foreach( settings, data: , func: )
  ret = C.fluid_settings_foreach(settings, data, func)
  ret
end

.settings_foreach_option(settings, name:, data:, func:) ⇒ Object



256
257
258
259
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 256

def self.settings_foreach_option( settings, name: , data: , func: )
  ret = C.fluid_settings_foreach_option(settings, name, data, func)
  ret
end

.settings_get_hints(name, settings:, outval: Fiddle::Pointer.malloc_i, notify_f: true) ⇒ Object

Args

outval

pointer. Fiddle::Pointer.malloc_i

See Also

  • ‘.#settings_get_type()`

def settings_get_hints( settings: , name: , val: ) def settings_get_hints( name, outval: , settings: self.settings ) def self.settings_get_hints( settings, name: ,



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 279

def self.settings_get_hints( name, settings: ,
                             outval: Fiddle::Pointer.malloc_i,
                             notify_f: true )
  ret = nil
  tmp = C.fluid_settings_get_hints(settings, name, outval)
  if FLUID_OK == tmp
    ret = Fiddle::Pointer.decode1_i(outval)
  else
    msg = "(**) Failed to get hints: #{name}. Maybe misspelled...?"
    if notify_f
      $stderr.puts "#{msg}"
    else
      raise "#{msg}"
    end
  end

  ret
end

.settings_get_type(name, settings:) ⇒ Object

See Also

  • ‘.#settings_get_hints()`

def self.settings_get_type( settings: , name: )



309
310
311
312
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 309

def self.settings_get_type( name, settings: )
  ret = C.fluid_settings_get_type(settings, name)
  ret
end

.settings_getint(settings, name:, val:) ⇒ Object



319
320
321
322
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 319

def self.settings_getint( settings, name: , val: )
  ret = C.fluid_settings_getint(settings, name, val)
  ret
end

.settings_getint_default(settings, name:, val:) ⇒ Object



327
328
329
330
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 327

def self.settings_getint_default( settings, name: , val: )
  ret = C.fluid_settings_getint_default(settings, name, val)
  ret
end

.settings_getint_range(settings, name:, min:, max:) ⇒ Object



336
337
338
339
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 336

def self.settings_getint_range( settings, name: , min: , max: )
  ret = C.fluid_settings_getint_range(settings, name, min, max)
  ret
end

.settings_getnum(settings, name:, val:) ⇒ Object



345
346
347
348
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 345

def self.settings_getnum( settings, name: , val: )
  ret = C.fluid_settings_getnum(settings, name, val)
  ret
end

.settings_getnum_default(settings, name:, val:) ⇒ Object



353
354
355
356
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 353

def self.settings_getnum_default( settings, name: , val: )
  ret = C.fluid_settings_getnum_default(settings, name, val)
  ret
end

.settings_getnum_range(settings, name:, min:, max:) ⇒ Object



361
362
363
364
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 361

def self.settings_getnum_range( settings, name: , min: , max: )
  ret = C.fluid_settings_getnum_range(settings, name, min, max)
  ret
end

.settings_getstr_default(settings, name:, defout:) ⇒ Object



370
371
372
373
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 370

def self.settings_getstr_default( settings, name: , defout: )
  ret = C.fluid_settings_getstr_default(settings, name, defout)
  ret
end

.settings_is_realtime(settings, name:) ⇒ Object



379
380
381
382
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 379

def self.settings_is_realtime( settings, name: )
  ret = C.fluid_settings_is_realtime(settings, name)
  ret
end

.settings_item_to_meth_name(item) ⇒ Object



273
274
275
# File 'lib/fiddle_fluidsynth/util/util.rb', line 273

def self.settings_item_to_meth_name( item )
  Interface::Settings.item_to_meth_name(item)
end

.settings_newObject

See Also

  • ‘#synth_get_settings()`



186
187
188
189
190
191
192
193
194
195
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 186

def self.settings_new()
  ret = C.new_fluid_settings()

  if ret.nil? || ret.null?
    ret = nil
  else
    ret.extend(Interface::Settings)
  end
  ret
end

.settings_option_concat(settings, name:, separator:) ⇒ Object



388
389
390
391
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 388

def self.settings_option_concat( settings, name: , separator: )
  ret = C.fluid_settings_option_concat(settings, name, separator)
  ret
end

.settings_option_count(settings, name:) ⇒ Object



396
397
398
399
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 396

def self.settings_option_count( settings, name: )
  ret = C.fluid_settings_option_count(settings, name)
  ret
end

.settings_option_foreachObject



261
262
263
264
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 261

def self.settings_foreach_option( settings, name: , data: , func: )
  ret = C.fluid_settings_foreach_option(settings, name, data, func)
  ret
end

.settings_setint(settings, name:, val:) ⇒ Object

setters.



406
407
408
409
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 406

def self.settings_setint( settings, name: , val: )
  ret = C.fluid_settings_setint(settings, name, val)
  ret
end

.settings_setnum(settings, name:, val:) ⇒ Object



414
415
416
417
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 414

def self.settings_setnum( settings, name: , val: )
  ret = C.fluid_settings_setnum(settings, name, val)
  ret
end

.settings_setstr(settings, name:, val:) ⇒ Object

def settings_setstr( settings: , name: , str: )



423
424
425
426
427
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 423

def self.settings_setstr( settings, name: , val: )
  # ret = C.fluid_settings_setstr(settings, name, str)
  ret = C.fluid_settings_setstr(settings, name, val)
  ret
end

.settings_str_equal(settings, name:, val:) ⇒ Object

def self.settings_str_equal( settings, name: , value: )



434
435
436
437
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 434

def self.settings_str_equal( settings, name: , val: )
  ret = C.fluid_settings_str_equal(settings, name, val)
  ret
end

.synth_delete(synth) ⇒ Object



60
61
62
63
# File 'lib/fiddle_fluidsynth/synth/synth.rb', line 60

def self.synth_delete( synth )
  ret = C.delete_fluid_synth(synth)
  ret
end

.synth_get_settings(synth) ⇒ Object

See Also

  • ‘#settings_new()`



448
449
450
451
452
453
454
455
456
457
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 448

def self.synth_get_settings( synth )
  ret = C.fluid_synth_get_settings(synth)

  if ret.nil? || ret.null?
    ret = nil
  else
    ret.extend(FiddleFluidSynth::Interface::Settings)
  end
  ret
end

.synth_handle_midi_event(data, event) ⇒ Object

See ALso

  • midi_input/router.rb

  • util/callback.rb:define_tick_callback().



59
60
61
62
# File 'lib/fiddle_fluidsynth/midi_input/midi_input.rb', line 59

def self.synth_handle_midi_event( data, event )
  ret = C.fluid_synth_handle_midi_event(data, event)
  ret
end

.synth_new(settings) ⇒ Object



51
52
53
54
# File 'lib/fiddle_fluidsynth/synth/synth.rb', line 51

def self.synth_new( settings )
  ret = C.new_fluid_synth(settings)
  ret
end

.velc_range_wholeObject Also known as: vel_range_whole



187
# File 'lib/fiddle_fluidsynth/util/util.rb', line 187

def self.velc_range_whole;  VEL_RANGE_WHOLE;   end

Instance Method Details

#__player_is_done?(player:, status:) ⇒ Boolean

Returns:

  • (Boolean)


446
447
448
449
450
# File 'lib/fiddle_fluidsynth/util/util.rb', line 446

def __player_is_done?( player: , status: )
  tmp = self.player_status(player)
  ret = (tmp == status)
  ret
end

#audio_driver_delete(driver = self.audio_driver) ⇒ Object



84
85
86
# File 'lib/fiddle_fluidsynth/audio_output/driver.rb', line 84

def audio_driver_delete( driver = self.audio_driver )
  self.class.audio_driver_delete(driver)
end

#audio_driver_new(synth: self.synth, settings: self.settings) ⇒ Object



59
60
61
# File 'lib/fiddle_fluidsynth/audio_output/driver.rb', line 59

def audio_driver_new( synth: self.synth, settings: self.settings )
  self.class.audio_driver_new(synth: synth, settings: settings)
end

#audio_driver_new2(audio_func:, data: nil, settings: self.settings) ⇒ Object



73
74
75
76
# File 'lib/fiddle_fluidsynth/audio_output/driver.rb', line 73

def audio_driver_new2( audio_func: , data: nil, settings: self.settings )
  self.class.audio_driver_new2(
    audio_func: audio_func, data: data, settings: settings)
end

#audio_driver_prepare(driver = nil, settings: self.settings, synth: self.synth, new2_f: false, cb_ptr: nil) ⇒ Object



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/fiddle_fluidsynth/util/util.rb', line 217

def audio_driver_prepare( driver = nil,
                          settings: self.settings, synth: self.synth,
                          new2_f: false, cb_ptr: nil )

  #
  if self.audio_driver && !(self.audio_driver.null?)
    $stderr.puts "(**) audio driver has already been set." +
      " currently multiple drivers setting is NOT supported." +
      " So #{__method__} ignore this call..."
  else

    ### set the driver name into the settings if it is given.
    if !(driver.to_s == "")
      raise "NOT supported driver: #{driver}." +
        " Choose one of #{AUDIO_DRIVER_LIST}" unless \
        AUDIO_DRIVER_LIST.include?(driver)

      #
      self.settings.audio_driver = driver
    end

    ### create audio driver instance.
    @audio_driver = if !(new2_f) && cb_ptr.nil?
                      self.audio_driver_new(
                        settings: settings, synth: synth)
                    elsif new2_f || cb_ptr
                      self.audio_driver_new2(
                        settings: settings, audio_func: cb_ptr)
                    else
                      raise "(**) Failed to prepare the audio driver."
                    end

    if @audio_driver.nil? || @audio_driver.null?
      raise "(**) Failed to create the audio driver."
    end
    $stderr.puts "(**) Audio driver is set" +
      " (0x#{@audio_driver.to_i.to_s(16)}:#{@audio_driver.class})."

  end
  @audio_driver
end

#audio_driver_register(adrivers = nil) ⇒ Object

Registers audio drivers to use.



96
97
98
99
# File 'lib/fiddle_fluidsynth/audio_output/driver.rb', line 96

def audio_driver_register( adrivers = nil )
  ret = C.fluid_audio_driver_register(adrivers)
  ret
end

#bank_select(ch, bknum, synth = self.synth) ⇒ Object



414
415
416
417
# File 'lib/fiddle_fluidsynth/util/util.rb', line 414

def bank_select( ch, bknum, synth = self.synth )
  # C.fluid_synth_bank_select(synth, ch, bknum)
  self.synth_bank_select(synth, ch: ch, bknum: bknum)
end

#cmd_command(handler, cmd, out) ⇒ Object



82
83
84
85
# File 'lib/fiddle_fluidsynth/command_interface/handler.rb', line 82

def cmd_command( handler, cmd, out )
  ret = C.fluid_command(handler, cmd, out)
  ret
end

#cmd_handler_delete(cmd_handler) ⇒ Object



69
70
71
72
# File 'lib/fiddle_fluidsynth/command_interface/handler.rb', line 69

def cmd_handler_delete( cmd_handler )
  ret = C.delete_fluid_cmd_handler(cmd_handler)
  ret
end

#cmd_handler_new(synth = self.synth, router:) ⇒ Object



58
59
60
61
# File 'lib/fiddle_fluidsynth/command_interface/handler.rb', line 58

def cmd_handler_new( synth=self.synth, router: )
  ret = C.new_fluid_cmd_handler(synth, router)
  ret
end

#cmd_handler_new2(settings = self.settings, synth:, router:, player:) ⇒ Object



63
64
65
66
67
# File 'lib/fiddle_fluidsynth/command_interface/handler.rb', line 63

def cmd_handler_new2( settings=self.settings,
                      synth: , router: , player: )
  ret = C.new_fluid_cmd_handler2(settings, synth, router, player)
  ret
end

#cmd_shell_delete(shell) ⇒ Object



64
65
66
67
# File 'lib/fiddle_fluidsynth/command_interface/shell.rb', line 64

def cmd_shell_delete( shell )
  ret = C.delete_fluid_shell(shell)
  ret
end

#cmd_shell_new(settings = self.settings, handler:, instm:, outstm:, thread:) ⇒ Object

def cmd_shell_new( settings: , handler: , in: , out: , thread: )



53
54
55
56
57
# File 'lib/fiddle_fluidsynth/command_interface/shell.rb', line 53

def cmd_shell_new( settings=self.settings,
                   handler: , instm: , outstm: , thread: )
  ret = C.new_fluid_shell(settings, handler, instm, outstm, thread)
  ret
end

#cmd_source(handler, filename) ⇒ Object



87
88
89
90
# File 'lib/fiddle_fluidsynth/command_interface/handler.rb', line 87

def cmd_source( handler, filename )
  ret = C.fluid_source(handler, filename)
  ret
end

#cmd_usershell(settings = self.settings, handler:) ⇒ Object



59
60
61
62
# File 'lib/fiddle_fluidsynth/command_interface/shell.rb', line 59

def cmd_usershell( settings=self.settings, handler: )
  ret = C.fluid_usershell(settings, handler)
  ret
end

#control_change(ch, ctrlnum, val, synth = self.synth) ⇒ Object Also known as: cc

control change.



383
384
385
# File 'lib/fiddle_fluidsynth/util/util.rb', line 383

def control_change( ch, ctrlnum, val, synth = self.synth )
  self.synth_cc(synth, ch: ch, num: ctrlnum, val: val)
end

#define_audio_func(&blk) ⇒ Object



418
419
420
421
422
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 418

def define_audio_func( &blk )
  self.class.define_audio_func(){|a,b,c,d,e,f|
    blk.(a,b,c,d,e,f)
  }
end

#define_callback_a1(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



265
266
267
268
269
270
271
272
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 265

def define_callback_a1( return_type: , argtypes_ary: [] ,
                        thread_f: false, &blk )
  self.class.define_callback_a1(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a|
      blk.call(a)
    }
end

#define_callback_a3(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



240
241
242
243
244
245
246
247
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 240

def define_callback_a3( return_type: , argtypes_ary: [],
                        thread_f: false, &blk )
  self.class.define_callback_a3(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b,c|
      blk.call(a,b,c)
    }
end

#define_callback_a4(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



214
215
216
217
218
219
220
221
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 214

def define_callback_a4( return_type: , argtypes_ary: [] ,
                        thread_f: false, &blk )
  self.class.define_callback_a4(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b,c,d|
      blk.call(a,b,c,d)
    }
end

#define_callback_a6(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



290
291
292
293
294
295
296
297
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 290

def define_callback_a6( return_type: , argtypes_ary: [], 
                        thread_f: false, &blk )
  self.class.define_callback_a6(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b,c,d,e,f|
      blk.(a,b,c,d,e,f)
    }
end

#define_callback_ab(return_type:, argtypes_ary: [], thread_f: false, &blk) ⇒ Object



190
191
192
193
194
195
196
197
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 190

def define_callback_ab( return_type: , argtypes_ary: [],
                        thread_f: false, &blk )
  self.class.define_callback_ab(
    return_type: return_type, argtypes_ary: argtypes_ary,
    thread_f: thread_f){|a,b|
      blk.call(a,b)
    }
end

#define_event_callback(&blk) ⇒ Object



447
448
449
450
451
452
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 447

def define_event_callback( &blk )
  self.class.define_event_callback(){|a,b,c,d|
    blk.(a,b,c,d)
    #Thread.new{ blk.(a,b,c,d) }
  }
end

#define_log_function(&blk) ⇒ Object



573
574
575
576
577
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 573

def define_log_function( &blk )
  self.class.define_log_function(){|level, message, data|
    blk.call(level,message,data)
  }
end

#define_midi_event_func(&blk) ⇒ Object



465
466
467
468
469
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 465

def define_midi_event_func( &blk )
  self.class.define_midi_event_func(){|data, ev|
    blk.call(data,ev)
  }
end

#define_midi_tick_func(&blk) ⇒ Object



487
488
489
490
491
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 487

def define_midi_tick_func( &blk )
  self.class.define_midi_tick_func(){|data, tick|
    blk.call(data,tick)
  }
end

#define_playback_callback(&blk) ⇒ Object



398
399
400
401
402
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 398

def define_playback_callback( &blk )
  self.class.define_playback_callback(){|a,b|
    blk.(a,b)
  }
end

#define_settings_foreach_callback(&blk) ⇒ Object



328
329
330
331
332
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 328

def define_settings_foreach_callback( &blk )
  self.class.define_settings_foreach_callback(){|a,b,c|
    blk.call(a,b,c)
  }
end

#define_settings_foreach_option_callback(&blk) ⇒ Object



348
349
350
351
352
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 348

def define_settings_foreach_option_callback( &blk )
  self.class.define_settings_foreach_option_callback(){|a,b,c|
    blk.call(a,b,c)
  }
end

#define_sfloader_callback_close(&blk) ⇒ Object



503
504
505
506
507
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 503

def define_sfloader_callback_close( &blk )
  self.class.define_sfloader_callback_close(){|handle|
    blk.call(handle)
  }
end

#define_sfloader_callback_open(&blk) ⇒ Object



516
517
518
519
520
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 516

def define_sfloader_callback_open( &blk )
  self.class.define_sfloader_callback_open(){|filename|
    blk.call(filename)
  }
end

#define_sfloader_callback_read(&blk) ⇒ Object



529
530
531
532
533
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 529

def define_sfloader_callback_read( &blk )
  self.class.define_sfloader_callback_read(){|buf,count,handle|
    blk.call(buf,count,handle)
  }
end

#define_sfloader_callback_seek(&blk) ⇒ Object



542
543
544
545
546
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 542

def define_sfloader_callback_seek( &blk )
  self.class.define_sfloader_callback_seek(){|handle,offset,origin|
    blk.call(handle,offset,origin)
  }
end

#define_sfloader_callback_tell(&blk) ⇒ Object



555
556
557
558
559
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 555

def define_sfloader_callback_tell( &blk )
  self.class.define_sfloader_callback_tell(){|handle|
    blk.call(handle)
  }
end

#define_tick_callback(&blk) ⇒ Object



381
382
383
384
385
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 381

def define_tick_callback( &blk )
  self.class.define_tick_callback(){|a,b|
    blk.call(a,b)
  }
end

#deleteObject



158
159
160
161
162
163
164
165
166
167
# File 'lib/fiddle_fluidsynth/fiddle_fluidsynth.rb', line 158

def delete
  self.audio_driver_delete(self.audio_driver) if self.audio_driver &&
                                                   !(self.audio_driver.null?)
  self.player_delete(self.player)     if self.player &&
                                           !(self.player.null?)
  self.synth_delete(self.synth)       if self.synth &&
                                           !(self.synth.null?)
  self.settings_delete(self.settings) if self.settings &&
                                           !(self.settings.null?)
end

#deprecated_msg(meth) ⇒ Object



141
142
143
# File 'lib/fiddle_fluidsynth/util/util.rb', line 141

def deprecated_msg( meth )
  self.class.deprecated_msg(meth)
end

#deprecated_msg_instead(instead, meth:) ⇒ Object



149
150
151
# File 'lib/fiddle_fluidsynth/util/util.rb', line 149

def deprecated_msg_instead( instead, meth: )
  self.class.deprecated_msg_instead(instead, meth: meth)
end

#file_renderer_delete(dev = self.file_renderer) ⇒ Object



58
59
60
# File 'lib/fiddle_fluidsynth/audio_output/file_renderer.rb', line 58

def file_renderer_delete( dev = self.file_renderer )
  self.class.file_renderer_delete(dev)
end

#file_renderer_new(synth = self.synth) ⇒ Object

def file_renderer_new( synth: self.synth )



49
50
51
# File 'lib/fiddle_fluidsynth/audio_output/file_renderer.rb', line 49

def file_renderer_new( synth = self.synth )
  self.class.file_renderer_new(synth)
end

#file_renderer_process_block(dev) ⇒ Object

Write period_size samples to file.



70
71
72
73
# File 'lib/fiddle_fluidsynth/audio_output/file_renderer.rb', line 70

def file_renderer_process_block( dev )
  ret = C.fluid_file_renderer_process_block(dev)
  ret
end

#file_renderer_set_encoding_quality(dev:, q:) ⇒ Object

Set vbr encoding quality (only available with libsndfile support)



76
77
78
79
# File 'lib/fiddle_fluidsynth/audio_output/file_renderer.rb', line 76

def file_renderer_set_encoding_quality( dev: , q: )
  ret = C.fluid_file_set_encoding_quality(dev, q)
  ret
end

#fluidsynth_versionObject



149
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 149

def fluidsynth_version; self.class.fluidsynth_version; end

#fluidsynth_version_strObject



156
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 156

def fluidsynth_version_str; self.class.fluidsynth_version_str; end

#free(ptr) ⇒ Object



65
66
67
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 65

def free( ptr )
  self.class.free(ptr)
end

#get_stdinObject



49
50
51
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 49

def get_stdin
  self.class.get_stdin()
end

#get_stdoutObject



57
58
59
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 57

def get_stdout
  self.class.get_stdout()
end

#get_sysconf(buf, len) ⇒ Object



70
71
72
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 70

def get_sysconf( buf, len )
  self.class.get_sysconf(buf, len)
end

#get_userconf(buf, len) ⇒ Object



83
84
85
# File 'lib/fiddle_fluidsynth/command_interface/command_interface.rb', line 83

def get_userconf( buf, len )
  self.class.get_userconf(buf, len)
end

#init_objects(top = self) ⇒ Object

should be called from FiddleFluidSynth#initialize()



42
43
44
45
46
47
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 42

def init_objects( top = self )
  #
  @object = ModuleBase.new(
             parent: top, fluidsynth_instance: top, value: nil)

end

#is_midifile(file) ⇒ Object



73
74
75
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 73

def is_midifile( file )
  self.class.is_midifile(file)
end

#is_midifile?(file) ⇒ Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 85

def is_midifile?( file )
  self.class.is_midifile?(file)
end

#is_soundfont(file) ⇒ Object



97
98
99
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 97

def is_soundfont( file )
  self.class.is_soundfont(file)
end

#is_soundfont?(file) ⇒ Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 110

def is_soundfont?( file )
  self.class.is_soundfont?(file)
end

#ladspa_activate(fx) ⇒ Object



92
93
94
95
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 92

def ladspa_activate( fx )
  ret = C.fluid_ladspa_activate(fx)
  ret
end

#ladspa_add_buffer(fx, name:) ⇒ Object



97
98
99
100
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 97

def ladspa_add_buffer( fx, name: )
  ret = C.fluid_ladspa_add_buffer(fx,name)
  ret
end

#ladspa_add_effect(fx, name:, lib_name:, plugin_name:) ⇒ Object



102
103
104
105
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 102

def ladspa_add_effect( fx, name: , lib_name: , plugin_name: )
  ret = C.fluid_ladspa_add_effect(fx,name)
  ret
end

#ladspa_buffer_exists(fx, name:) ⇒ Object



107
108
109
110
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 107

def ladspa_buffer_exists( fx, name: )
  ret = C.fluid_ladspa_buffer_exists(fx,name)
  ret
end

#ladspa_check(fx, err:, err_size:) ⇒ Object



112
113
114
115
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 112

def ladspa_check( fx, err: , err_size: )
  ret = C.fluid_ladspa_check(fx,err,err_size)
  ret
end

#ladspa_deactivate(fx) ⇒ Object



117
118
119
120
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 117

def ladspa_deactivate( fx )
  ret = C.fluid_ladspa_deactivate(fx)
  ret
end

#ladspa_effect_can_mix(fx, name:) ⇒ Object



122
123
124
125
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 122

def ladspa_effect_can_mix( fx, name: )
  ret = C.fluid_ladspa_effect_can_mix(fx,name)
  ret
end


127
128
129
130
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 127

def ladspa_effect_link( fx, effect_name: , port_name: , name: )
  ret = C.fluid_ladspa_effect_link(fx,effect_name,port_name,name)
  ret
end

#ladspa_effect_port_exists(fx, effect_name:, port_name:) ⇒ Object



132
133
134
135
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 132

def ladspa_effect_port_exists( fx, effect_name: , port_name: )
  ret = C.fluid_ladspa_effect_port_exists(fx,effect_name,port_name)
  ret
end

#ladspa_effect_set_control(fx, effect_name:, port_name:, val:) ⇒ Object



137
138
139
140
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 137

def ladspa_effect_set_control( fx, effect_name: , port_name: , val: )
  ret = C.fluid_ladspa_effect_set_control(fx,effect_name,port_name,val)
  ret
end

#ladspa_effect_set_mix(fx, name:, mix:, gain:) ⇒ Object



142
143
144
145
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 142

def ladspa_effect_set_mix( fx, name: , mix: , gain: )
  ret = C.fluid_ladspa_effect_set_mix(fx,name,mix,gain)
  ret
end

#ladspa_host_port_exists(fx, name:) ⇒ Object



148
149
150
151
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 148

def ladspa_host_port_exists( fx, name: )
  ret = C.fluid_ladspa_host_port_exists(fx,name)
  ret
end

#ladspa_is_active(fx) ⇒ Object



153
154
155
156
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 153

def ladspa_is_active( fx )
  ret = C.fluid_ladspa_is_active(fx)
  ret
end

#ladspa_reset(fx) ⇒ Object



158
159
160
161
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 158

def ladspa_reset( fx )
  ret = C.fluid_ladspa_reset(fx)
  ret
end

#midi_driver_delete(driver) ⇒ Object



70
71
72
# File 'lib/fiddle_fluidsynth/midi_input/driver.rb', line 70

def midi_driver_delete( driver )
  self.class.midi_driver_delete(driver)
end

#midi_driver_new(settings = self.settings, handler: Midi_event_func_default, handler_data: nil) ⇒ Object



60
61
62
63
64
# File 'lib/fiddle_fluidsynth/midi_input/driver.rb', line 60

def midi_driver_new( settings = self.settings,
                     handler: Midi_event_func_default, handler_data: nil )
  self.class.midi_driver_new(
    settings: settings, handler: handler, handler_data: handler_data)
end

#midi_dump_postrouter(data:, event:) ⇒ Object



157
158
159
160
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 157

def midi_dump_postrouter( data: , event: )
  ret = C.fluid_midi_dump_postrouter(data, event)
  ret
end

#midi_dump_prerouter(data:, event:) ⇒ Object



162
163
164
165
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 162

def midi_dump_prerouter( data: , event: )
  ret = C.fluid_midi_dump_prerouter(data, event)
  ret
end

#midi_event_delete(ev) ⇒ Object



128
129
130
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 128

def midi_event_delete( ev )
  self.class.midi_event_delete(ev)
end

#midi_event_get_channel(ev) ⇒ Object



142
143
144
145
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 142

def midi_event_get_channel( ev )
  ret = C.fluid_midi_event_get_channel(ev)
  ret
end

#midi_event_get_control(ev) ⇒ Object



147
148
149
150
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 147

def midi_event_get_control( ev )
  ret = C.fluid_midi_event_get_control(ev)
  ret
end

#midi_event_get_key(ev) ⇒ Object



152
153
154
155
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 152

def midi_event_get_key( ev )
  ret = C.fluid_midi_event_get_key(ev)
  ret
end

#midi_event_get_lyrics(ev, data, size) ⇒ Object



157
158
159
160
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 157

def midi_event_get_lyrics( ev, data, size )
  ret = C.fluid_midi_event_get_lyrics(ev, data, size)
  ret
end

#midi_event_get_pitch(ev) ⇒ Object



162
163
164
165
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 162

def midi_event_get_pitch( ev )
  ret = C.fluid_midi_event_get_pitch(ev)
  ret
end

#midi_event_get_program(ev) ⇒ Object



167
168
169
170
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 167

def midi_event_get_program( ev )
  ret = C.fluid_midi_event_get_program(ev)
  ret
end

#midi_event_get_text(ev, data:, size:) ⇒ Object



172
173
174
175
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 172

def midi_event_get_text( ev, data: , size: )
  ret = C.fluid_midi_event_get_text(ev, data, size)
  ret
end

#midi_event_get_type(ev) ⇒ Object



177
178
179
180
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 177

def midi_event_get_type( ev )
  ret = C.fluid_midi_event_get_type(ev)
  ret
end

#midi_event_get_value(ev) ⇒ Object



182
183
184
185
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 182

def midi_event_get_value( ev )
  ret = C.fluid_midi_event_get_value(ev)
  ret
end

#midi_event_get_velocity(ev) ⇒ Object



187
188
189
190
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 187

def midi_event_get_velocity( ev )
  ret = C.fluid_midi_event_get_velocity(ev)
  ret
end

#midi_event_newObject



120
121
122
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 120

def midi_event_new()
  self.class.midi_event_new()
end

#midi_event_set_channel(ev, ch:) ⇒ Object



197
198
199
200
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 197

def midi_event_set_channel( ev, ch: )
  ret = C.fluid_midi_event_set_channel(ev, ch)
  ret
end

#midi_event_set_control(ev, ctrl:) ⇒ Object



202
203
204
205
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 202

def midi_event_set_control( ev, ctrl: )
  ret = C.fluid_midi_event_set_control(ev, ctrl)
  ret
end

#midi_event_set_key(ev, key:) ⇒ Object



207
208
209
210
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 207

def midi_event_set_key( ev, key: )
  ret = C.fluid_midi_event_set_key(ev, key)
  ret
end

#midi_event_set_lyrics(ev, data:, size:, dynamic:) ⇒ Object



212
213
214
215
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 212

def midi_event_set_lyrics( ev, data: , size: , dynamic: )
  ret = C.fluid_midi_event_set_lyrics(ev, data, size, dynamic)
  ret
end

#midi_event_set_pitch(ev, val:) ⇒ Object



217
218
219
220
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 217

def midi_event_set_pitch( ev, val: )
  ret = C.fluid_midi_event_set_pitch(ev, val)
  ret
end

#midi_event_set_program(ev, val:) ⇒ Object



222
223
224
225
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 222

def midi_event_set_program( ev, val: )
  ret = C.fluid_midi_event_set_program(ev, val)
  ret
end

#midi_event_set_sysex(ev, data:, size:, dynamic:) ⇒ Object



227
228
229
230
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 227

def midi_event_set_sysex( ev, data: , size: , dynamic: )
  ret = C.fluid_midi_event_set_sysex(ev, data, size, dynamic)
  ret
end

#midi_event_set_text(ev, data:, size:, dynamic:) ⇒ Object



232
233
234
235
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 232

def midi_event_set_text( ev, data: , size: , dynamic: )
  ret = C.fluid_midi_event_set_text(ev, data, size, dynamic)
  ret
end

#midi_event_set_type(ev, type:) ⇒ Object



237
238
239
240
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 237

def midi_event_set_type( ev, type: )
  ret = C.fluid_midi_event_set_type(ev, type)
  ret
end

#midi_event_set_value(ev, val:) ⇒ Object



242
243
244
245
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 242

def midi_event_set_value( ev, val: )
  ret = C.fluid_midi_event_set_value(ev, val)
  ret
end

#midi_event_set_velocity(ev, val:) ⇒ Object



247
248
249
250
# File 'lib/fiddle_fluidsynth/midi_input/events.rb', line 247

def midi_event_set_velocity( ev, val: )
  ret = C.fluid_midi_event_set_velocity(ev, val)
  ret
end

#midi_router_add_rule(router, rule:, type:) ⇒ Object



176
177
178
179
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 176

def midi_router_add_rule( router, rule: , type: )
  ret = C.fluid_midi_router_add_rule(router, rule, type)
  ret
end

#midi_router_clear_rules(router) ⇒ Object



181
182
183
184
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 181

def midi_router_clear_rules( router )
  ret = C.fluid_midi_router_clear_rules(router)
  ret
end

#midi_router_delete(router) ⇒ Object



128
129
130
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 128

def midi_router_delete( router )
  self.class.midi_router_delete(router)
end

#midi_router_handle_midi_event(data, event) ⇒ Object



194
195
196
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 194

def midi_router_handle_midi_event( data, event )
  self.class.midi_router_handle_midi_event(data, event)
end

#midi_router_new(settings = self.settings, handler: Synth_handle_midi_event_default, handler_data: nil) ⇒ Object



117
118
119
120
121
122
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 117

def midi_router_new( settings = self.settings,
                     handler: Synth_handle_midi_event_default,
                     handler_data: nil )
  self.class.midi_router_new(
    settings: settings, handler: handler, handler_data: handler_data)
end

#midi_router_rule_delete(rule) ⇒ Object



146
147
148
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 146

def midi_router_rule_delete( rule )
  self.class.midi_router_rule_delete(rule)
end

#midi_router_rule_newObject



138
139
140
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 138

def midi_router_rule_new
  self.class.midi_router_rule_new
end

#midi_router_rule_set_chan(rule, min:, max:, mul:, add:) ⇒ Object Also known as: midi_router_rule_set_ch



199
200
201
202
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 199

def midi_router_rule_set_chan( rule, min: , max: , mul: , add: )
  ret = C.fluid_midi_router_rule_set_chan(rule,min,max,mul,add)
  ret
end

#midi_router_rule_set_param1(rule, min:, max:, mul:, add:) ⇒ Object



205
206
207
208
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 205

def midi_router_rule_set_param1( rule, min: , max: , mul: , add: )
  ret = C.fluid_midi_router_rule_set_param1(rule,min,max,mul,add)
  ret
end

#midi_router_rule_set_param2(rule, min:, max:, mul:, add:) ⇒ Object



210
211
212
213
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 210

def midi_router_rule_set_param2( rule, min: , max: , mul: , add: )
  ret = C.fluid_midi_router_rule_set_param2(rule,min,max,mul,add)
  ret
end

#midi_router_set_default_rules(router) ⇒ Object



216
217
218
219
# File 'lib/fiddle_fluidsynth/midi_input/router.rb', line 216

def midi_router_set_default_rules( router )
  ret = C.fluid_midi_router_set_default_rules(router)
  ret
end

#misc_version(major, micro, minor) ⇒ Object



119
120
121
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 119

def misc_version( major, micro, minor )
  self.class.misc_version(major, micro, minor)
end

#misc_version_strObject



127
128
129
# File 'lib/fiddle_fluidsynth/misc/misc.rb', line 127

def misc_version_str
  self.class.misc_version_str
end

#mod_clone(mod, src:) ⇒ Object



164
165
166
167
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 164

def mod_clone( mod, src: )
  ret = C.fluid_mod_clone(mod, src)
  ret
end

#mod_delete(mod) ⇒ Object



150
151
152
153
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 150

def mod_delete( mod )
  ret = C.delete_fluid_mod(mod)
  ret
end

#mod_get_amount(mod) ⇒ Object



169
170
171
172
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 169

def mod_get_amount( mod )
  ret = C.fluid_mod_get_amount(mod)
  ret
end

#mod_get_dest(mod) ⇒ Object



174
175
176
177
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 174

def mod_get_dest( mod )
  ret = C.fluid_mod_get_dest(mod)
  ret
end

#mod_get_flags1(mod) ⇒ Object



179
180
181
182
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 179

def mod_get_flags1( mod )
  ret = C.fluid_mod_get_flags1(mod)
  ret
end

#mod_get_flags2(mod) ⇒ Object



183
184
185
186
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 183

def mod_get_flags2( mod )
  ret = C.fluid_mod_get_flags2(mod)
  ret
end

#mod_get_source1(mod) ⇒ Object



187
188
189
190
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 187

def mod_get_source1( mod )
  ret = C.fluid_mod_get_source1(mod)
  ret
end

#mod_get_source2(mod) ⇒ Object



191
192
193
194
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 191

def mod_get_source2( mod )
  ret = C.fluid_mod_get_source2(mod)
  ret
end

#mod_get_transform(mod) ⇒ Object



197
198
199
200
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 197

def mod_get_transform( mod )
  ret = C.fluid_mod_get_transform(mod)
  ret
end

#mod_has_dest(mod, gen:) ⇒ Object



203
204
205
206
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 203

def mod_has_dest( mod, gen: )
  ret = C.fluid_mod_has_dest(mod,gen)
  ret
end

#mod_has_source(mod, cc:, ctrl:) ⇒ Object



207
208
209
210
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 207

def mod_has_source( mod, cc: , ctrl: )
  ret = C.fluid_mod_has_source(mod,cc,ctrl)
  ret
end

#mod_newObject



145
146
147
148
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 145

def mod_new()
  ret = C.new_fluid_mod()
  ret
end

#mod_set_amount(mod, amount:) ⇒ Object



213
214
215
216
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 213

def mod_set_amount( mod, amount: )
  ret = C.fluid_mod_set_amount(mod, amount)
  ret
end

#mod_set_dest(mod, dst:) ⇒ Object



217
218
219
220
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 217

def mod_set_dest( mod, dst: )
  ret = C.fluid_mod_set_dest(mod, dst)
  ret
end

#mod_set_source1(mod, src:, flags:) ⇒ Object



221
222
223
224
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 221

def mod_set_source1( mod, src: , flags: )
  ret = C.fluid_mod_set_amount(mod, amount)
  ret
end

#mod_set_source2(mod, src:, flags:) ⇒ Object



225
226
227
228
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 225

def mod_set_source2( mod, src: , flags: )
  ret = C.fluid_mod_set_amount(mod, amount)
  ret
end

#mod_set_transform(mod, type:) ⇒ Object



229
230
231
232
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 229

def mod_set_transform( mod, type: )
  ret = C.fluid_mod_set_amount(mod, amount)
  ret
end

#mod_sizeofObject



234
235
236
237
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 234

def mod_sizeof
  ret = C.fluid_mod_sizeof()
  ret
end

#mod_test_identity(mod1:, mod2:) ⇒ Object



238
239
240
241
# File 'lib/fiddle_fluidsynth/soundfonts/modulators.rb', line 238

def mod_test_identity( mod1: , mod2: )
  ret = C.fluid_mod_test_identity(mod1, mod2)
  ret
end

#noteoff(ch, key, synth = self.synth) ⇒ Object



373
374
375
# File 'lib/fiddle_fluidsynth/util/util.rb', line 373

def noteoff( ch, key, synth = self.synth )
  self.synth_noteoff(synth, ch: ch, key: key)
end

#noteon(ch, key, vel, synth = self.synth) ⇒ Object



369
370
371
# File 'lib/fiddle_fluidsynth/util/util.rb', line 369

def noteon( ch, key, vel, synth = self.synth )
  self.synth_noteon(synth, ch: ch, key: key, vel: vel)
end

#notify_error_in_callbackObject



43
44
45
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 43

def notify_error_in_callback
  self.class.notify_error_in_callback(notify_f: notify_f)
end

#obtain_full_path_for_soundfont(sf2_filename = SOUNDFONT_NAME_DEFAULT) ⇒ Object



122
123
124
# File 'lib/fiddle_fluidsynth/util/util.rb', line 122

def obtain_full_path_for_soundfont( sf2_filename = SOUNDFONT_NAME_DEFAULT )
  self.class.obtain_full_path_for_soundfont(sf2_filename)
end

#obtain_soundfont_pathObject



115
116
117
# File 'lib/fiddle_fluidsynth/util/util.rb', line 115

def obtain_soundfont_path
  self.class.obtain_soundfont_path
end

#pitch_bend(ch, val, synth = self.synth) ⇒ Object



377
378
379
380
# File 'lib/fiddle_fluidsynth/util/util.rb', line 377

def pitch_bend( ch, val, synth = self.synth )
  # C.fluid_synth_pitch_bend(@synth, ch, val + 8192)
  self.synth_pitch_bend(synth, ch: ch, val: val)
end

#player_add(player = self.player, file:) ⇒ Object

def player_add( file: , player: self.player )



153
154
155
156
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 153

def player_add( player = self.player, file: )
  ret = C.fluid_player_add(player, file)
  ret
end

#player_add_mem(player = self.player, buf:, size:) ⇒ Object



158
159
160
161
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 158

def player_add_mem( player = self.player, buf: , size: )
  ret = C.fluid_player_add_mem(player, buf, size)
  ret
end

#player_delete(player = self.player) ⇒ Object



140
141
142
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 140

def player_delete( player = self.player )
  self.class.player_delete(player)
end

#player_file(file, player: self.player) ⇒ Object Also known as: play_file

midi_input/player.rb

TODO. args. player=self.player, file: file) def player_file( file, player: self.player )



431
432
433
434
# File 'lib/fiddle_fluidsynth/util/util.rb', line 431

def player_file( file, player: self.player )
  self.player_add(player, file: file)
  self.player_play(player)
end

#player_get_bpm(player = self.player) ⇒ Object Also known as: player_bpm



164
165
166
167
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 164

def player_get_bpm( player = self.player )
  ret = C.fluid_player_get_bpm(player)
  ret
end

#player_get_current_tick(player = self.player) ⇒ Object



170
171
172
173
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 170

def player_get_current_tick( player = self.player )
  ret = C.fluid_player_get_current_tick(player)
  ret
end

#player_get_division(player = self.player) ⇒ Object



175
176
177
178
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 175

def player_get_division( player = self.player )
  ret = C.fluid_player_get_division(player)
  ret
end

#player_get_midi_tempo(player = self.player) ⇒ Object



180
181
182
183
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 180

def player_get_midi_tempo( player = self.player )
  ret = C.fluid_player_get_midi_tempo(player)
  ret
end

#player_get_status(player = self.player) ⇒ Object Also known as: player_status



185
186
187
188
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 185

def player_get_status( player = self.player )
  ret = C.fluid_player_get_status(player)
  ret
end

#player_get_total_ticks(player = self.player) ⇒ Object



191
192
193
194
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 191

def player_get_total_ticks( player = self.player )
  ret = C.fluid_player_get_total_ticks(player)
  ret
end

#player_is_done?(player = self.player) ⇒ Boolean

Returns:

  • (Boolean)


460
461
462
# File 'lib/fiddle_fluidsynth/util/util.rb', line 460

def player_is_done?( player = self.player )
  self.__player_is_done?(player: player, status: FLUID_PLAYER_DONE)
end

#player_is_playing?(player = self.player) ⇒ Boolean

Returns:

  • (Boolean)


454
455
456
# File 'lib/fiddle_fluidsynth/util/util.rb', line 454

def player_is_playing?( player = self.player )
  self.__player_is_done?(player: player, status: FLUID_PLAYER_PLAYING)
end

#player_is_ready?(player = self.player) ⇒ Boolean

Returns:

  • (Boolean)


451
452
453
# File 'lib/fiddle_fluidsynth/util/util.rb', line 451

def player_is_ready?( player = self.player )
  self.__player_is_done?(player: player, status: FLUID_PLAYER_READY)
end

#player_is_stopping?(player = self.player) ⇒ Boolean

Returns:

  • (Boolean)


457
458
459
# File 'lib/fiddle_fluidsynth/util/util.rb', line 457

def player_is_stopping?( player = self.player )
  self.__player_is_done?(player: player, status: FLUID_PLAYER_STOPPING)
end

#player_join(player = self.player) ⇒ Object



196
197
198
199
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 196

def player_join( player = self.player )
  ret = C.fluid_player_join(player)
  ret
end

#player_new(synth = self.synth) ⇒ Object



132
133
134
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 132

def player_new( synth = self.synth )
  self.class.player_new(synth)
end

#player_play(player = self.player) ⇒ Object



201
202
203
204
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 201

def player_play( player = self.player )
  ret = C.fluid_player_play(player)
  ret
end

#player_seek(player = self.player, ticks:) ⇒ Object



207
208
209
210
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 207

def player_seek( player = self.player, ticks: )
  ret = C.fluid_player_seek(player, ticks)
  ret
end

#player_set_bpm(player = self.player, bpm:) ⇒ Object



215
216
217
218
219
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 215

def player_set_bpm( player = self.player, bpm: )
  deprecated_msg_instead('player_set_tempo()', meth: __method__)
  ret = C.fluid_player_set_bmp(player, bpm)
  ret
end

#player_set_loop(player = self.player, times:) ⇒ Object

Args

times

Times left to loop the playlist. -1 means loop infinitely.



225
226
227
228
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 225

def player_set_loop( player = self.player, times: )
  ret = C.fluid_player_set_loop(player, times)
  ret
end

#player_set_midi_tempo(player = self.player, tempo:) ⇒ Object



230
231
232
233
234
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 230

def player_set_midi_tempo( player = self.player, tempo: )
  deprecated_msg_instead('player_set_tempo()', meth: __method__)
  ret = C.fluid_player_set_midi_tempo(player, tempo)
  ret
end

#player_set_playback_callback(player = self.player, handler:, handler_data:) ⇒ Object



236
237
238
239
240
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 236

def player_set_playback_callback( player=self.player,
                                  handler: , handler_data: )
  ret = C.fluid_player_set_playback_callback(player, handler, handler_data)
  ret
end

#player_set_tempo(player = self.player, tempo:) ⇒ Object



242
243
244
245
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 242

def player_set_tempo( player=self.player, tempo: )
  ret = C.fluid_player_set_tempo(player, tempo)
  ret
end

#player_set_tick_callback(player = self.player, handler: nil, handler_data: nil) ⇒ Object

Args

handler

callback function address (in Fiddle::Pointer(FFI::Pointer)).

handler_data

Fiddle::Pointer.new(FFI::Pointer#address).

(actually this arg is
meaningless in Ruby. because we can use closure to describe
callback function.)
yeild

{|user_data, cur_tick| … } is tick callback function, where cur_tick is current tick in MIDI file.

See Also

  • util/util.rb:define_tick_callback().



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 261

def player_set_tick_callback( player=self.player,
                              handler: nil, handler_data: nil )
  #
  if handler.nil? && block_given?
    cb_ptr = self.define_tick_callback(){|user_data, cur_tick|
      yield(user_data, cur_tick)
    }
    handler = cb_ptr
  elsif !(handler.nil?)
    # do nothing.
  else
    raise "Specify the handler in args or block."
  end

  #
  ret = C.fluid_player_set_tick_callback(player, handler, handler_data)
  ret
end

#player_stop(player = self.player) ⇒ Object



280
281
282
283
# File 'lib/fiddle_fluidsynth/midi_input/player.rb', line 280

def player_stop( player = self.player )
  ret = C.fluid_player_stop(player)
  ret
end

#program_change(ch, pgnum, synth = self.synth) ⇒ Object



398
399
400
401
# File 'lib/fiddle_fluidsynth/util/util.rb', line 398

def program_change( ch, pgnum, synth = self.synth )
  # C.fluid_synth_program_change(synth, ch, pgnum)
  self.synth_program_change(synth, ch: ch, pgnum: pgnum)
end

#program_reset(synth = self.synth) ⇒ Object



403
404
405
406
# File 'lib/fiddle_fluidsynth/util/util.rb', line 403

def program_reset( synth = self.synth )
  # C.fluid_synth_program_reset(synth)
  self.synth_program_reset(synth)
end

#program_select(ch:, bknum:, prenum:, sfid: self.sfid_latest, synth: self.synth) ⇒ Object

TODO. remove?



391
392
393
394
395
396
# File 'lib/fiddle_fluidsynth/util/util.rb', line 391

def program_select( ch: ,
                    bknum: , prenum: , sfid: self.sfid_latest,
                    synth: self.synth )
  self.synth_program_select(synth, ch: ch,
    sfid: sfid, bknum: bknum, prenum: prenum)
end

#raise_error_in_callback(notify_f: false) ⇒ Object



36
37
38
# File 'lib/fiddle_fluidsynth/util/callback.rb', line 36

def raise_error_in_callback( notify_f: false )
  self.class.raise_error_in_callback(notify_f: notify_f)
end

#server_delete(server) ⇒ Object



65
66
67
68
# File 'lib/fiddle_fluidsynth/command_interface/server.rb', line 65

def server_delete( server )
  ret = C.delete_fluid_server(server)
  ret
end

#server_join(server) ⇒ Object



70
71
72
73
# File 'lib/fiddle_fluidsynth/command_interface/server.rb', line 70

def server_join( server )
  ret = C.fluid_server_join(server)
  ret
end

#server_new(settings:, synth:, router:) ⇒ Object



55
56
57
58
# File 'lib/fiddle_fluidsynth/command_interface/server.rb', line 55

def server_new( settings: , synth: , router: )
  ret = C.new_fluid_server(synth, router)
  ret
end

#server_new2(settings:, synth:, router:, player:) ⇒ Object



60
61
62
63
# File 'lib/fiddle_fluidsynth/command_interface/server.rb', line 60

def server_new2( settings: , synth: , router: , player: )
  ret = C.new_fluid_server2(settings, synth, router, player)
  ret
end

#settings_copystr(settings = self.settings, name:, str:, len:) ⇒ Object



221
222
223
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 221

def settings_copystr( settings = self.settings, name: , str: , len: )
  self.class.settings_copystr(settings, name: name, str: str, len: len)
end

#settings_delete(settings) ⇒ Object



204
205
206
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 204

def settings_delete( settings )
  self.class.settings_delete(settings)
end

#settings_dupstr(name, settings = self.settings, out: Fiddle::Pointer.malloc_voidp) ⇒ Object



241
242
243
244
245
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 241

def settings_dupstr( name, settings = self.settings,
                     out: Fiddle::Pointer.malloc_voidp )
  self.class.settings_dupstr(
    settings: settings, name: name, out: out)
end

#settings_foreach(settings = self.settings, data:, func:) ⇒ Object



252
253
254
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 252

def settings_foreach( settings = self.settings, data: , func: )
  self.class.settings_foreach(settings, data: data, func: func)
end

#settings_foreach_option(settings = self.settings, name:, data:, func:) ⇒ Object Also known as: settings_option_foreach



263
264
265
266
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 263

def settings_foreach_option( settings = self.settings, name: , data: , func: )
  self.class.settings_foreach_option(
    settings, name: name, data: data, func: func)
end

#settings_get_hints(name, settings: self.settings, outval: Fiddle::Pointer.malloc_i, notify_f: true) ⇒ Object



297
298
299
300
301
302
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 297

def settings_get_hints( name, settings: self.settings,
                        outval: Fiddle::Pointer.malloc_i,
                        notify_f: true )
  self.class.settings_get_hints(
    name, settings: settings, outval: outval, notify_f: notify_f)
end

#settings_get_type(name, settings: self.settings) ⇒ Object

def settings_get_type( settings = self.settings, name: )



314
315
316
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 314

def settings_get_type( name, settings: self.settings )
  self.class.settings_get_type(name, settings: settings)
end

#settings_getint(settings = self.settings, name:, val:) ⇒ Object



323
324
325
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 323

def settings_getint( settings = self.settings, name: , val: )
  self.class.settings_getint(settings, name: name, val: val)
end

#settings_getint_default(settings = self.settings, name:, val:) ⇒ Object



331
332
333
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 331

def settings_getint_default( settings = self.settings, name: , val: )
  self.class.settings_getint_default(settings, name: name, val: val)
end

#settings_getint_range(settings = self.settings, name:, min:, max:) ⇒ Object



340
341
342
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 340

def settings_getint_range( settings = self.settings, name: , min: , max: )
  self.class.settings_getint_range(settings, name: name, min: min, max: max)
end

#settings_getnum(settings = self.settings, name:, val:) ⇒ Object



349
350
351
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 349

def settings_getnum( settings = self.settings, name: , val: )
  self.class.settings_getnum(settings, name: name, val: val)
end

#settings_getnum_default(settings = self.settings, name:, val:) ⇒ Object



357
358
359
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 357

def settings_getnum_default( settings = self.settings, name: , val: )
  self.class.settings_getnum_default(settings, name: name, val: val)
end

#settings_getnum_range(settings = self.settings, name:, min:, max:) ⇒ Object



365
366
367
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 365

def settings_getnum_range( settings=self.settings, name: , min: , max: )
  self.class.settings_getnum_range(settings, name: name, min: min, max: max)
end

#settings_getstr_default(settings = self.settings, name:, defout:) ⇒ Object



374
375
376
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 374

def settings_getstr_default( settings=self.settings, name: , defout: )
  self.class.settings_getstr_default(settings, name: name, defout: defout)
end

#settings_is_realtime(settings = self.settings, name:) ⇒ Object



383
384
385
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 383

def settings_is_realtime( settings=self.settings, name: )
  self.class.settings_is_realtime(settings, name: name)
end

#settings_newObject



196
197
198
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 196

def settings_new()
  self.class.settings_new
end

#settings_option_concat(settings = self.settings, name:, separator:) ⇒ Object



392
393
394
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 392

def settings_option_concat( settings=self.settings, name: , separator: )
  self.class.settings_option_concat(settings, name: name, separator: separator)
end

#settings_option_count(settings = self.settings, name:) ⇒ Object



400
401
402
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 400

def settings_option_count( settings=self.settings, name: )
  self.class.settings_option_count(settings, name: name)
end

#settings_setint(settings = self.settings, name:, val:) ⇒ Object



410
411
412
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 410

def settings_setint( settings=self.settings, name: , val: )
  self.class.settings_setint(settings, name: name, val: val)
end

#settings_setnum(settings = self.settings, name:, val:) ⇒ Object



418
419
420
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 418

def settings_setnum( settings=self.settings, name: , val: )
  self.class.settings_setnum(settings, name: name, val: val)
end

#settings_setstr(settings = self.settings, name:, val:) ⇒ Object



428
429
430
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 428

def settings_setstr( settings=self.settings, name: , val: )
  self.class.settings_setstr(settings, name: name, val: val)
end

#settings_str_equal(settings = self.settings, name:, val:) ⇒ Object



438
439
440
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 438

def settings_str_equal( settings=self.settings, name: , val: )
  self.class.settings_str_equal(settings, name: name, val: val)
end

#sfont(debug_f: false) ⇒ Object



351
352
353
354
355
# File 'lib/fiddle_fluidsynth/util/util.rb', line 351

def sfont( debug_f: false )
  ret = self.sfonts.first
  $stderr.puts "{#{__method__}} ret: #{ret.class}" if debug_f
  ret
end

#sfont_select(ch, sfid, synth = self.synth) ⇒ Object



409
410
411
412
# File 'lib/fiddle_fluidsynth/util/util.rb', line 409

def sfont_select( ch, sfid, synth = self.synth )
  # C.fluid_synth_sfont_select(synth, ch, sfid)
  self.synth_sfont_select(synth, ch: ch, sfid: sfid)
end

#sfonts(synth = self.synth) ⇒ Object



345
346
347
348
349
350
# File 'lib/fiddle_fluidsynth/util/util.rb', line 345

def sfonts( synth = self.synth )
  ret = self.sfid_ary.map{|_sfid|
    self.synth_get_sfont_by_id(synth, id: _sfid)
  }
  ret
end

#start(driver = nil) ⇒ Object



260
261
262
# File 'lib/fiddle_fluidsynth/util/util.rb', line 260

def start( driver = nil )
  self.audio_driver_prepare(driver)
end

#synth_activate_key_tuning(synth = self.synth, bknum:, pgnum:, name:, pitch:, apply:) ⇒ Object



74
75
76
77
78
79
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 74

def synth_activate_key_tuning( synth=self.synth,
                               bknum: , pgnum: , name: , pitch: , apply: )
  ret = C.fluid_synth_activate_key_tuning(
          synth, bknum, pgnum, name, pitch, apply)
  ret
end

#synth_activate_octave_tuning(synth = self.synth, bknum:, pgnum:, name:, pitch:, apply:) ⇒ Object



81
82
83
84
85
86
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 81

def synth_activate_octave_tuning( synth=self.synth,
                                  bknum: , pgnum: , name: , pitch: , apply: )
  ret = C.fluid_synth_activate_octave_tuning(
          synth, bknum, pgnum, name, pitch, apply)
  ret
end

#synth_activate_tuning(synth = self.synth, ch:, bknum:, pgnum:, apply:) ⇒ Object



88
89
90
91
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 88

def synth_activate_tuning( synth=self.synth, ch: , bknum: , pgnum: , apply: )
  ret = C.fluid_synth_activate_tuning(synth, ch, bknum, pgnum, apply)
  ret
end

#synth_add_default_mod(synth = self.synth, mod:, mode:) ⇒ Object



115
116
117
118
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 115

def synth_add_default_mod( synth=self.synth, mod: , mode: )
  ret = C.fluid_synth_add_default_mod(synth,mod,mode)
  ret
end

#synth_add_sfont(synth = self.synth, sfont:) ⇒ Object



88
89
90
91
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 88

def synth_add_sfont( synth=self.synth, sfont: )
  ret = C.fluid_synth_add_sfont(synth,sfont)
  ret
end

#synth_all_notes_off(synth = self.synth, ch:) ⇒ Object



127
128
129
130
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 127

def synth_all_notes_off( synth=self.synth, ch: )
  ret = C.fluid_synth_all_notes_off(synth, ch)
  ret
end

#synth_all_sounds_off(synth = self.synth, ch:) ⇒ Object



131
132
133
134
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 131

def synth_all_sounds_off( synth=self.synth, ch: )
  ret = C.fluid_synth_all_sounds_off(synth, ch)
  ret
end

#synth_alloc_voice(synth = self.synth, sample:, ch:, key:, vel:) ⇒ Object



64
65
66
67
# File 'lib/fiddle_fluidsynth/synth/voice_control.rb', line 64

def synth_alloc_voice( synth=self.synth, sample: , ch: , key: , vel: )
  ret = C.fluid_synth_alloc_voice(synth,sample,ch,key,vel)
  ret
end

#synth_bank_select(synth = self.synth, ch:, bknum:) ⇒ Object

def synth_bank_select( synth: , ch: , bank: )



137
138
139
140
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 137

def synth_bank_select( synth=self.synth, ch: , bknum: )
  ret = C.fluid_synth_bank_select(synth, ch, bknum)
  ret
end

#synth_cc(synth = self.synth, ch:, num:, val:) ⇒ Object

def synth_cc( synth: , ch: , num: , val: )



143
144
145
146
147
148
149
150
151
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 143

def synth_cc( synth=self.synth, ch: , num: , val: )
  ret = nil
  if (num < 0 || num > 127) || ch < 0 || (val < 0 || val > 127)
    ret = FLUID_FAILED
  else
    ret = C.fluid_synth_cc(synth, ch, num, val)
  end
  ret
end

#synth_channel_pressure(synth = self.synth, ch:, val:) ⇒ Object



154
155
156
157
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 154

def synth_channel_pressure( synth=self.synth , ch: , val: )
  ret = C.fluid_synth_channel_pressure(synth, ch, val)
  ret
end

#synth_chorus_on(synth = self.synth, fx_group:, fx_on:) ⇒ Object



126
127
128
129
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 126

def synth_chorus_on( synth=self.synth, fx_group:, fx_on: )
  ret = C.fluid_synth_chorus_on(synth, fx_group, fx_on)
  ret
end

#synth_count_audio_channels(synth = self.synth) ⇒ Object



121
122
123
124
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 121

def synth_count_audio_channels( synth=self.synth )
  ret = C.fluid_synth_count_audio_channels(synth)
  ret
end

#synth_count_audio_groups(synth = self.synth) ⇒ Object



126
127
128
129
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 126

def synth_count_audio_groups( synth=self.synth )
  ret = C.fluid_synth_count_audio_groups(synth)
  ret
end

#synth_count_effects_channels(synth = self.synth) ⇒ Object



131
132
133
134
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 131

def synth_count_effects_channels( synth=self.synth )
  ret = C.fluid_synth_count_effects_channels(synth)
  ret
end

#synth_count_effects_groups(synth = self.synth) ⇒ Object



136
137
138
139
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 136

def synth_count_effects_groups( synth=self.synth )
  ret = C.fluid_synth_count_effects_groups(synth)
  ret
end

#synth_count_midi_channels(synth = self.synth) ⇒ Object



141
142
143
144
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 141

def synth_count_midi_channels( synth=self.synth )
  ret = C.fluid_synth_count_midi_channels(synth)
  ret
end

#synth_deactivate_tuning(synth = self.synth, ch:, apply:) ⇒ Object

Args

apply

TRUE to apply tuning change to active notes, FALSE otherwise



97
98
99
100
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 97

def synth_deactivate_tuning( synth=self.synth, ch: , apply: )
  ret = C.fluid_synth_deactivate_tuning(synth, ch, apply)
  ret
end

#synth_delete(synth = self.synth) ⇒ Object



64
65
66
67
68
# File 'lib/fiddle_fluidsynth/synth/synth.rb', line 64

def synth_delete( synth=self.synth )
  # ret = C.delete_fluid_synth(synth)
  # ret
  self.class.synth_delete(synth)
end

#synth_error(synth = self.synth) ⇒ Object



79
80
81
82
83
# File 'lib/fiddle_fluidsynth/synth/synth.rb', line 79

def synth_error( synth=self.synth )
  deprecated_msg(__method__)
  ret = C.fluid_synth_error(synth)
  ret
end

#synth_get_active_voice_count(synth = self.synth) ⇒ Object



147
148
149
150
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 147

def synth_get_active_voice_count( synth=self.synth )
  ret = C.fluid_synth_get_active_voice_count(synth)
  ret
end

#synth_get_bank_offset(synth = self.synth, sfid:) ⇒ Object



93
94
95
96
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 93

def synth_get_bank_offset( synth=self.synth, sfid: )
  ret = C.fluid_synth_get_bank_sfont(synth, sfid)
  ret
end

#synth_get_basic_channel(synth = self.synth, ch:, basic_ch_out:, mode_out:, val_out:) ⇒ Object

Args



183
184
185
186
187
188
189
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 183

def synth_get_basic_channel( synth=self.synth, ch: ,
                             basic_ch_out: , mode_out: ,
                             val_out: )
  ret = C.fluid_synth_get_basic_channel(
          synth, ch, basic_ch_out, mode_out, val_out)
  ret
end

#synth_get_breath_mode(synth = self.synth, ch:, out_mode:) ⇒ Object



202
203
204
205
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 202

def synth_get_breath_mode( synth=self.synth, ch: , out_mode: )
  ret = C.fluid_synth_get_breath_mode(synth, ch, out_mode)
  ret
end

#synth_get_cc(synth = self.synth, ch:, num:, pval:) ⇒ Object

getters.



160
161
162
163
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 160

def synth_get_cc( synth=self.synth, ch: , num: , pval: )
  ret = C.fluid_synth_get_cc(synth, ch, num, pval)
  ret
end

#synth_get_chorus_depth(synth = self.synth) ⇒ Object



132
133
134
135
136
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 132

def synth_get_chorus_depth( synth=self.synth )
  deprecated_msg_instead('synth_get_chorus_group_depth()', meth: __method__)
  ret = C.fluid_synth_get_chorus_depth(synth)
  ret
end

#synth_get_chorus_group_depth(synth = self.synth, fx_group:, depth_ms:) ⇒ Object



138
139
140
141
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 138

def synth_get_chorus_group_depth( synth=self.synth, fx_group: , depth_ms: )
  ret = C.fluid_synth_get_chorus_group_depth(synth, fx_group, fx_on)
  ret
end

#synth_get_chorus_group_level(synth = self.synth, fx_group:, level:) ⇒ Object



143
144
145
146
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 143

def synth_get_chorus_group_level( synth=self.synth, fx_group: , level: )
  ret = C.fluid_synth_get_chorus_group_level(synth, fx_group, fx_on)
  ret
end

#synth_get_chorus_group_nr(synth = self.synth, fx_group:, nr:) ⇒ Object



148
149
150
151
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 148

def synth_get_chorus_group_nr( synth=self.synth, fx_group: , nr: )
  ret = C.fluid_synth_get_chorus_group_nr(synth, fx_group, nr)
  ret
end

#synth_get_chorus_group_speed(synth = self.synth, fx_group:, speed:) ⇒ Object



153
154
155
156
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 153

def synth_get_chorus_group_speed( synth=self.synth, fx_group: , speed: )
  ret = C.fluid_synth_get_chorus_group_speed(synth, fx_group, speed)
  ret
end

#synth_get_chorus_group_type(synth = self.synth, fx_group:, type:) ⇒ Object



158
159
160
161
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 158

def synth_get_chorus_group_type( synth=self.synth, fx_group: , type: )
  ret = C.fluid_synth_get_chorus_group_level(synth, fx_group, fx_on)
  ret
end

#synth_get_chorus_level(synth = self.synth) ⇒ Object



163
164
165
166
167
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 163

def synth_get_chorus_level( synth=self.synth )
  deprecated_msg_instead('synth_get_chorus_group_level()', meth: __method__)
  ret = C.fluid_synth_get_chorus_level(synth)
  ret
end

#synth_get_chorus_nr(synth = self.synth) ⇒ Object



169
170
171
172
173
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 169

def synth_get_chorus_nr( synth=self.synth )
  deprecated_msg_instead('synth_get_chorus_group_nr()', meth: __method__)
  ret = C.fluid_synth_get_chorus_nr(synth)
  ret
end

#synth_get_chorus_speed(synth = self.synth) ⇒ Object



175
176
177
178
179
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 175

def synth_get_chorus_speed( synth=self.synth )
  deprecated_msg_instead('synth_get_chorus_group_speed()', meth: __method__)
  ret = C.fluid_synth_get_chorus_speed(synth)
  ret
end

#synth_get_chorus_type(synth = self.synth) ⇒ Object



181
182
183
184
185
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 181

def synth_get_chorus_type( synth=self.synth )
  deprecated_msg_instead('synth_get_chorus_group_type()', meth: __method__)
  ret = C.fluid_synth_get_chorus_type(synth)
  ret
end

#synth_get_cpu_load(synth = self.synth) ⇒ Object



86
87
88
89
# File 'lib/fiddle_fluidsynth/synth/synth.rb', line 86

def synth_get_cpu_load( synth=self.synth )
  ret = C.fluid_synth_get_cpu_load(synth)
  ret
end

#synth_get_gain(synth = self.synth) ⇒ Object



152
153
154
155
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 152

def synth_get_gain( synth=self.synth )
  ret = C.fluid_synth_get_gain(synth)
  ret
end

#synth_get_gen(synth = self.synth, ch:, param:) ⇒ Object



165
166
167
168
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 165

def synth_get_gen( synth=self.synth, ch: , param: )
  ret = C.fluid_synth_get_gen(synth, ch, param)
  ret
end

#synth_get_internal_bufsize(synth = self.synth) ⇒ Object



157
158
159
160
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 157

def synth_get_internal_bufsize( synth=self.synth )
  ret = C.fluid_synth_get_internal_bufsize(synth)
  ret
end

#synth_get_legato_mode(synth = self.synth, ch:, out_mode:) ⇒ Object



214
215
216
217
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 214

def synth_get_legato_mode( synth=self.synth, ch: , out_mode: )
  ret = C.fluid_synth_get_legato_mode(synth, ch, out_mode)
  ret
end

#synth_get_pitch_bend(synth = self.synth, ch:, ppitch_bend:) ⇒ Object



170
171
172
173
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 170

def synth_get_pitch_bend( synth=self.synth, ch: , ppitch_bend: )
  ret = C.fluid_synth_get_pitch_bend(synth, ch, ppitch_bend)
  ret
end

#synth_get_pitch_wheel_sens(synth = self.synth, ch:, pval:) ⇒ Object



175
176
177
178
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 175

def synth_get_pitch_wheel_sens( synth=self.synth, ch: , pval: )
  ret = C.fluid_synth_get_pitch_wheel_sens(synth, ch, pval)
  ret
end

#synth_get_polyphony(synth = self.synth) ⇒ Object



162
163
164
165
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 162

def synth_get_polyphony( synth=self.synth )
  ret = C.fluid_synth_get_polyphony(synth)
  ret
end

#synth_get_portamento_mode(synth = self.synth, ch:, out_mode:) ⇒ Object



226
227
228
229
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 226

def synth_get_portamento_mode( synth=self.synth, ch: , out_mode: )
  ret = C.fluid_synth_get_portamento_mode(synth, ch, out_mode)
  ret
end

#synth_get_program(synth = self.synth, ch:, sfid:, bknum:, prenum:) ⇒ Object



180
181
182
183
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 180

def synth_get_program( synth=self.synth, ch: , sfid: , bknum: , prenum: )
  ret = C.fluid_synth_get_program(synth, ch, sfid, bknum, prenum)
  ret
end

#synth_get_reverb_damp(synth = self.synth) ⇒ Object



106
107
108
109
110
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 106

def synth_get_reverb_damp( synth=self.synth )
  deprecated_msg_instead('synth_get_reverb_group_damp()', meth: __method__)
  ret = C.fluid_synth_get_reverb_damp(synth)
  ret
end

#synth_get_reverb_group_damp(synth = self.synth, fx_group:, damping:) ⇒ Object



128
129
130
131
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 128

def synth_get_reverb_group_damp( synth=self.synth, fx_group: , damping: )
  ret = C.fluid_synth_get_reverb_group_damp(synth,fx_group,damping)
  ret
end

#synth_get_reverb_group_level(synth = self.synth, fx_group:, level:) ⇒ Object



132
133
134
135
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 132

def synth_get_reverb_group_level( synth=self.synth, fx_group: , level: )
  ret = C.fluid_synth_get_reverb_group_level(synth,fx_group,damping)
  ret
end

#synth_get_reverb_group_roomsize(synth = self.synth, fx_group:, roomsize:) ⇒ Object



136
137
138
139
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 136

def synth_get_reverb_group_roomsize( synth=self.synth, fx_group: , roomsize: )
  ret = C.fluid_synth_get_reverb_group_roomsize(synth,fx_group,damping)
  ret
end

#synth_get_reverb_group_width(synth = self.synth, fx_group:, width:) ⇒ Object



140
141
142
143
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 140

def synth_get_reverb_group_width( synth=self.synth, fx_group: , width: )
  ret = C.fluid_synth_get_reverb_group_width(synth,fx_group,damping)
  ret
end

#synth_get_reverb_level(synth = self.synth) ⇒ Object



111
112
113
114
115
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 111

def synth_get_reverb_level( synth=self.synth )
  deprecated_msg_instead('synth_get_reverb_group_level()', meth: __method__)
  ret = C.fluid_synth_get_reverb_level(synth)
  ret
end

#synth_get_reverb_roomsize(synth = self.synth) ⇒ Object



116
117
118
119
120
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 116

def synth_get_reverb_roomsize( synth=self.synth )
  deprecated_msg_instead('synth_get_reverb_group_roomsize()', meth: __method__)
  ret = C.fluid_synth_get_reverb_roomsize(synth)
  ret
end

#synth_get_reverb_width(synth = self.synth) ⇒ Object



121
122
123
124
125
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 121

def synth_get_reverb_width( synth=self.synth )
  deprecated_msg_instead('synth_get_reverb_group_width()', meth: __method__)
  ret = C.fluid_synth_get_reverb_width(synth)
  ret
end

#synth_get_settings(synth = self.synth) ⇒ Object



458
459
460
# File 'lib/fiddle_fluidsynth/settings/settings.rb', line 458

def synth_get_settings( synth = self.synth )
  self.class.synth_get_settings(synth)
end

#synth_get_sfont(synth = self.synth, num:) ⇒ Object

See Also

  • soundfonts/loader.rb/‘.#sfont_new()`



102
103
104
105
106
107
108
109
110
111
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 102

def synth_get_sfont( synth=self.synth, num: )
  ret = C.fluid_synth_get_sfont(synth, num)
  # ret.extend(Interface::SoundFont)
  if ret.nil? || ret.null?
    ret = nil
  else
    ret.extend(Interface::SoundFont)
  end
  ret
end

#synth_get_sfont_by_id(synth = self.synth, id:) ⇒ Object

See Also

  • soundfonts/loader.rb/‘.#sfont_new()`

def synth_get_sfont_by_id( synth: , id: )



118
119
120
121
122
123
124
125
126
127
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 118

def synth_get_sfont_by_id( synth=self.synth, id: )
  ret = C.fluid_synth_get_sfont_by_id(synth, id)
  # ret.extend(Interface::SoundFont)
  if ret.nil? || ret.null?
    ret = nil
  else
    ret.extend(Interface::SoundFont)
  end
  ret
end

#synth_get_sfont_by_name(synth = self.synth, name:) ⇒ Object

See Also

  • soundfonts/loader.rb/‘.#sfont_new()`



133
134
135
136
137
138
139
140
141
142
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 133

def synth_get_sfont_by_name( synth=self.synth, name: )
  ret = C.fluid_synth_get_sfont_by_name(synth, name)
  # ret.extend(Interface::SoundFont)
  if ret.nil? || ret.null?
    ret = nil
  else
    ret.extend(Interface::SoundFont)
  end
  ret
end

#synth_get_voicelist(synth = self.synth, buf:, bufsize:, id:) ⇒ Object



69
70
71
72
# File 'lib/fiddle_fluidsynth/synth/voice_control.rb', line 69

def synth_get_voicelist( synth=self.synth, buf: , bufsize: , id: )
  ret = C.fluid_synth_get_voicelist(synth,buf,bufsize,id)
  ret
end

#synth_handle_midi_event(data, event) ⇒ Object



63
64
65
# File 'lib/fiddle_fluidsynth/midi_input/midi_input.rb', line 63

def synth_handle_midi_event( data, event )
  self.class.synth_handle_midi_event(data, event)
end

#synth_key_pressure(synth = self.synth, ch:, key:, val:) ⇒ Object



186
187
188
189
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 186

def synth_key_pressure( synth=self.synth, ch: , key: , val: )
  ret = C.fluid_synth_key_pressure(synth, ch, key, val)
  ret
end

#synth_ladspa_get_ladspa_fx(synth = self.synth) ⇒ Object



163
164
165
166
# File 'lib/fiddle_fluidsynth/synth/effect/ladspa.rb', line 163

def synth_ladspa_get_ladspa_fx( synth=self.synth )
  ret = C.fluid_synth_get_ladspa_fx(synth)
  ret
end

#synth_new(settings = self.settings) ⇒ Object



55
56
57
58
# File 'lib/fiddle_fluidsynth/synth/synth.rb', line 55

def synth_new( settings=self.settings )
  # ret = C.new_fluid_synth(settings)
  self.class.synth_new(settings)
end

#synth_noteoff(synth = self.synth, ch:, key:) ⇒ Object

def synth_noteoff( synth: , ch: , key: )



192
193
194
195
196
197
198
199
200
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 192

def synth_noteoff( synth=self.synth, ch: , key: )
  ret = nil
  if (key < 0 || key > 127) || (ch < 0)
    ret = FLUID_FAILED
  else
    ret = C.fluid_synth_noteoff(synth, ch, key)
  end
  ret
end

#synth_noteon(synth = self.synth, ch:, key:, vel:) ⇒ Object

def synth_noteon( synth: , ch: , key: , vel: )



203
204
205
206
207
208
209
210
211
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 203

def synth_noteon( synth=self.synth, ch: , key: , vel: )
  ret = nil
  if (key < 0 || key > 127) || ch < 0 || (vel < 0 || vel > 127)
    ret = FLUID_FAILED
  else
    ret = C.fluid_synth_noteon(synth, ch, key, vel)
  end
  ret
end

#synth_nwrite_float(synth = self.synth, len:, left:, right:, fx_left:, fx_right:) ⇒ Object



64
65
66
67
68
69
70
71
# File 'lib/fiddle_fluidsynth/synth/audio_rendering.rb', line 64

def synth_nwrite_float( synth=self.synth,
                        len: , left: , right: , fx_left: , fx_right: )
  deprecated_msg_instead('fluid_synth_process()', meth: __method__)

  ret = C.fluid_synth_nwrite_float(
          synth, len, left,right, fx_left,fx_right)
  ret
end

#synth_pin_preset(synth = self.synth, sfid:, bknum:, prenum:) ⇒ Object



52
53
54
55
# File 'lib/fiddle_fluidsynth/soundfonts/soundfonts.rb', line 52

def synth_pin_preset( synth=self.synth, sfid: , bknum: , prenum: )
  ret = C.fluid_synth_pin_preset(synth, sfid, bknum, prenum)
  ret
end

#synth_pitch_bend(synth = self.synth, ch:, val:) ⇒ Object

Args

val

8192 is the middle value (see the ref).



216
217
218
219
220
221
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 216

def synth_pitch_bend( synth=self.synth, ch: , val: )
  _val = val + 8192

  ret = C.fluid_synth_pitch_bend(synth, ch, _val)
  ret
end

#synth_pitch_wheel_sens(synth = self.synth, ch:, val:) ⇒ Object

def synth_pitch_wheel_sens( synth: , ch: , val: )



224
225
226
227
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 224

def synth_pitch_wheel_sens( synth=self.synth, ch: , val: )
  ret = C.fluid_synth_pitch_wheel_sens(synth, ch, val)
  ret
end

#synth_process(synth = self.synth, len:, nfx:, fx:, nout:, outbuf:) ⇒ Object



73
74
75
76
77
78
# File 'lib/fiddle_fluidsynth/synth/audio_rendering.rb', line 73

def synth_process( synth=self.synth,
                   len: , nfx: , fx: , nout: , outbuf: )
  ret = C.fluid_synth_process(
          synth, len, nfx,fx, nout,outbuf)
  ret
end

#synth_program_change(synth = self.synth, ch:, pgnum:) ⇒ Object

def synth_program_change( synth: , ch: , prog_num: )



233
234
235
236
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 233

def synth_program_change( synth=self.synth, ch: , pgnum: )
  ret = C.fluid_synth_program_change(synth, ch, pgnum)
  ret
end

#synth_program_reset(synth = self.synth) ⇒ Object



238
239
240
241
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 238

def synth_program_reset( synth = self.synth )
  ret = C.fluid_synth_program_reset(synth)
  ret
end

#synth_program_select(synth = self.synth, ch:, sfid:, bknum:, prenum:) ⇒ Object

def synth_program_select( synth: , ch: , sfid: , bknum: , prenum: )



243
244
245
246
247
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 243

def synth_program_select( synth=self.synth, ch: , sfid: , bknum: , prenum: )
  ret = C.fluid_synth_program_select(
          synth, ch, sfid, bknum, prenum)
  ret
end

#synth_program_select_by_sfont_name(synth = self.synth, ch:, sfont_name:, bknum:, prenum:) ⇒ Object



249
250
251
252
253
254
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 249

def synth_program_select_by_sfont_name( synth=self.synth, ch: ,
                                        sfont_name: , bknum: , prenum: )
  ret = C.fluid_synth_program_select_by_sfont_name(
          synth, ch, sfont_name, bknum, prenum)
  ret
end

#synth_remove_default_mod(synth = self.synth, mod:) ⇒ Object



168
169
170
171
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 168

def synth_remove_default_mod( synth=self.synth, mod: )
  ret = C.fluid_synth_remove_default_mod(synth, mod)
  ret
end

#synth_remove_sfont(synth = self.synth, sfont:) ⇒ Object



145
146
147
148
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 145

def synth_remove_sfont( synth=self.synth, sfont: )
  ret = C.fluid_synth_remove_sfont(synth,sfont)
  ret
end

#synth_reset_basic_channel(synth = self.synth, ch:) ⇒ Object

Basic Channel Mode.



175
176
177
178
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 175

def synth_reset_basic_channel( synth=self.synth, ch: )
  ret = C.fluid_synth_reset_basic_channel(synth, ch)
  ret
end

#synth_reverb_on(synth = self.synth, fx_group:, on:) ⇒ Object



146
147
148
149
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 146

def synth_reverb_on( synth=self.synth, fx_group: , on: )
  ret = C.fluid_synth_reverb_on(synth,fx_group,on)
  ret
end

#synth_set_bank_offset(synth = self.synth, sfid:, offset:) ⇒ Object



151
152
153
154
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 151

def synth_set_bank_offset( synth=self.synth, sfid: , offset: )
  ret = C.fluid_synth_set_bank_offset(synth, sfid, offset)
  ret
end

#synth_set_basic_channel(synth = self.synth, ch:, mode:, val:) ⇒ Object



190
191
192
193
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 190

def synth_set_basic_channel( synth=self.synth, ch: , mode: , val: )
  ret = C.fluid_synth_set_basic_channel(synth, ch, mode, val)
  ret
end

#synth_set_breath_mode(synth = self.synth, ch:, breath_mode:) ⇒ Object

Breath Mode.



198
199
200
201
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 198

def synth_set_breath_mode( synth=self.synth, ch: , breath_mode: )
  ret = C.fluid_synth_set_breath_mode(synth, ch, breath_mode)
  ret
end

#synth_set_channel_type(synth = self.synth, ch:, type:) ⇒ Object

Channel Type



167
168
169
170
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 167

def synth_set_channel_type( synth=self.synth, ch: , type: )
  ret = C.fluid_synth_set_channel_type(synth, ch, type)
  ret
end

#synth_set_chorus(synth = self.synth, nr:, level:, speed:, depth_ms:, type:) ⇒ Object



191
192
193
194
195
196
197
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 191

def synth_set_chorus( synth=self.synth,
                      nr: , level: , speed: , depth_ms: , type: )
  deprecated_msg_instead(
    'the individual chorus setter functions', meth: __method__)
  ret = C.fluid_synth_set_chorus(synth, nr,level,speed,depth_ms,type)
  ret
end

#synth_set_chorus_depth(synth = self.synth, depth_ms:) ⇒ Object



200
201
202
203
204
205
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 200

def synth_set_chorus_depth( synth=self.synth, depth_ms: )
  deprecated_msg_instead(
    'synth_set_chorus_group_depth()', meth: __method__)
  ret = C.fluid_synth_set_chorus_depth(synth, depth_ms)
  ret
end

#synth_set_chorus_group_depth(synth = self.synth, fx_group:, depth_ms:) ⇒ Object

for group.



240
241
242
243
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 240

def synth_set_chorus_group_depth( synth=self.synth, fx_group: , depth_ms: )
  ret = C.fluid_synth_set_chorus_group_depth(synth, fx_group, depth_ms)
  ret
end

#synth_set_chorus_group_level(synth = self.synth, fx_group:, level:) ⇒ Object



245
246
247
248
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 245

def synth_set_chorus_group_level( synth=self.synth, fx_group: , level: )
  ret = C.fluid_synth_set_chorus_group_level(synth, fx_group, level)
  ret
end

#synth_set_chorus_group_nr(synth = self.synth, fx_group:, nr:) ⇒ Object



250
251
252
253
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 250

def synth_set_chorus_group_nr( synth=self.synth, fx_group: , nr: )
  ret = C.fluid_synth_set_chorus_group_nr(synth, fx_group, nr)
  ret
end

#synth_set_chorus_group_speed(synth = self.synth, fx_group:, speed:) ⇒ Object



255
256
257
258
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 255

def synth_set_chorus_group_speed( synth=self.synth, fx_group: , speed: )
  ret = C.fluid_synth_set_chorus_group_speed(synth, fx_group, speed)
  ret
end

#synth_set_chorus_group_type(synth = self.synth, fx_group:, type:) ⇒ Object



260
261
262
263
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 260

def synth_set_chorus_group_type( synth=self.synth, fx_group: , type: )
  ret = C.fluid_synth_set_chorus_group_type(synth, fx_group, type)
  ret
end

#synth_set_chorus_level(synth = self.synth, level:) ⇒ Object



206
207
208
209
210
211
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 206

def synth_set_chorus_level( synth=self.synth, level: )
  deprecated_msg_instead(
    'synth_set_chorus_group_level()', meth: __method__)
  ret = C.fluid_synth_set_chorus_level(synth, level)
  ret
end

#synth_set_chorus_nr(synth = self.synth, nr:) ⇒ Object



212
213
214
215
216
217
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 212

def synth_set_chorus_nr( synth=self.synth, nr: )
  deprecated_msg_instead(
    'synth_set_chorus_group_nr()', meth: __method__)
  ret = C.fluid_synth_set_chorus_nr(synth, nr)
  ret
end

#synth_set_chorus_on(synth = self.synth, on:) ⇒ Object



232
233
234
235
236
237
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 232

def synth_set_chorus_on( synth=self.synth, on: )
  deprecated_msg_instead(
    'synth_chorus_on()', meth: __method__)
  ret = C.fluid_synth_set_chorus_on(synth, on)
  ret
end

#synth_set_chorus_speed(synth = self.synth, speed:) ⇒ Object



218
219
220
221
222
223
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 218

def synth_set_chorus_speed( synth=self.synth, speed: )
  deprecated_msg_instead(
    'synth_set_chorus_group_speed()', meth: __method__)
  ret = C.fluid_synth_set_chorus_speed(synth,speed)
  ret
end

#synth_set_chorus_type(synth = self.synth, type:) ⇒ Object



224
225
226
227
228
229
# File 'lib/fiddle_fluidsynth/synth/effect/chorus.rb', line 224

def synth_set_chorus_type( synth=self.synth, type: )
  deprecated_msg_instead(
    'synth_set_chorus_group_type()', meth: __method__)
  ret = C.fluid_synth_set_chorus_type(synth, type)
  ret
end

#synth_set_custom_filter(synth = self.synth, type:, flags:) ⇒ Object

Args

type

fluid_iir_filter_type.

flags

fluid_iir_filter_flag.



73
74
75
76
# File 'lib/fiddle_fluidsynth/synth/effect/iir_filter.rb', line 73

def synth_set_custom_filter( synth=self.synth, type: , flags: )
  ret = C.fluid_synth_set_custom_filter(synth,type,flags)
  ret
end

#synth_set_gain(synth = self.synth, gain:) ⇒ Object



173
174
175
176
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 173

def synth_set_gain( synth=self.synth, gain: )
  ret = C.fluid_synth_set_gain(synth, gain)
  ret
end

#synth_set_gen(synth = self.synth, ch:, param:, val:) ⇒ Object

def synth_set_gen( synth: , ch: , param: , val: )



258
259
260
261
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 258

def synth_set_gen( synth=self.synth, ch: , param: , val: )
  ret = C.fluid_synth_set_gen(synth, ch, param, val)
  ret
end

#synth_set_interp_method(synth = self.synth, ch:, interp_method:) ⇒ Object



178
179
180
181
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 178

def synth_set_interp_method( synth=self.synth, ch: , interp_method: )
  ret = C.fluid_synth_set_interp_method(synth, ch, interp_method)
  ret
end

#synth_set_legato_mode(synth = self.synth, ch:, legato_mode:) ⇒ Object

Legato Mode.



210
211
212
213
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 210

def synth_set_legato_mode( synth=self.synth, ch: , legato_mode: )
  ret = C.fluid_synth_set_legato_mode(synth, ch, legato_mode)
  ret
end

#synth_set_polyphony(synth = self.synth, polyphony:) ⇒ Object



183
184
185
186
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 183

def synth_set_polyphony( synth=self.synth, polyphony: )
  ret = C.fluid_synth_set_polyphony(synth, polyphony)
  ret
end

#synth_set_portamento_mode(synth = self.synth, ch:, portamento_mode:) ⇒ Object

Portamento Mode.



222
223
224
225
# File 'lib/fiddle_fluidsynth/synth/midi/setup.rb', line 222

def synth_set_portamento_mode( synth=self.synth, ch: , portamento_mode: )
  ret = C.fluid_synth_set_portamento_mode(synth, ch, portamento_mode)
  ret
end

#synth_set_reverb(synth = self.synth, roomsize:, damping:, width:, level:) ⇒ Object

setters.



152
153
154
155
156
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 152

def synth_set_reverb( synth=self.synth, roomsize: , damping: , width: , level: )
  deprecated_msg_instead('the individual setter functions', meth: __method__)
  ret = C.fluid_synth_set_reverb(synth,roomsize,damping,width,level)
  ret
end

#synth_set_reverb_damp(synth = self.synth, damping:) ⇒ Object



159
160
161
162
163
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 159

def synth_set_reverb_damp( synth=self.synth, damping: )
  deprecated_msg_instead('synth_set_reverb_group_damp()', meth: __method__)
  ret = C.fluid_synth_set_reverb_damp(synth,damping)
  ret
end

#synth_set_reverb_group_damp(synth = self.synth, fx_group:, damping:) ⇒ Object

setters for group.



186
187
188
189
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 186

def synth_set_reverb_group_damp( synth=self.synth, fx_group: , damping: )
  ret = C.fluid_synth_set_reverb_group_damp(synth,fx_group,damping)
  ret
end

#synth_set_reverb_group_level(synth = self.synth, fx_group:, level:) ⇒ Object



190
191
192
193
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 190

def synth_set_reverb_group_level( synth=self.synth, fx_group: , level: )
  ret = C.fluid_synth_set_reverb_group_level(synth,fx_group,level)
  ret
end

#synth_set_reverb_group_roomsize(synth = self.synth, fx_group:, roomsize:) ⇒ Object



194
195
196
197
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 194

def synth_set_reverb_group_roomsize( synth=self.synth, fx_group: , roomsize: )
  ret = C.fluid_synth_set_reverb_group_roomsize(synth,fx_group,roomsize)
  ret
end

#synth_set_reverb_group_width(synth = self.synth, fx_group:, width:) ⇒ Object



198
199
200
201
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 198

def synth_set_reverb_group_width( synth=self.synth, fx_group: , width: )
  ret = C.fluid_synth_set_reverb_group_width(synth,fx_group,width)
  ret
end

#synth_set_reverb_level(synth = self.synth, level:) ⇒ Object



164
165
166
167
168
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 164

def synth_set_reverb_level( synth=self.synth, level: )
  deprecated_msg_instead('synth_set_reverb_group_level()', meth: __method__)
  ret = C.fluid_synth_set_reverb_level(synth,level)
  ret
end

#synth_set_reverb_on(synth = self.synth, inton:) ⇒ Object



169
170
171
172
173
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 169

def synth_set_reverb_on( synth=self.synth, inton: )
  deprecated_msg_instead('synth_reverb_on()', meth: __method__)
  ret = C.fluid_synth_set_reverb_roomsize(synth, inton)
  ret
end

#synth_set_reverb_roomsize(synth = self.synth, roomsize:) ⇒ Object



174
175
176
177
178
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 174

def synth_set_reverb_roomsize( synth=self.synth, roomsize: )
  deprecated_msg_instead('synth_set_reverb_group_roomsize()', meth: __method__)
  ret = C.fluid_synth_set_reverb_roomsize(synth,roomsize)
  ret
end

#synth_set_reverb_width(synth = self.synth, width:) ⇒ Object



179
180
181
182
183
# File 'lib/fiddle_fluidsynth/synth/effect/reverb.rb', line 179

def synth_set_reverb_width( synth=self.synth, width: )
  deprecated_msg_instead('synth_set_reverb_group_width()', meth: __method__)
  ret = C.fluid_synth_set_reverb_width(synth,width)
  ret
end

#synth_set_sample_rate(synth = self.synth, sample_rate:) ⇒ Object



191
192
193
194
195
# File 'lib/fiddle_fluidsynth/synth/params/params.rb', line 191

def synth_set_sample_rate( synth=self.synth, sample_rate: )
  deprecated_msg(__method__)
  ret = C.fluid_synth_set_sample_rate(synth, sample_rate)
  ret
end

#synth_sfcount(synth = self.synth) ⇒ Object

See Also

  • #synth_sfload()



160
161
162
163
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 160

def synth_sfcount( synth = self.synth )
  ret = C.fluid_synth_sfcount(synth)
  ret
end

#synth_sfload(synth = self.synth, filename:, reset_presets: self.reset_presets, verbose_f: false) ⇒ Object

def synth_sfload( synth: , filename: , reset_presets: )



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 167

def synth_sfload( synth=self.synth,
                  filename: , reset_presets: self.reset_presets,
                  verbose_f: false )
  #
  $stderr.print "(**) loading SoundFont: #{filename}..." if verbose_f
  if reset_presets
    _reset_presets = 1
  else
    _reset_presets = 0
  end

  ret = C.fluid_synth_sfload(synth,filename, _reset_presets)
  if ret == FLUID_FAILED
    $stderr.puts
    raise "Cannot load soundfont: #{self.soundfont_full_path}"
  else
    $stderr.puts " ok (#{ret})."
  end

  @sfid_last = ret
  @sfid_ary << @sfid_last

  $stderr.puts "(**) @sfid_ary: #{@sfid_ary} (SoundFont count:" +
    " #{self.synth_sfcount(synth)}/synth: 0x#{synth.to_i.to_s(16)})" if verbose_f

  ret
end

#synth_sfont_select(synth = self.synth, ch:, sfid:) ⇒ Object

def synth_sfont_select( synth: , ch: , sfid: )



264
265
266
267
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 264

def synth_sfont_select( synth=self.synth, ch: , sfid: )
  ret = C.fluid_synth_sfont_select(synth, ch, sfid)
  ret
end

#synth_sfreload(synth = self.synth, id: self.sfid) ⇒ Object



195
196
197
198
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 195

def synth_sfreload( synth=self.synth, id: self.sfid)
  ret = C.fluid_synth_sfreload(synth,id)
  ret
end

#synth_sfunload(synth = self.synth, id: self.sfid, reset_presets: self.reset_presets) ⇒ Object



200
201
202
203
204
# File 'lib/fiddle_fluidsynth/synth/soundfont_management.rb', line 200

def synth_sfunload( synth=self.synth, id: self.sfid,
                    reset_presets: self.reset_presets )
  ret = C.fluid_synth_sfunload(synth,id,reset_presets)
  ret
end

#synth_start(synth = self.synth, id:, preset:, audio_ch:, ch:, key:, vel:) ⇒ Object



74
75
76
77
78
# File 'lib/fiddle_fluidsynth/synth/voice_control.rb', line 74

def synth_start( synth=self.synth,
                 id: , preset: , audio_ch: , ch: , key: , vel: )
  ret = C.fluid_synth_start(synth, id, preset, audio_ch, ch, key, vel)
  ret
end

#synth_start_voice(synth = self.synth, voice:) ⇒ Object



80
81
82
83
# File 'lib/fiddle_fluidsynth/synth/voice_control.rb', line 80

def synth_start_voice( synth=self.synth, voice: )
  ret = C.fluid_synth_start_voice(synth, voice)
  ret
end

#synth_stop(synth = self.synth, voice_id:) ⇒ Object



85
86
87
88
# File 'lib/fiddle_fluidsynth/synth/voice_control.rb', line 85

def synth_stop( synth=self.synth, voice_id: )
  ret = C.fluid_synth_stop(synth, voice_id)
  ret
end

#synth_sysex(synth = self.synth, data:, len:, response:, response_len:, handled:, dryrun:) ⇒ Object



269
270
271
272
273
274
275
276
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 269

def synth_sysex( synth=self.synth,
                 data: , len: ,
                 response: , response_len: , handled: , dryrun: )
  ret = C.fluid_synth_sysex(synth, data,len,
                            response,response_len,
                            handled, dryrun)
  ret
end

#synth_system_reset(synth = self.synth) ⇒ Object



278
279
280
281
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 278

def synth_system_reset( synth = self.synth )
  ret = C.fluid_synth_system_reset(synth)
  ret
end

#synth_tune_notes(synth = self.synth, bknum:, pgnum:, len:, key:, pitch:, apply:) ⇒ Object



102
103
104
105
106
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 102

def synth_tune_notes( synth=self.synth,
                      bknum: , pgnum: , len: , key: , pitch: , apply: )
  ret = C.fluid_synth_tune_notes(synth, bknum, pgnum, len, key, pitch, apply)
  ret
end

#synth_tuning_dump(synth = self.synth, bknum:, pgnum:, name:, len:, pitch:) ⇒ Object



108
109
110
111
112
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 108

def synth_tuning_dump( synth=self.synth,
                       bknum: , pgnum: , name: , len: , pitch: )
  ret = C.fluid_synth_tuning_dump(synth, bknum, pgnum, name, len, pitch)
  ret
end

#synth_tuning_iteration_next(synth = self.synth, bknum:, pgnum:) ⇒ Object



114
115
116
117
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 114

def synth_tuning_iteration_next( synth=self.synth, bknum: ,  pgnum: )
  ret = C.fluid_synth_tuning_iteration_next(synth, bknum, pgnum)
  ret
end

#synth_tuning_iteration_start(synth = self.synth) ⇒ Object



119
120
121
122
# File 'lib/fiddle_fluidsynth/synth/midi/tuning.rb', line 119

def synth_tuning_iteration_start( synth=self.synth )
  ret = C.fluid_synth_tuning_iteration_start(synth)
  ret
end

#synth_unpin_preset(synth = self.synth, sfid:, bknum:, prenum:) ⇒ Object



56
57
58
59
# File 'lib/fiddle_fluidsynth/soundfonts/soundfonts.rb', line 56

def synth_unpin_preset( synth=self.synth, sfid: , bknum: , prenum: )
  ret = C.fluid_synth_unpin_preset(synth, sfid, bknum, prenum)
  ret
end

#synth_unset_program(synth = self.synth, ch:) ⇒ Object



283
284
285
286
# File 'lib/fiddle_fluidsynth/synth/midi/messages.rb', line 283

def synth_unset_program( synth=self.synth, ch: )
  ret = C.fluid_synth_unset_program(synth, ch)
  ret
end

#synth_write_float(synth = self.synth, len:, lout:, loff:, lincr:, rout:, roff:, rincr:) ⇒ Object



80
81
82
83
84
85
86
# File 'lib/fiddle_fluidsynth/synth/audio_rendering.rb', line 80

def synth_write_float( synth=self.synth,
                       len: , lout: , loff: , lincr: ,
                              rout: , roff: , rincr: )
  ret = C.fluid_synth_write_float(
          synth, len, lout,loff,lincr, rout,roff,rincr )
  ret
end

#synth_write_s16(synth = self.synth, len:, lout:, loff:, lincr:, rout:, roff:, rincr:) ⇒ Object



88
89
90
91
92
93
94
# File 'lib/fiddle_fluidsynth/synth/audio_rendering.rb', line 88

def synth_write_s16( synth=self.synth,
                     len: , lout: , loff: , lincr: ,
                            rout: , roff: , rincr: )
  ret = C.fluid_synth_write_s16(
          synth, len, lout,loff,lincr, rout,roff,rincr)
  ret
end

#system_reset(synth = self.synth) ⇒ Object

synth/midi/message.rb



422
423
424
425
# File 'lib/fiddle_fluidsynth/util/util.rb', line 422

def system_reset( synth = self.synth )
  # C.fluid_synth_system_reset(synth)
  self.synth_system_reset(synth)
end

#voice_add_mod(voice, mod:, mode:) ⇒ Object



106
107
108
109
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 106

def voice_add_mod( voice, mod: , mode: )
  ret = C.fluid_voice_add_mod(voice,mod,mode)
  ret
end

#voice_gen_get(voice, gen:) ⇒ Object



111
112
113
114
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 111

def voice_gen_get( voice, gen: )
  ret = C.fluid_voice_gen_get(voice,gen)
  ret
end

#voice_gen_incr(voice, i:, val:) ⇒ Object



115
116
117
118
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 115

def voice_gen_incr( voice, i: , val: )
  ret = C.fluid_voice_gen_get(voice, i, val)
  ret
end

#voice_gen_set(voice, i:, val:) ⇒ Object



119
120
121
122
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 119

def voice_gen_set( voice, i: , val: )
  ret = C.fluid_voice_gen_get(voice,i,val)
  ret
end

#voice_get_actual_key(voice) ⇒ Object



124
125
126
127
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 124

def voice_get_actual_key( voice )
  ret = C.fluid_voice_get_actual_key(voice)
  ret
end

#voice_get_actual_velocity(voice) ⇒ Object



128
129
130
131
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 128

def voice_get_actual_velocity( voice )
  ret = C.fluid_voice_get_actual_velocity(voice)
  ret
end

#voice_get_channel(voice) ⇒ Object



132
133
134
135
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 132

def voice_get_channel( voice )
  ret = C.fluid_voice_get_channel(voice)
  ret
end

#voice_get_id(voice) ⇒ Object



136
137
138
139
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 136

def voice_get_id( voice )
  ret = C.fluid_voice_get_id(voice)
  ret
end

#voice_get_key(voice) ⇒ Object



140
141
142
143
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 140

def voice_get_key( voice )
  ret = C.fluid_voice_get_key(voice)
  ret
end

#voice_get_velocity(voice) ⇒ Object



144
145
146
147
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 144

def voice_get_velocity( voice )
  ret = C.fluid_voice_get_velocity(voice)
  ret
end

#voice_is_on(voice) ⇒ Object



150
151
152
153
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 150

def voice_is_on( voice )
  ret = C.fluid_voice_is_on(voice)
  ret
end

#voice_is_playing(voice) ⇒ Object



154
155
156
157
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 154

def voice_is_playing( voice )
  ret = C.fluid_voice_is_playing(voice)
  ret
end

#voice_is_sostenuto(voice) ⇒ Object



158
159
160
161
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 158

def voice_is_sostenuto( voice )
  ret = C.fluid_voice_is_sostenuto(voice)
  ret
end

#voice_is_sustained(voice) ⇒ Object



162
163
164
165
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 162

def voice_is_sustained( voice )
  ret = C.fluid_voice_is_sustained(voice)
  ret
end

#voice_optimize_sample(voice) ⇒ Object



166
167
168
169
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 166

def voice_optimize_sample( voice )
  ret = C.fluid_voice_optimize_sample(voice)
  ret
end

#voice_update_param(voice, gen:) ⇒ Object



170
171
172
173
# File 'lib/fiddle_fluidsynth/soundfonts/voices.rb', line 170

def voice_update_param( voice, gen: )
  ret = C.fluid_voice_update_param(voice, gen)
  ret
end