Skip to content

Commit

Permalink
Add SampleRate and BlockSize to Formula Modulator
Browse files Browse the repository at this point in the history
This is required to write a slew limiter, which we also do in
example 12

Closes surge-synthesizer#5580
  • Loading branch information
baconpaul committed Dec 6, 2021
1 parent 28d1054 commit 753d300
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Binary file not shown.
8 changes: 8 additions & 0 deletions src/common/dsp/modulators/FormulaModulationHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ end

lua_settable(s.L, -3);

lua_pushstring(s.L, "samplerate");
lua_pushnumber(s.L, samplerate);
lua_settable(s.L, -3);

lua_pushstring(s.L, "block_size");
lua_pushnumber(s.L, BLOCK_SIZE);
lua_settable(s.L, -3);

if (lua_isfunction(s.L, -2))
{
auto cres = lua_pcall(s.L, 1, 1, 0);
Expand Down

0 comments on commit 753d300

Please sign in to comment.