Loris applyFilter doesn't seem to work
-
Unless I'm not shaping the
data
object correctly for the filter?// using time in seconds (default) // pitch shift works (example from the Loris docs) var pitchShiftData = [[0.0, 0], [0.2, 0], [0.4, 300], [0.4, -300], [0.6, 0]]; lorisManager.process(file, "shiftPitch", data); // doesn't work, just mutes the output var filterData = [[0.0, 0], [0.2, 0], [0.4, 1], [0.4, .5], [0.6, 0]]; lorisManager.process(file, "applyFilter", filterData); // also doesn't work, same result var filterData = [[0.0, 0], [0.2, 0], [0.4, 20000], [0.4, 10000], [0.6, 0]]; lorisManager.process(file, "applyFilter", filterData);
Edit - here's the source code for it:
if (command == ProcessIds::applyFilter) { juce::ScopedValueSetter<TimeDomainType> svs(options.currentDomainType, TimeDomainType::Frequency); auto env = createEnvelopeFromJSON(data); for (auto& l : list) // for each partial { for (auto& p : *l) // i assume this is the envelope { for (auto& b : p) // for each breakpoint in the envelope { auto freq = breakpoint_getFrequency(&b); // "returns the frequency of the specified breakpoint" auto gain = linearEnvelope_valueAt(env, freq); // "returns the interpolated value of this linearEnvelope at the specified time" gain *= breakpoint_getAmplitude(&b); // "returns the absolute amplitude of the specified breakpoint" breakpoint_setAmplitude(&b, gain); // "assigns a new (absolute) amplitude to the specified breakpoint" } } } destroyLinearEnvelope(env); return true; }
Shouldn't the
linearEnvelope_valueAt
function be taking a time value, not a frequency? Or is that being handled by the ScopedValueSetter?