a2a024418ceef48f89c07711dcd25d4414a1d37e
1 # -*- coding: utf-8 -*-
3 module de wrapping du synthétiseur
8 from os
.path
import realpath
, sep
, exists
9 from fluidsynth
import Synth
as FSynth
13 def __init__(self
, gain
=0.2, samplerate
=44100) :
14 FSynth
.__init
__(self
, gain
=gain
, samplerate
=samplerate
)
16 sfPath
= realpath(__file__
).split(sep
)
18 sfPath
.append('soundfonts')
20 sfPath
.append('FluidR3_GM.sf2')
21 sfPath
= sep
.join(sfPath
)
25 self
.fsid
= self
.sfload(sfPath
)
27 def sfunload(self
, update_midi_preset
=0):
28 FSynth
.sfunload(self
, self
.fsid
, update_midi_preset
=update_midi_preset
)
30 def program_select(self
, chan
, bank
, preset
):
31 FSynth
.program_select(self
, chan
, self
.fsid
, bank
, preset
)
33 def sfont_select(self
, chan
):
34 FSynth
.sfont_select(self
, chan
, self
.fsid
)
39 if __name__
== '__main__' :