47 Commits

Author SHA1 Message Date
Chris Robinson
bca7c682f1 Use ALuint for the amount to skip 2014-05-04 01:00:21 -07:00
Chris Robinson
90ae4b7c0f Add a VECTOR_INSERT method to insert a range of elements at once 2014-04-09 22:50:28 -07:00
Chris Robinson
023981acb9 Fix a NULL deref when cloning a 0-sized vector 2014-04-09 20:14:45 -07:00
Chris Robinson
83038c0dab Add some integer casts, and a range check 2014-03-23 15:22:37 -07:00
Chris Robinson
f5ce73646c Avoid a size_t-to-ALuint conversion warning 2014-03-21 17:29:20 -07:00
Chris Robinson
8c33b4d742 Increase the vector reserve as needed when pushing in new items 2014-03-21 16:35:38 -07:00
Chris Robinson
983fa4630a Rename the vector's Max field to Capacity 2014-03-21 14:03:26 -07:00
Chris Robinson
40a0692a1c Use vectors for the GenModList 2014-03-21 02:41:46 -07:00
Chris Robinson
3145bac8c6 Add an explicit cast to make Windows happy 2014-02-26 17:45:18 -08:00
Chris Robinson
9e2a8843a8 Properly fill the SF2 sample buffer on big endian 2014-02-01 14:33:57 -08:00
Chris Robinson
68a32a3486 Fix an infinite loop when loading SF2 samples on big endian machines 2014-02-01 14:29:47 -08:00
Chris Robinson
35fd4dcf77 Check and trace INFO properties when reading them 2014-01-19 02:44:55 -08:00
Chris Robinson
1a90c7f498 Check for 0-sized sf2 structure arrays 2014-01-17 06:48:40 -08:00
Chris Robinson
be883131a7 Remove redundancy in a couple error messages 2014-01-17 06:33:23 -08:00
Chris Robinson
658d35a1b0 Put the version and irom storage into the Soundfont struct 2014-01-17 06:20:39 -08:00
Chris Robinson
d387deb3e8 Fix a couple warning messages to show the correct instrument ID 2014-01-17 06:10:29 -08:00
Chris Robinson
7206f5873c Partially handle the irom sub-chunk
Reject soundfonts that have ROM sample types without a valid irom sub-chunk.
2014-01-17 06:03:53 -08:00
Chris Robinson
05e9c824d5 Better handle original key and overriding root key 2014-01-17 05:14:58 -08:00
Chris Robinson
65a5311449 Rename aftertouch to keypressure 2014-01-17 04:18:49 -08:00
Chris Robinson
e118ac93a0 Handle fontsound sample types using explicit enum values
Uses AL_MONO_SOFT, AL_RIGHT_SOFT, and AL_LEFT_SOFT. "Linked" samples types
aren't explicitly supported due to being under-defined in the SF2 spec, nor are
ROM samples currently.
2014-01-15 22:18:07 -08:00
Chris Robinson
9ebeae6228 Use ALfontsound_setPropi to set fontsound sample properties
And make sure the loop mode is properly translated for FluidSynth.
2014-01-15 21:17:46 -08:00
Chris Robinson
24ffb5b464 Be more thorough when converting sf2 modulator properties 2014-01-13 16:50:12 -08:00
Chris Robinson
da2c9732da Don't break with an override root key generator value of -1
An accidental hold-over from when it was using a switch.
2014-01-06 13:21:08 -08:00
Chris Robinson
4079ee2200 Add methods to get and set modulator properties on fontsounds 2014-01-05 17:21:34 -08:00
Chris Robinson
86f250a3f5 Trace preset, instrument, and sample names with invalid key and velocity ranges 2014-01-04 04:34:32 -08:00
Chris Robinson
4834f56779 Don't create presets that don't have any usable sounds 2014-01-04 03:20:17 -08:00
Chris Robinson
2dd87946fd Update some trace messages to be more useful 2014-01-03 23:19:52 -08:00
Chris Robinson
e6e7e461c0 Avoid using alFontsoundiSOFT when loading a soundfont
This should now make the soundfont loader thread-safe.
2014-01-03 18:52:17 -08:00
Chris Robinson
5dc4ea15bb Don't handle the list type in the RiffHdr struct 2014-01-03 18:09:51 -08:00
Chris Robinson
49c17ad520 Mostly load into fontsound objects directly
This leaves only one unsafe alFontsoundiSOFT call.
2014-01-02 13:53:16 -08:00
Chris Robinson
fcf9e72202 Load presets directly into objects 2014-01-02 11:40:30 -08:00
Chris Robinson
3ff33e2f79 Update the soundfont preset count after loading a soundfont 2014-01-02 09:09:57 -08:00
Chris Robinson
7d94e9c52f Don't allow soundfonts with existing presets in alLoadSoundfontSOFT 2014-01-01 07:33:48 -08:00
Chris Robinson
0a5a08c0fb Pass the ALsoundfont object to loadSf2, rather than its ID 2014-01-01 07:25:23 -08:00
Chris Robinson
4e73b95fc0 Add the last remaining "real-time" properties 2013-12-29 05:09:50 -08:00
Chris Robinson
4c35f7c632 Add chorus and reverb send properties 2013-12-29 04:36:01 -08:00
Chris Robinson
699d84491f Add pan and attenuation properties 2013-12-29 04:24:32 -08:00
Chris Robinson
d030e07879 Add tuning properties 2013-12-29 03:43:00 -08:00
Chris Robinson
1d41122372 Add filter properties 2013-12-29 03:18:31 -08:00
Chris Robinson
deecbbc55d Add modulation envelope properties 2013-12-29 02:40:12 -08:00
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