Ejemplo n.º 1
0
 def note_off(self, channel: int, key: int):
     check_result(
         Lib.fluid_synth_noteoff(
             self.synth,
             c_int(channel),
             c_int(key),
         ))
Ejemplo n.º 2
0
 def cc(self, chan: int, ctrl: int, val: int):
     check_result(
         Lib.fluid_synch_cc(
             self.synth,
             c_int(chan),
             c_int(ctrl),
             c_int(val),
         ))
Ejemplo n.º 3
0
 def get_program(self, chan: int):
     sfont_id = c_int()
     bank_num = c_int()
     preset_num = c_int()
     check_result(
         Lib.fluid_synth_get_program(self.synth, c_int(chan),
                                     byref(sfont_id), byref(bank_num),
                                     byref(preset_num)))
     return sfont_id.value, bank_num.value, preset_num.value
Ejemplo n.º 4
0
 def get_cc(self, chan: int, ctrl: int):
     val = c_int()
     check_result(
         Lib.fluid_synth_get_cc(self.synth, c_int(chan), c_int(ctrl),
                                byref(val)))
     return val.value
Ejemplo n.º 5
0
 def note_on(self, chan: int, key: int, vel: int):
     check_result(
         Lib.fluid_synth_noteon(self.synth, c_int(chan), c_int(key),
                                c_int(vel)))
Ejemplo n.º 6
0
 def set_gain(self, gain: float):
     check_result(Lib.fluid_synth_set_gain(self.synth, c_float(gain)))
Ejemplo n.º 7
0
 def sfload(self, sf2_path: str, reset_presets=True):
     check_result(
         Lib.fluid_synth_sfload(self.synth, sf2_path.encode(),
                                c_int(reset_presets)))
Ejemplo n.º 8
0
 def set_channel_type(self, chan: int, _type: int):
     check_result(
         Lib.fluid_synth_set_channel_type(self.synth, c_int(chan),
                                          c_int(_type)))
Ejemplo n.º 9
0
 def __exit__(self, exc_type, exc_val, exc_tb):
     check_result(Lib.delete_fluid_synth(self.synth))
Ejemplo n.º 10
0
 def all_sounds_off(self, chan: int):
     check_result(Lib.fluid_synth_all_sounds_off(self.synth, c_int(chan)))
Ejemplo n.º 11
0
 def system_reset(self):
     check_result(Lib.fluid_synth_system_reset(self.synth))
Ejemplo n.º 12
0
 def program_reset(self):
     check_result(Lib.fluid_synth_program_reset(self.synth))
Ejemplo n.º 13
0
 def unset_program(self, chan: int):
     check_result(Lib.fluid_synth_unset_program(self.synth, c_int(chan)))
Ejemplo n.º 14
0
 def program_select_by_sfont_name(self, chan: int, sfont_name: str,
                                  bank_num: int, preset_num: int):
     check_result(
         Lib.fluid_synth_program_select_by_sfont_name(
             self.synth, c_int(chan), sfont_name.encode(), c_int(bank_num),
             c_int(preset_num)))
Ejemplo n.º 15
0
 def program_select(self, chan: int, sfont_id: int, bank_num: int,
                    preset_num: int):
     check_result(
         Lib.fluid_synth_program_select(self.synth, c_int(chan),
                                        c_int(sfont_id), c_int(bank_num),
                                        c_int(preset_num)))