Commit Graph

1986 Commits

Author SHA1 Message Date
Chris Robinson
d9aedc1416 Add a few more pitch properties 2013-12-29 02:25:40 -08:00
Chris Robinson
fc928bb75a Add volume envelope properties 2013-12-29 02:14:10 -08:00
Chris Robinson
4659669a74 Fix copy-paste errors in error messages 2013-12-29 00:56:01 -08:00
Chris Robinson
5aa274999c Accumulate with default modulator amounts 2013-12-29 00:52:03 -08:00
Chris Robinson
09665715ed Add support for the fontsound loop mode 2013-12-29 00:34:58 -08:00
Chris Robinson
0d7996409e Ensure the soundfont version is 2.x 2013-12-28 10:34:26 -08:00
Chris Robinson
fe55cd6de8 Add alLoadSoundfontSOFT to load a soundfont via callback
Some hefty caveats:
This function is not thread-safe. In particular, the current context affecting
the thread must not be changed, and the provided soundfont must not be
altered while the function is executing. Ideally, this will be fixed.

Error handling is poor. Some RIFF structure errors may not be caught (e.g. sub-
chunks with sizes greater than the parent chunk allows for), and generated AL
errors are ignored, possibly leading to resource leaks in certain situations.
These should be fixed in time.

There is minimal error checking on the provided soundfont ID. It does not
ensure a valid ID has been provided, nor does it ensure the provided soundfont
can be modified. These short-comings should be fixed eventually.

Proper cleanup is the responsibility of the caller. The caller must get the
preset objects from the soundfont before deleting it, and the fontsound objects
from each preset before deleting them, to make sure all resources are properly
deleted.
2013-12-28 09:58:55 -08:00
Chris Robinson
7156f4439c Allow loading multiple soundfonts with FluidSynth 2013-12-27 06:41:57 -08:00
Chris Robinson
0678e3fc2b Create a custom fluid_sfloader_t loader
This allows us to load and use soundfont objects the app specifies (the first
one, at least), rather than having to load from a file. It doesn't sound that
good since modulators and most generators aren't yet available, but this will
steadily improve.
2013-12-27 06:23:07 -08:00
Chris Robinson
f85d733f9d Add a method to set and get soundfonts
The main purpose of this is to select soundfonts for playback, eventually,
instead of the existing method that takes a filename.
2013-12-27 02:59:50 -08:00
Chris Robinson
cc30c5754f Remove the generator list 2013-12-26 22:10:41 -08:00
Chris Robinson
d5f687b2fa Allow specifying key and velocity ranges on fontsounds 2013-12-26 21:45:16 -08:00
Chris Robinson
35f9e35aa3 Add methods to set and get sounds on a preset 2013-12-25 22:39:38 -08:00
Chris Robinson
b5ae424dbd Store a list of sounds in the preset 2013-12-25 19:50:46 -08:00
Chris Robinson
677b864565 Remove the zone, sample, and instrument object types 2013-12-25 19:35:43 -08:00
Chris Robinson
b650ecbc23 Add methods to add generators and modulators to fontsounds 2013-12-25 19:23:34 -08:00
Chris Robinson
94ddc5cb18 Add a new fontsound object type
This is basically a combined preset and intrument zone with sample header.
2013-12-25 19:13:59 -08:00
Chris Robinson
a43b296c60 Add methods to get and set presets on a soundfont 2013-12-23 04:07:53 -08:00
Chris Robinson
d7de86966d Add methods to get and set a preset object's preset and bank numbers 2013-12-23 03:23:42 -08:00
Chris Robinson
0df5eb90ea Make sure key and velocity ranges are the first two generators 2013-12-21 15:28:46 -08:00
Chris Robinson
ede3c20880 Free thunk entry in the object destructor 2013-12-20 01:04:38 -08:00
Chris Robinson
5dc3f3626d Better protect against improper alSoundfontSamplesSOFT calls 2013-12-20 00:50:43 -08:00
Chris Robinson
d596cf9cf3 Use a different autowah filter range
Still just guesses, but this seems to avoid math problems with low peak gains.
2013-12-20 00:16:23 -08:00
Chris Robinson
1bd828603e Add functions to set a soundfont's sample data 2013-12-19 04:19:03 -08:00
Chris Robinson
03a6bf22a5 Fix compiling without FluidSynth 2013-12-19 02:12:01 -08:00
Chris Robinson
99933fac49 Allow creating instrument objects 2013-12-19 00:57:07 -08:00
Chris Robinson
666acb314b Rename some ALsoundfont fields 2013-12-19 00:37:56 -08:00
Chris Robinson
1b5c3495c9 Add methods to create and destroy presets 2013-12-19 00:09:55 -08:00
Chris Robinson
1e536cf7ca Properly initialize and cleanup the soundfont map 2013-12-18 23:21:59 -08:00
Chris Robinson
8083fb5be7 Add a new ALsoundfont object type
Includes a basic hierarchy for presets, instruments, samples, zones,
generators, and modulators.
2013-12-18 22:51:53 -08:00
Chris Robinson
b9468dc917 Fix header guard and remove duplicate code 2013-12-18 19:17:03 -08:00
Chris Robinson
0653680690 Move the base MidiSynth to a separate file 2013-12-17 23:03:34 -08:00
Chris Robinson
0095a59fc9 Move the dummy MIDI handler to a separate file 2013-12-17 22:43:10 -08:00
Chris Robinson
ee92b3142d Move FluidSynth to its own file 2013-12-17 22:36:25 -08:00
Chris Robinson
1dd05bac5c Add a alMidiResetSOFT method to reset the synth
Playback is stopped, the queue is flushed, the clock is reset to 0, and the
MIDI system is reset to power-up status.
2013-12-13 14:15:01 -08:00
Chris Robinson
ac525db845 Fix numeric constant type (double->float) 2013-12-08 05:01:06 -08:00
Chris Robinson
a846418964 Rename pthread wrappers used for Windows to althread 2013-12-06 02:12:45 -08:00
Chris Robinson
c834713526 Add methods to set and get the MIDI gain 2013-11-30 23:47:42 -08:00
Chris Robinson
2633fbfc4b Add a method to check if a file is a soundfont 2013-11-30 20:37:37 -08:00
Chris Robinson
be446366fb Add a method to specifying MIDI SysEx messages 2013-11-29 05:37:45 -08:00
Chris Robinson
ea1d7d56d3 Add infrastructure for handling SysEx MIDI events 2013-11-29 04:56:33 -08:00
Chris Robinson
f8c68291d3 Add a method to stop MIDI playback
Unlike pausing, this resets the MIDI clock time to 0, clears the existing event
queue, stops all MIDI sounds, and resets MIDI controllers.
2013-11-28 04:52:53 -08:00
Chris Robinson
bb0207d784 Add a method to load a soundfont 2013-11-28 03:38:17 -08:00
Chris Robinson
a48f362d28 Start a MIDI interface extension 2013-11-28 01:53:05 -08:00
Chris Robinson
182b08d8bc Create and use a MidiSynth on playback devices 2013-11-27 18:52:56 -08:00
Chris Robinson
37fa82f138 Use a 64-bit uint for MIDI event times 2013-11-27 04:33:33 -08:00
Chris Robinson
d315feae40 Add a MIDI event queue
In preparation for a MIDI extension.
2013-11-27 03:49:26 -08:00
Chris Robinson
08dfbcfd5c Add min/max/clamp methods for doubles 2013-11-27 00:30:13 -08:00
Chris Robinson
80ea801204 Add a macro for GCC to ensure stack alignment 2013-11-25 17:29:39 -08:00
Chris Robinson
191e8172f0 Use a macro to help condense some repeated code 2013-11-24 18:11:45 -08:00
Chris Robinson
b029b77784 Add some missing 'static's 2013-11-24 17:43:20 -08:00
Chris Robinson
25b9c3d0c1 Apply HRTF coefficient stepping separately 2013-11-10 05:52:22 -08:00
Chris Robinson
4386ee32ce Use one long buffer for the chorus and flanger delay lines 2013-11-10 02:48:03 -08:00
Chris Robinson
a603dd55ff Rename lfo_coeff to lfo_scale 2013-11-08 16:54:45 -08:00
Chris Robinson
9228d13333 Use integer modulo for chorus and flanger
Also simplify LFO coefficient calculations.
2013-11-08 16:33:42 -08:00
Chris Robinson
bca959f372 Only use the inner loop for the chorus/flanger template method 2013-11-08 05:26:43 -08:00
Chris Robinson
d6eff654be Redo the autowah effect
It's now a low-pass filter with a cutoff that varies according to the input
signal amplitude.

There remains issues with apparent feedback in the resonant frequency with high
resonance values. The actual cutoff range for the filter is also a guess.
2013-11-07 17:46:14 -08:00
Chris Robinson
e0fecdcaaa Reimplement the compressor to work per-sample 2013-11-06 23:39:41 -08:00
Chris Robinson
10dbb1bc9b Remove the Lock and Unlock methods from BackendFuncs
All backends that still use the old interface use the default locking methods,
which is also used by the ALCbackend base.
2013-11-04 23:34:18 -08:00
Chris Robinson
ca83629e4e Forward some wrapper functions to the base method 2013-11-04 23:19:30 -08:00
Chris Robinson
d3c70e63b4 Use C99 inline in more places 2013-11-04 13:44:46 -08:00
Chris Robinson
551f893ae9 Use C99 inline semantics 2013-11-04 12:12:31 -08:00
Chris Robinson
692ab1085d Only set device functions when needed 2013-11-04 10:52:03 -08:00
Chris Robinson
94aeb5f52e Use a unique backend type for loopback 2013-11-04 10:51:22 -08:00
Chris Robinson
9760a592b2 Rename VCALL and VCALL0 to V and V0 2013-11-02 17:30:28 -07:00
Chris Robinson
f868d881d9 Constify some function pointers 2013-11-02 16:58:26 -07:00
Chris Robinson
3d921e0e6f Make backend factory methods static as needed 2013-11-02 16:35:05 -07:00
Chris Robinson
a1a3f51be2 Convert the OSS backend to the new interface 2013-11-02 15:42:45 -07:00
Chris Robinson
c851e2c611 Set vtables in the constructor 2013-11-02 13:23:20 -07:00
Chris Robinson
ddf521eddc Make LockContext and UnlockContext inline again 2013-11-02 12:05:02 -07:00
Chris Robinson
7142e3828f Rename alcGetLatency to ALCdevice_GetLatency 2013-11-02 12:01:58 -07:00
Chris Robinson
90a51d7897 Move a macro definition up nearer to where it's used 2013-10-29 23:54:10 -07:00
Chris Robinson
bc9c3de969 Use a helper macro for making vtable thunks 2013-10-29 20:13:42 -07:00
Chris Robinson
9f0e49917d Add default handlers for reset, captureSamples, and availableSamples 2013-10-29 15:07:13 -07:00
Chris Robinson
779eb4b82b Convert the PulseAudio backend to the new interface 2013-10-29 14:44:07 -07:00
Chris Robinson
d4aa4e16a0 Add a macro to forward methods to a base type 2013-10-29 11:22:18 -07:00
Chris Robinson
d2b3615943 Convert the loopback backend to the new interface 2013-10-29 10:38:55 -07:00
Chris Robinson
3437769ba0 Remove a couple unnecessary (and incorrect) parameter names 2013-10-28 22:29:59 -07:00
Chris Robinson
3c65c946d4 Fix capture with the new backend interface 2013-10-28 22:03:54 -07:00
Chris Robinson
16d5d5760c Convert ALSA to the new backend interface 2013-10-28 21:56:14 -07:00
Chris Robinson
7a424ab4bf Don't return a void 2013-10-28 20:23:41 -07:00
Chris Robinson
823782a33f Declare LoadLib functions in one place 2013-10-28 17:48:48 -07:00
Chris Robinson
321644de7c Add a missing compat.h include for portaudio 2013-10-28 17:48:03 -07:00
Chris Robinson
a407d57639 Rename the support method to querySupport 2013-10-28 17:23:19 -07:00
Chris Robinson
6fd857739c Support capture backends with the new interface 2013-10-28 17:04:44 -07:00
Chris Robinson
21f1e54cb9 Create and use a backend wrapper for capture 2013-10-28 14:38:55 -07:00
Chris Robinson
f8c95f1e90 Add audio capture methods to ALCbackend 2013-10-28 13:51:55 -07:00
Chris Robinson
8d9fb5109b Move some stuff out of alMain.h 2013-10-28 12:48:13 -07:00
Chris Robinson
20bcb68ad6 Move ALCbackend base stuff to a separate file 2013-10-28 12:30:57 -07:00
Chris Robinson
0617df9b5f Fix a couple casts 2013-10-28 12:12:26 -07:00
Chris Robinson
f24cb44781 Move the device mutex to the backend 2013-10-28 12:05:33 -07:00
Chris Robinson
2912d130c2 Separate compatibility declarations 2013-10-28 11:26:26 -07:00
Chris Robinson
034935b2e1 Modify how VCALL is handled
Now instead of specifying the arguments as a third argument to the macro, like
VCALL(object,function,(arg1, arg2));
they are specified separately after the macro, like
VCALL(object,function)(arg1, arg2);

Also, VCALL_NOARGS has been removed in favor of VCALL0, which behaves like
above but expects an empty argument list (a separate macro is needed to work
around preprocessor limitations).
2013-10-28 11:06:04 -07:00
Chris Robinson
c1cdd3095b Convert the Null backend to the ALCbackend style 2013-10-28 08:29:19 -07:00
Chris Robinson
dc7ed39fa7 Add a backend factory base type 2013-10-28 07:27:35 -07:00
Chris Robinson
c8603092d3 Add a default getLatency to ALCbackend
And make sure the backend is properly deleted.
2013-10-28 05:57:07 -07:00
Chris Robinson
f065700ef9 Move the lock/unlock methods to the backend 2013-10-28 05:10:28 -07:00
Chris Robinson
e54983694b Add missing header to git 2013-10-27 16:37:40 -07:00
Chris Robinson
3ed425d7ef Move the ALCdevice handle to the ALCbackend base 2013-10-27 16:20:47 -07:00
Chris Robinson
af8be56f17 Use an ALCbackend object to access playback backends
This is the start of a backend redesign. Currently, a wrapper object is used to
avoid having to redo all the backends at once, but they should slowly be
converted to derive from ALCbackend instead. The ALCbackend interface can
change as needed.
2013-10-27 14:24:55 -07:00