fiddle_fluidsynth 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.standard.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +138 -0
- data/Rakefile +14 -0
- data/examples/enum.rb +30 -0
- data/examples/example.sf2 +0 -0
- data/examples/ffs_arpeggio.rb +252 -0
- data/examples/ffs_example.rb +47 -0
- data/examples/ffs_fx.rb +200 -0
- data/examples/ffs_metronome.rb +260 -0
- data/examples/ffs_midiplay.rb +122 -0
- data/examples/ffs_simple.rb +45 -0
- data/examples/ffs_test1.rb +41 -0
- data/examples/ffs_test3.rb +50 -0
- data/examples/fiddle-pointer.rb +18 -0
- data/examples/presets-each.rb +66 -0
- data/examples/presets-full_scan.rb +59 -0
- data/examples/settings-each.rb +106 -0
- data/exe/ffs_midiplay.rb +122 -0
- data/lib/fiddle_fluidsynth/audio_output/driver.rb +104 -0
- data/lib/fiddle_fluidsynth/audio_output/file_renderer.rb +84 -0
- data/lib/fiddle_fluidsynth/audio_output.rb +7 -0
- data/lib/fiddle_fluidsynth/command_interface/command_interface.rb +90 -0
- data/lib/fiddle_fluidsynth/command_interface/handler.rb +95 -0
- data/lib/fiddle_fluidsynth/command_interface/server.rb +79 -0
- data/lib/fiddle_fluidsynth/command_interface/shell.rb +76 -0
- data/lib/fiddle_fluidsynth/command_interface.rb +9 -0
- data/lib/fiddle_fluidsynth/core_ext/fiddle.rb +142 -0
- data/lib/fiddle_fluidsynth/core_ext/module.rb +123 -0
- data/lib/fiddle_fluidsynth/fiddle_fluidsynth.rb +172 -0
- data/lib/fiddle_fluidsynth/logging/logging.rb +82 -0
- data/lib/fiddle_fluidsynth/logging.rb +6 -0
- data/lib/fiddle_fluidsynth/midi_input/driver.rb +77 -0
- data/lib/fiddle_fluidsynth/midi_input/events.rb +255 -0
- data/lib/fiddle_fluidsynth/midi_input/midi_input.rb +70 -0
- data/lib/fiddle_fluidsynth/midi_input/player.rb +289 -0
- data/lib/fiddle_fluidsynth/midi_input/router.rb +225 -0
- data/lib/fiddle_fluidsynth/midi_input.rb +11 -0
- data/lib/fiddle_fluidsynth/misc/misc.rb +162 -0
- data/lib/fiddle_fluidsynth/misc.rb +6 -0
- data/lib/fiddle_fluidsynth/sequencer/events.rb +679 -0
- data/lib/fiddle_fluidsynth/sequencer/sequencer.rb +384 -0
- data/lib/fiddle_fluidsynth/sequencer.rb +7 -0
- data/lib/fiddle_fluidsynth/settings/settings.rb +465 -0
- data/lib/fiddle_fluidsynth/settings.rb +6 -0
- data/lib/fiddle_fluidsynth/soundfonts/generators.rb +128 -0
- data/lib/fiddle_fluidsynth/soundfonts/loader.rb +506 -0
- data/lib/fiddle_fluidsynth/soundfonts/modulators.rb +247 -0
- data/lib/fiddle_fluidsynth/soundfonts/soundfonts.rb +64 -0
- data/lib/fiddle_fluidsynth/soundfonts/voices.rb +178 -0
- data/lib/fiddle_fluidsynth/soundfonts.rb +11 -0
- data/lib/fiddle_fluidsynth/synth/audio_rendering.rb +100 -0
- data/lib/fiddle_fluidsynth/synth/effect/chorus.rb +269 -0
- data/lib/fiddle_fluidsynth/synth/effect/iir_filter.rb +81 -0
- data/lib/fiddle_fluidsynth/synth/effect/ladspa.rb +172 -0
- data/lib/fiddle_fluidsynth/synth/effect/reverb.rb +207 -0
- data/lib/fiddle_fluidsynth/synth/effect.rb +10 -0
- data/lib/fiddle_fluidsynth/synth/midi/messages.rb +292 -0
- data/lib/fiddle_fluidsynth/synth/midi/setup.rb +235 -0
- data/lib/fiddle_fluidsynth/synth/midi/tuning.rb +128 -0
- data/lib/fiddle_fluidsynth/synth/midi.rb +9 -0
- data/lib/fiddle_fluidsynth/synth/params/params.rb +200 -0
- data/lib/fiddle_fluidsynth/synth/params.rb +8 -0
- data/lib/fiddle_fluidsynth/synth/soundfont_management.rb +210 -0
- data/lib/fiddle_fluidsynth/synth/synth.rb +114 -0
- data/lib/fiddle_fluidsynth/synth/voice_control.rb +94 -0
- data/lib/fiddle_fluidsynth/synth.rb +18 -0
- data/lib/fiddle_fluidsynth/types/types.rb +131 -0
- data/lib/fiddle_fluidsynth/types.rb +10 -0
- data/lib/fiddle_fluidsynth/util/callback.rb +585 -0
- data/lib/fiddle_fluidsynth/util/interface/settings.rb +689 -0
- data/lib/fiddle_fluidsynth/util/interface/soundfont.rb +115 -0
- data/lib/fiddle_fluidsynth/util/interface/soundfont_preset.rb +69 -0
- data/lib/fiddle_fluidsynth/util/interface/soundfont_sample.rb +61 -0
- data/lib/fiddle_fluidsynth/util/interface.rb +11 -0
- data/lib/fiddle_fluidsynth/util/module_hier.rb +403 -0
- data/lib/fiddle_fluidsynth/util/util.rb +467 -0
- data/lib/fiddle_fluidsynth/util-after.rb +12 -0
- data/lib/fiddle_fluidsynth/util.rb +37 -0
- data/lib/fiddle_fluidsynth/version.rb +10 -0
- data/lib/fiddle_fluidsynth.rb +57 -0
- data/sig/fiddle_fluidsynth.rbs +4 -0
- metadata +128 -0
@@ -0,0 +1,207 @@
|
|
1
|
+
#
|
2
|
+
# filename: synth/effect/reverb.rb
|
3
|
+
#
|
4
|
+
|
5
|
+
|
6
|
+
# References
|
7
|
+
# - [API Reference](https://www.fluidsynth.org/api/modules.html)
|
8
|
+
#
|
9
|
+
class FiddleFluidSynth
|
10
|
+
|
11
|
+
# Functions for configuring the built-in reverb effect.
|
12
|
+
# ==== References
|
13
|
+
# - API Reference, Synthesizer/[Effect - Reverb](https://www.fluidsynth.org/api/group__reverb__effect.html)
|
14
|
+
# - [library fiddle](https://docs.ruby-lang.org/ja/latest/library/fiddle.html)
|
15
|
+
#
|
16
|
+
|
17
|
+
#
|
18
|
+
module C
|
19
|
+
|
20
|
+
# Lifecycle Functions.
|
21
|
+
#
|
22
|
+
#
|
23
|
+
|
24
|
+
|
25
|
+
# Functions.
|
26
|
+
#
|
27
|
+
#
|
28
|
+
|
29
|
+
# Get reverb damping of all fx groups.
|
30
|
+
extern 'double fluid_synth_get_reverb_damp(fluid_synth_t*)'
|
31
|
+
|
32
|
+
# get reverb damp of one or all groups.
|
33
|
+
extern 'int fluid_synth_get_reverb_group_damp(fluid_synth_t*, int, double*)'
|
34
|
+
|
35
|
+
# get reverb level of one or all groups.
|
36
|
+
extern 'int fluid_synth_get_reverb_group_level(fluid_synth_t*, int, double*)'
|
37
|
+
|
38
|
+
# get reverb roomsize of one or all groups.
|
39
|
+
extern 'int fluid_synth_get_reverb_group_roomsize' +
|
40
|
+
'(fluid_synth_t*, int, double*)'
|
41
|
+
|
42
|
+
# get reverb width of one or all groups
|
43
|
+
extern 'int fluid_synth_get_reverb_group_width' +
|
44
|
+
'(fluid_synth_t*, int, double*)'
|
45
|
+
|
46
|
+
# Get reverb level of all fx groups.
|
47
|
+
extern 'double fluid_synth_get_reverb_level(fluid_synth_t*)'
|
48
|
+
|
49
|
+
# Get reverb room size of all fx groups.
|
50
|
+
extern 'double fluid_synth_get_reverb_roomsize(fluid_synth_t*)'
|
51
|
+
|
52
|
+
# Get reverb width of all fx groups.
|
53
|
+
extern 'double fluid_synth_get_reverb_width(fluid_synth_t*)'
|
54
|
+
|
55
|
+
# Enable or disable reverb on one fx group unit.
|
56
|
+
extern 'int fluid_synth_reverb_on(fluid_synth_t*, int, int)'
|
57
|
+
|
58
|
+
# Set reverb parameters to all groups.
|
59
|
+
extern 'int fluid_synth_set_reverb' +
|
60
|
+
'(fluid_synth_t*, double, double, double, double)'
|
61
|
+
|
62
|
+
# Set reverb damping of all groups.
|
63
|
+
extern 'int fluid_synth_set_reverb_damp(fluid_synth_t*, double)'
|
64
|
+
|
65
|
+
# Set reverb damp to one or all fx groups.
|
66
|
+
extern 'int fluid_synth_set_reverb_group_damp(fluid_synth_t*, int, double)'
|
67
|
+
|
68
|
+
# Set reverb level to one or all fx groups.
|
69
|
+
extern 'int fluid_synth_set_reverb_group_level(fluid_synth_t*, int, double)'
|
70
|
+
|
71
|
+
# Set reverb roomsize to one or all fx groups.
|
72
|
+
extern 'int fluid_synth_set_reverb_group_roomsize' +
|
73
|
+
'(fluid_synth_t*, int, double)'
|
74
|
+
|
75
|
+
# Set reverb width to one or all fx groups.
|
76
|
+
extern 'int fluid_synth_set_reverb_group_width(fluid_synth_t*, int, double)'
|
77
|
+
|
78
|
+
# Set reverb level of all groups.
|
79
|
+
extern 'int fluid_synth_set_reverb_level(fluid_synth_t*, double)'
|
80
|
+
|
81
|
+
# Enable or disable reverb effect.
|
82
|
+
extern 'void fluid_synth_set_reverb_on(fluid_synth_t*, int)'
|
83
|
+
|
84
|
+
# Set reverb roomsize of all groups.
|
85
|
+
extern 'int fluid_synth_set_reverb_roomsize(fluid_synth_t*, double)'
|
86
|
+
|
87
|
+
# Set reverb width of all groups.
|
88
|
+
extern 'int fluid_synth_set_reverb_width(fluid_synth_t*, double)'
|
89
|
+
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
|
95
|
+
# Lifecycle Functions.
|
96
|
+
#
|
97
|
+
#
|
98
|
+
|
99
|
+
|
100
|
+
# Functions.
|
101
|
+
#
|
102
|
+
#
|
103
|
+
class FiddleFluidSynth
|
104
|
+
|
105
|
+
#
|
106
|
+
def synth_get_reverb_damp( synth=self.synth )
|
107
|
+
deprecated_msg_instead('synth_get_reverb_group_damp()', meth: __method__)
|
108
|
+
ret = C.fluid_synth_get_reverb_damp(synth)
|
109
|
+
ret
|
110
|
+
end
|
111
|
+
def synth_get_reverb_level( synth=self.synth )
|
112
|
+
deprecated_msg_instead('synth_get_reverb_group_level()', meth: __method__)
|
113
|
+
ret = C.fluid_synth_get_reverb_level(synth)
|
114
|
+
ret
|
115
|
+
end
|
116
|
+
def synth_get_reverb_roomsize( synth=self.synth )
|
117
|
+
deprecated_msg_instead('synth_get_reverb_group_roomsize()', meth: __method__)
|
118
|
+
ret = C.fluid_synth_get_reverb_roomsize(synth)
|
119
|
+
ret
|
120
|
+
end
|
121
|
+
def synth_get_reverb_width( synth=self.synth )
|
122
|
+
deprecated_msg_instead('synth_get_reverb_group_width()', meth: __method__)
|
123
|
+
ret = C.fluid_synth_get_reverb_width(synth)
|
124
|
+
ret
|
125
|
+
end
|
126
|
+
|
127
|
+
#
|
128
|
+
def synth_get_reverb_group_damp( synth=self.synth, fx_group: , damping: )
|
129
|
+
ret = C.fluid_synth_get_reverb_group_damp(synth,fx_group,damping)
|
130
|
+
ret
|
131
|
+
end
|
132
|
+
def synth_get_reverb_group_level( synth=self.synth, fx_group: , level: )
|
133
|
+
ret = C.fluid_synth_get_reverb_group_level(synth,fx_group,damping)
|
134
|
+
ret
|
135
|
+
end
|
136
|
+
def synth_get_reverb_group_roomsize( synth=self.synth, fx_group: , roomsize: )
|
137
|
+
ret = C.fluid_synth_get_reverb_group_roomsize(synth,fx_group,damping)
|
138
|
+
ret
|
139
|
+
end
|
140
|
+
def synth_get_reverb_group_width( synth=self.synth, fx_group: , width: )
|
141
|
+
ret = C.fluid_synth_get_reverb_group_width(synth,fx_group,damping)
|
142
|
+
ret
|
143
|
+
end
|
144
|
+
|
145
|
+
#
|
146
|
+
def synth_reverb_on( synth=self.synth, fx_group: , on: )
|
147
|
+
ret = C.fluid_synth_reverb_on(synth,fx_group,on)
|
148
|
+
ret
|
149
|
+
end
|
150
|
+
|
151
|
+
### setters.
|
152
|
+
def synth_set_reverb( synth=self.synth, roomsize: , damping: , width: , level: )
|
153
|
+
deprecated_msg_instead('the individual setter functions', meth: __method__)
|
154
|
+
ret = C.fluid_synth_set_reverb(synth,roomsize,damping,width,level)
|
155
|
+
ret
|
156
|
+
end
|
157
|
+
|
158
|
+
#
|
159
|
+
def synth_set_reverb_damp( synth=self.synth, damping: )
|
160
|
+
deprecated_msg_instead('synth_set_reverb_group_damp()', meth: __method__)
|
161
|
+
ret = C.fluid_synth_set_reverb_damp(synth,damping)
|
162
|
+
ret
|
163
|
+
end
|
164
|
+
def synth_set_reverb_level( synth=self.synth, level: )
|
165
|
+
deprecated_msg_instead('synth_set_reverb_group_level()', meth: __method__)
|
166
|
+
ret = C.fluid_synth_set_reverb_level(synth,level)
|
167
|
+
ret
|
168
|
+
end
|
169
|
+
def synth_set_reverb_on( synth=self.synth, inton: )
|
170
|
+
deprecated_msg_instead('synth_reverb_on()', meth: __method__)
|
171
|
+
ret = C.fluid_synth_set_reverb_roomsize(synth, inton)
|
172
|
+
ret
|
173
|
+
end
|
174
|
+
def synth_set_reverb_roomsize( synth=self.synth, roomsize: )
|
175
|
+
deprecated_msg_instead('synth_set_reverb_group_roomsize()', meth: __method__)
|
176
|
+
ret = C.fluid_synth_set_reverb_roomsize(synth,roomsize)
|
177
|
+
ret
|
178
|
+
end
|
179
|
+
def synth_set_reverb_width( synth=self.synth, width: )
|
180
|
+
deprecated_msg_instead('synth_set_reverb_group_width()', meth: __method__)
|
181
|
+
ret = C.fluid_synth_set_reverb_width(synth,width)
|
182
|
+
ret
|
183
|
+
end
|
184
|
+
|
185
|
+
### setters for group.
|
186
|
+
def synth_set_reverb_group_damp( synth=self.synth, fx_group: , damping: )
|
187
|
+
ret = C.fluid_synth_set_reverb_group_damp(synth,fx_group,damping)
|
188
|
+
ret
|
189
|
+
end
|
190
|
+
def synth_set_reverb_group_level( synth=self.synth, fx_group: , level: )
|
191
|
+
ret = C.fluid_synth_set_reverb_group_level(synth,fx_group,level)
|
192
|
+
ret
|
193
|
+
end
|
194
|
+
def synth_set_reverb_group_roomsize( synth=self.synth, fx_group: , roomsize: )
|
195
|
+
ret = C.fluid_synth_set_reverb_group_roomsize(synth,fx_group,roomsize)
|
196
|
+
ret
|
197
|
+
end
|
198
|
+
def synth_set_reverb_group_width( synth=self.synth, fx_group: , width: )
|
199
|
+
ret = C.fluid_synth_set_reverb_group_width(synth,fx_group,width)
|
200
|
+
ret
|
201
|
+
end
|
202
|
+
|
203
|
+
|
204
|
+
end
|
205
|
+
|
206
|
+
|
207
|
+
#### endof filename: synth/effect/reverb.rb
|
@@ -0,0 +1,292 @@
|
|
1
|
+
#
|
2
|
+
# filename: synth/midi/messages.rb
|
3
|
+
#
|
4
|
+
|
5
|
+
|
6
|
+
# References
|
7
|
+
# - [API Reference](https://www.fluidsynth.org/api/modules.html)
|
8
|
+
#
|
9
|
+
class FiddleFluidSynth
|
10
|
+
|
11
|
+
# The MIDI channel message functions are mostly directly named after
|
12
|
+
# their counterpart MIDI messages.
|
13
|
+
# ==== References
|
14
|
+
# - API Reference, Synthesizer/[MIDI Channel Messages](https://www.fluidsynth.org/api/group__midi__messages.html)
|
15
|
+
# - [library fiddle](https://docs.ruby-lang.org/ja/latest/library/fiddle.html)
|
16
|
+
#
|
17
|
+
|
18
|
+
#
|
19
|
+
module C
|
20
|
+
|
21
|
+
# Lifecycle Functions.
|
22
|
+
#
|
23
|
+
#
|
24
|
+
|
25
|
+
# Functions.
|
26
|
+
#
|
27
|
+
#
|
28
|
+
|
29
|
+
# Turn off all voices that are playing on the given MIDI channel, by
|
30
|
+
# putting them into release phase.
|
31
|
+
extern 'int fluid_synth_all_notes_off(fluid_synth_t*, int)'
|
32
|
+
|
33
|
+
# Immediately stop all voices on the given MIDI channel (skips release
|
34
|
+
# phase).
|
35
|
+
extern 'int fluid_synth_all_sounds_off(fluid_synth_t*, int)'
|
36
|
+
|
37
|
+
# Set instrument bank number on a MIDI channel.
|
38
|
+
extern 'int fluid_synth_bank_select(fluid_synth_t*, int, int)'
|
39
|
+
|
40
|
+
# Send a MIDI controller event on a MIDI channel.
|
41
|
+
extern 'int fluid_synth_cc(fluid_synth_t*, int, int, int)'
|
42
|
+
|
43
|
+
# Set the MIDI channel pressure controller value.
|
44
|
+
extern 'int fluid_synth_channel_pressure(fluid_synth_t*, int, int)'
|
45
|
+
|
46
|
+
# Get current MIDI controller value on a MIDI channel.
|
47
|
+
extern 'int fluid_synth_get_cc(fluid_synth_t*, int, int, int*)'
|
48
|
+
|
49
|
+
# Retrieve the generator NRPN offset assigned to a MIDI channel.
|
50
|
+
extern 'float fluid_synth_get_gen(fluid_synth_t*, int, int)'
|
51
|
+
|
52
|
+
# Get the MIDI pitch bend controller value on a MIDI channel.
|
53
|
+
extern 'int fluid_synth_get_pitch_bend(fluid_synth_t*, int, int*)'
|
54
|
+
|
55
|
+
# Get MIDI pitch wheel sensitivity on a MIDI channel.
|
56
|
+
extern 'int fluid_synth_get_pitch_wheel_sens(fluid_synth_t*, int, int*)'
|
57
|
+
|
58
|
+
# Get current SoundFont ID, bank number and program number for a MIDI
|
59
|
+
# channel.
|
60
|
+
extern 'int fluid_synth_get_program' +
|
61
|
+
'(fluid_synth_t*, int, int*, int*, int*)'
|
62
|
+
|
63
|
+
# Set the MIDI polyphonic key pressure controller value.
|
64
|
+
extern 'int fluid_synth_key_pressure(fluid_synth_t*, int, int, int)'
|
65
|
+
|
66
|
+
# Sends a note-off event to a FluidSynth object.
|
67
|
+
extern 'int fluid_synth_noteoff(fluid_synth_t*, int, int)'
|
68
|
+
|
69
|
+
# Send a note-on event to a FluidSynth object.
|
70
|
+
extern 'int fluid_synth_noteon(fluid_synth_t*, int, int, int)'
|
71
|
+
|
72
|
+
# Set the MIDI pitch bend controller value on a MIDI channel.
|
73
|
+
extern 'int fluid_synth_pitch_bend(fluid_synth_t*, int, int)'
|
74
|
+
|
75
|
+
# Set MIDI pitch wheel sensitivity on a MIDI channel.
|
76
|
+
extern 'int fluid_synth_pitch_wheel_sens(fluid_synth_t*, int, int)'
|
77
|
+
|
78
|
+
# Send a program change event on a MIDI channel.
|
79
|
+
extern 'int fluid_synth_program_change(fluid_synth_t*, int, int)'
|
80
|
+
|
81
|
+
# Resend a bank select and a program change for every channel and assign
|
82
|
+
# corresponding instruments.
|
83
|
+
extern 'int fluid_synth_program_reset(fluid_synth_t*)'
|
84
|
+
|
85
|
+
# Select an instrument on a MIDI channel by SoundFont ID, bank and
|
86
|
+
# program numbers.
|
87
|
+
extern 'int fluid_synth_program_select(fluid_synth_t*, int, int, int, int)'
|
88
|
+
|
89
|
+
# Select an instrument on a MIDI channel by SoundFont name, bank and
|
90
|
+
# program numbers.
|
91
|
+
extern 'int fluid_synth_program_select_by_sfont_name' +
|
92
|
+
'(fluid_synth_t*, int, char*, int, int )'
|
93
|
+
|
94
|
+
# Apply an offset to a SoundFont generator on a MIDI channel.
|
95
|
+
extern 'int fluid_synth_set_gen(fluid_synth_t*, int, int, float)'
|
96
|
+
|
97
|
+
# Set SoundFont ID on a MIDI channel.
|
98
|
+
extern 'int fluid_synth_sfont_select(fluid_synth_t*, int, int)'
|
99
|
+
|
100
|
+
# Process a MIDI SYSEX (system exclusive) message.
|
101
|
+
extern 'int fluid_synth_sysex' +
|
102
|
+
'(fluid_synth_t*, char*, int, char*, int*, int*, int)'
|
103
|
+
|
104
|
+
# Send MIDI system reset command (big red 'panic' button), turns off
|
105
|
+
# notes, resets controllers and restores initial basic channel
|
106
|
+
# configuration.
|
107
|
+
extern 'int fluid_synth_system_reset(fluid_synth_t*)'
|
108
|
+
|
109
|
+
# Set the preset of a MIDI channel to an unassigned state.
|
110
|
+
extern 'int fluid_synth_unset_program(fluid_synth_t*, int)'
|
111
|
+
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
# Lifecycle Functions.
|
117
|
+
#
|
118
|
+
#
|
119
|
+
|
120
|
+
|
121
|
+
# Functions.
|
122
|
+
#
|
123
|
+
#
|
124
|
+
class FiddleFluidSynth
|
125
|
+
|
126
|
+
#
|
127
|
+
def synth_all_notes_off( synth=self.synth, ch: )
|
128
|
+
ret = C.fluid_synth_all_notes_off(synth, ch)
|
129
|
+
ret
|
130
|
+
end
|
131
|
+
def synth_all_sounds_off( synth=self.synth, ch: )
|
132
|
+
ret = C.fluid_synth_all_sounds_off(synth, ch)
|
133
|
+
ret
|
134
|
+
end
|
135
|
+
|
136
|
+
# def synth_bank_select( synth: , ch: , bank: )
|
137
|
+
def synth_bank_select( synth=self.synth, ch: , bknum: )
|
138
|
+
ret = C.fluid_synth_bank_select(synth, ch, bknum)
|
139
|
+
ret
|
140
|
+
end
|
141
|
+
|
142
|
+
# def synth_cc( synth: , ch: , num: , val: )
|
143
|
+
def synth_cc( synth=self.synth, ch: , num: , val: )
|
144
|
+
ret = nil
|
145
|
+
if (num < 0 || num > 127) || ch < 0 || (val < 0 || val > 127)
|
146
|
+
ret = FLUID_FAILED
|
147
|
+
else
|
148
|
+
ret = C.fluid_synth_cc(synth, ch, num, val)
|
149
|
+
end
|
150
|
+
ret
|
151
|
+
end
|
152
|
+
|
153
|
+
#
|
154
|
+
def synth_channel_pressure( synth=self.synth , ch: , val: )
|
155
|
+
ret = C.fluid_synth_channel_pressure(synth, ch, val)
|
156
|
+
ret
|
157
|
+
end
|
158
|
+
|
159
|
+
# getters.
|
160
|
+
def synth_get_cc( synth=self.synth, ch: , num: , pval: )
|
161
|
+
ret = C.fluid_synth_get_cc(synth, ch, num, pval)
|
162
|
+
ret
|
163
|
+
end
|
164
|
+
|
165
|
+
def synth_get_gen( synth=self.synth, ch: , param: )
|
166
|
+
ret = C.fluid_synth_get_gen(synth, ch, param)
|
167
|
+
ret
|
168
|
+
end
|
169
|
+
|
170
|
+
def synth_get_pitch_bend( synth=self.synth, ch: , ppitch_bend: )
|
171
|
+
ret = C.fluid_synth_get_pitch_bend(synth, ch, ppitch_bend)
|
172
|
+
ret
|
173
|
+
end
|
174
|
+
|
175
|
+
def synth_get_pitch_wheel_sens( synth=self.synth, ch: , pval: )
|
176
|
+
ret = C.fluid_synth_get_pitch_wheel_sens(synth, ch, pval)
|
177
|
+
ret
|
178
|
+
end
|
179
|
+
|
180
|
+
def synth_get_program( synth=self.synth, ch: , sfid: , bknum: , prenum: )
|
181
|
+
ret = C.fluid_synth_get_program(synth, ch, sfid, bknum, prenum)
|
182
|
+
ret
|
183
|
+
end
|
184
|
+
|
185
|
+
#
|
186
|
+
def synth_key_pressure( synth=self.synth, ch: , key: , val: )
|
187
|
+
ret = C.fluid_synth_key_pressure(synth, ch, key, val)
|
188
|
+
ret
|
189
|
+
end
|
190
|
+
|
191
|
+
# def synth_noteoff( synth: , ch: , key: )
|
192
|
+
def synth_noteoff( synth=self.synth, ch: , key: )
|
193
|
+
ret = nil
|
194
|
+
if (key < 0 || key > 127) || (ch < 0)
|
195
|
+
ret = FLUID_FAILED
|
196
|
+
else
|
197
|
+
ret = C.fluid_synth_noteoff(synth, ch, key)
|
198
|
+
end
|
199
|
+
ret
|
200
|
+
end
|
201
|
+
|
202
|
+
# def synth_noteon( synth: , ch: , key: , vel: )
|
203
|
+
def synth_noteon( synth=self.synth, ch: , key: , vel: )
|
204
|
+
ret = nil
|
205
|
+
if (key < 0 || key > 127) || ch < 0 || (vel < 0 || vel > 127)
|
206
|
+
ret = FLUID_FAILED
|
207
|
+
else
|
208
|
+
ret = C.fluid_synth_noteon(synth, ch, key, vel)
|
209
|
+
end
|
210
|
+
ret
|
211
|
+
end
|
212
|
+
|
213
|
+
#
|
214
|
+
# ==== Args
|
215
|
+
# val:: 8192 is the middle value (see the ref[1]).
|
216
|
+
def synth_pitch_bend( synth=self.synth, ch: , val: )
|
217
|
+
_val = val + 8192
|
218
|
+
|
219
|
+
ret = C.fluid_synth_pitch_bend(synth, ch, _val)
|
220
|
+
ret
|
221
|
+
end
|
222
|
+
|
223
|
+
# def synth_pitch_wheel_sens( synth: , ch: , val: )
|
224
|
+
def synth_pitch_wheel_sens( synth=self.synth, ch: , val: )
|
225
|
+
ret = C.fluid_synth_pitch_wheel_sens(synth, ch, val)
|
226
|
+
ret
|
227
|
+
end
|
228
|
+
|
229
|
+
|
230
|
+
### program.
|
231
|
+
|
232
|
+
# def synth_program_change( synth: , ch: , prog_num: )
|
233
|
+
def synth_program_change( synth=self.synth, ch: , pgnum: )
|
234
|
+
ret = C.fluid_synth_program_change(synth, ch, pgnum)
|
235
|
+
ret
|
236
|
+
end
|
237
|
+
|
238
|
+
def synth_program_reset( synth = self.synth )
|
239
|
+
ret = C.fluid_synth_program_reset(synth)
|
240
|
+
ret
|
241
|
+
end
|
242
|
+
# def synth_program_select( synth: , ch: , sfid: , bknum: , prenum: )
|
243
|
+
def synth_program_select( synth=self.synth, ch: , sfid: , bknum: , prenum: )
|
244
|
+
ret = C.fluid_synth_program_select(
|
245
|
+
synth, ch, sfid, bknum, prenum)
|
246
|
+
ret
|
247
|
+
end
|
248
|
+
|
249
|
+
def synth_program_select_by_sfont_name( synth=self.synth, ch: ,
|
250
|
+
sfont_name: , bknum: , prenum: )
|
251
|
+
ret = C.fluid_synth_program_select_by_sfont_name(
|
252
|
+
synth, ch, sfont_name, bknum, prenum)
|
253
|
+
ret
|
254
|
+
end
|
255
|
+
|
256
|
+
#
|
257
|
+
# def synth_set_gen( synth: , ch: , param: , val: )
|
258
|
+
def synth_set_gen( synth=self.synth, ch: , param: , val: )
|
259
|
+
ret = C.fluid_synth_set_gen(synth, ch, param, val)
|
260
|
+
ret
|
261
|
+
end
|
262
|
+
|
263
|
+
# def synth_sfont_select( synth: , ch: , sfid: )
|
264
|
+
def synth_sfont_select( synth=self.synth, ch: , sfid: )
|
265
|
+
ret = C.fluid_synth_sfont_select(synth, ch, sfid)
|
266
|
+
ret
|
267
|
+
end
|
268
|
+
|
269
|
+
def synth_sysex( synth=self.synth,
|
270
|
+
data: , len: ,
|
271
|
+
response: , response_len: , handled: , dryrun: )
|
272
|
+
ret = C.fluid_synth_sysex(synth, data,len,
|
273
|
+
response,response_len,
|
274
|
+
handled, dryrun)
|
275
|
+
ret
|
276
|
+
end
|
277
|
+
|
278
|
+
def synth_system_reset( synth = self.synth )
|
279
|
+
ret = C.fluid_synth_system_reset(synth)
|
280
|
+
ret
|
281
|
+
end
|
282
|
+
|
283
|
+
def synth_unset_program( synth=self.synth, ch: )
|
284
|
+
ret = C.fluid_synth_unset_program(synth, ch)
|
285
|
+
ret
|
286
|
+
end
|
287
|
+
|
288
|
+
|
289
|
+
end
|
290
|
+
|
291
|
+
|
292
|
+
#### endof filename: synth/midi/messages.rb
|