The latency should not be incremented when writing sample data to the
buffer, but rather be posted by the output.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Upstream functions which return empty chunks on error do not return nil,
so the caller should check for an empty duration instead.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Impulses should be gain scaled roughly based on the sample ratio
relative to the original impulses. Lower target sample rate means less
impulses means gain goes up, higher target sample rate means more
impulses so gain goes down. Somewhat simple, seems to work.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
We were forcing a resampling ratio to match the HRTF filter supplied
with the app, now we resample the HRTF to match the input audio, which
will be resampled to match the output device settings.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This prepares the filter to be the same as the rest of the filters, in
that they support flexible sample rates to match the output device.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
And disable it by default in new installations, otherwise leave the
setting alone. The disablement setting is shared with the engine
setting, so the default should not really change anything, except for
new installs.
Also, the time/pitch shifting dialog disables itself and displays an
obvious notice button, which opens the Rubber Band settings.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
These should have been defined already, but now they're the safe
defaults that should spring the dialog on startup, and doesn't grant
consent by default.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
It's more like the output monitor thread, since it only monitors output,
rather than actually handing the output callbacks.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Sample block merging code should not be duplicated across the DSPs that
require it, but instead should be a common function. Also added some
optimizations to the Float32 converter function, to bypass conversion if
the audio format needs no conversion.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Attempt to completely fill the input buffer of the Rubber Band library
between each call to the process function, instead of processing in
as small an increment as the source node provides. May reduce processing
power required.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Audio Chunks now have full timestamp accounting, including DSP playback
speed ratio for the one DSP that can change play ratio, Rubber Band.
Inputs which support looping and actually reporting the absolute play
position now do so.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
In case multiple playlist entries are left marked as "current" in the
playlist database, resume playback on the first one, and unmark all the
rest of them.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
FreeSurround, like the Equalizer, which attempt to coalesce Audio Chunks
into larger blocks of 4096 samples, must check if the audio format has
changed between blocks, and stop stacking chunks together when a new
format is detected. They will continue processing with less sample data
than expected, as necessary.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The last of the built-in processors is now in the threaded processing
chain, and all DSPs are marked high priority and with short buffers.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Change one remaining semaphore wait to 500us, and change the buffering
so that it can always overflow the requested duration by one chunk, so
that at least one chunk will always fit in the buffer. This also allows
the DSP nodes to flush at the end of the stream without losing their
output.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The end of stream flushing should only request remaining samples once,
as should the rest of the process. The problem with the Rubber Band code
in this case is that it will wrap the remaining samples pointer after it
has been flushed, and emit a really huge number.
Also, add code to try to equalize the samples output with the samples
input, relative to the tempo stretching, as Rubber Band seems to flush
entirely too much data at end of stream, which can create noticeable
gaps in the output. This solves that as well.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This should be guarded, so that no other thread tries to free the DSP
while it is potentially writing to the Rubber Band instance.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This comment was copied by accident when duplicating the original
Converter Node class for the new DSP base.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
DSP threads, such as the Rubber Band processing, and planned moves of
other processing to buffer threads, such as the Equalizer, FreeSurround,
HRTF, and Downmixing for output, because they all have small output
buffers. Since these buffers drain and fill fast, they should be
processed at a high priority. Hopefully, App Store doesn't complain
about the use of these APIs.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The items not applicable to Finer / R3 engine were not being disabled
properly. Change the dialog to use a transformer to disable them on the
preferences value instead of coding it, since the code didn't seem to
work.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This class can more flexibly process and emit varying chunk sizes than
the previous code could, solving the problem of wide tempo changes.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Now there's a configuration dialog for tweaking the settings
in semi-real time. Everything that can be changed without
restarting is changed without restarting, otherwise the audio
pipeline is reset, which happens quickly enough anyway.
Awaiting translation to Spanish, other languages have been
removed pending their maintainers fixing most of their
problems, which includes me being lazy and AI translating
bits so I could rush updates.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The Polish, Russian, and Turkish translations have
no active maintainers, so I was stupidly relying on
AI translation to fill in the newer things. These
translations will sit mostly idle until I get active
maintainers for them.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This should improve performance slightly. It's
still recommended to switch off SceneKit to
save CPU usage, or switch of vis entirely.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Gah, how in heck did Xcode end up inserting an absolute
path? Fix that, and some other leftovers.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The TagLib framework build process leaves several
key fields empty. This breaks App Store submission.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Make exception handling more robust and thorough. Never
know what may happen, make sure to handle most cases.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Both the midi_processing and the various players may
throw exceptions, so we should check for these too.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
SSEQPlayer throws exceptions, there should be exception
handling to catch them and fail gracefully.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The TagLib C++ code was missing generic try/catch handling
which could result in any generic errors throwing straight
to a full crash. Add exception handling and logging, which
will fix a logged crash regardless of whether the tags are
read correctly or not by the newer TagLib version.
Fixes#415
Signed-off-by: Christopher Snowhill <kode54@gmail.com>