Conversation
…Y_NUM_BUSES], compiles, still works - except echo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements most of #114
This adds a new "bus" field to
amy_eventandstruct synthinfo.amy_globalnow has an array ofbus_state_t *bus[AMY_NUM_BUSES]each of which holds params (and pointers to private buffers) for EQ, reverb, chorus, and echo.amy_renderlooks at thebusfield of the "lead osc" for each note, and callsrender_osc_wavewith a pointer to the bus-specific buffer, thus collecting the output for each bus separately (we now haveAMY_NUM_BUSES * AMY_MAX_CORESbuffers).amy_fill_bufferexecutes EQ, Chorus, Echo and Reverb separately for each active bus, then sums the results across buses, scaled byamy_global.volume[bus], before converting to the final output samples. So,volume=<bus0_level>,<bus1_level>,...'` is now a list.Apart from converting all the global buffers for the FX into resources managed by a struct, the weirdest thing I had to do was to hijack the
d->oscfield instructure deltato hold the value of the bus (instead of the osc) for commands that are setting the params of a bus - otherwise, there's no way to combine both the parameter value with the bus to which it is meant to apply in a delta. So there's a big explicit conditional inamy_event_to_deltas_queuethat treats all the EQ, echo, chorus, and reverb commands as a special-case. It's a bit clumsy, but not a bad solution. Maybe we should renamed->oscto bed->targetsince it's not always an osc now, but that's just to avoid misdirecting readers of the code.This went so much more smoothly than I expected. One 4 hour session to move all the FX state into structures so they could be multiply-allocated, then another 4 hour session to actually implement the per-bus processing.