2 * Copyright 2006-2014, Haiku.
4 * Copyright (c) 2004-2005 Matthijs Hollemans
5 * Copyright (c) 2003 Jerome Leveque
6 * Distributed under the terms of the MIT License.
19 This version of SoftSynth is a wrapper libfluidsynth.so.
22 #include <fluidsynth.h>
24 #include <SoundPlayer.h>
38 bool IsLoaded() const;
40 status_t
SetDefaultInstrumentsFile();
41 status_t
SetInstrumentsFile(const char* path
);
43 status_t
LoadAllInstruments();
44 status_t
LoadInstrument(int16 instrument
);
45 status_t
UnloadInstrument(int16 instrument
);
46 status_t
RemapInstrument(int16 from
, int16 to
);
47 void FlushInstrumentCache(bool startStopCache
);
49 void SetVolume(double volume
);
50 double Volume(void) const;
52 status_t
SetSamplingRate(int32 rate
);
53 int32
SamplingRate() const;
55 status_t
SetInterpolation(interpolation_mode mode
);
56 interpolation_mode
Interpolation() const;
58 status_t
EnableReverb(bool enabled
);
59 bool IsReverbEnabled() const;
60 void SetReverb(reverb_mode mode
);
61 reverb_mode
Reverb() const;
63 status_t
SetMaxVoices(int32 max
);
64 int16
MaxVoices(void) const;
66 status_t
SetLimiterThreshold(int32 threshold
);
67 int16
LimiterThreshold(void) const;
72 void NoteOff(uchar
, uchar
, uchar
, uint32
);
73 void NoteOn(uchar
, uchar
, uchar
, uint32
);
74 void KeyPressure(uchar
, uchar
, uchar
, uint32
);
75 void ControlChange(uchar
, uchar
, uchar
, uint32
);
76 void ProgramChange(uchar
, uchar
, uint32
);
77 void ChannelPressure(uchar
, uchar
, uint32
);
78 void PitchBend(uchar
, uchar
, uchar
, uint32
);
79 void SystemExclusive(void*, size_t, uint32
);
80 void SystemCommon(uchar
, uchar
, uchar
, uint32
);
81 void SystemRealTime(uchar
, uint32
);
82 void TempoChange(int32
, uint32
);
83 void AllNotesOff(bool, uint32
);
87 friend class ::BSynth
;
88 friend class ::BMidiSynth
;
95 static void PlayBuffer(void* cookie
, void* data
, size_t size
,
96 const media_raw_audio_format
& format
);
99 char* fInstrumentsFile
;
101 interpolation_mode fInterpMode
;
103 int16 fLimiterThreshold
;
104 reverb_mode fReverbMode
;
107 fluid_synth_t
* fSynth
;
108 fluid_settings_t
* fSettings
;
110 BSoundPlayer
* fSoundPlayer
;
117 } // namespace BPrivate
119 #endif // _SOFT_SYNTH_H