pac-dev / protoplug

Create audio plugins on-the-fly with LuaJIT.
Other
282 stars 36 forks source link

EBM generator [broken] #42

Open severak opened 3 years ago

severak commented 3 years ago

I modified your atonal MIDI generator to generate some EBM riffs. It somewhat works, but I ran into some some issues:

See ebmgen.lua

interstar commented 3 years ago

I don't know, but one thought on your first problem.

The "changed" function in the "Is playing" param is trying to turn the note off by calling noteOff which updates newEvents.

But is all this in scope from within the param code?

I presume it stops, because is_playing is successfully changed within that handler. But is_playing is declared as local within the plugin. OTOH, newEvents is just created inside plugin.processBlock ... I wonder what its scope is and if it's visible within the "Is playing" parameter's "changed" method (which might be running in a different thread)

severak commented 3 years ago

@interstar good points! I updated code using your findings and now it actually works. Thanks a lot!