Skip to content

Lua livecoding design document

James H Ball edited this page Jun 4, 2022 · 1 revision

Allows an audio effect or audio source (e.g. in addition to .obj, .svg, etc.) to be loaded from a .lua file. This would allow users to define their own custom audio effects and audio sources, allowing for infinitely extensible functionality to osci-render.

Implementation

  • Use luaj, a lua interpreter for Java https://github.com/luaj/luaj
  • Create a code editor based on this gist https://gist.github.com/jewelsea/1463485
    • The code editor would be a separate window
    • Any changes are live-updated and applied immediately
    • If the new code doesn't run correctly, use a previous version of the code to try and prevent any harsh pauses in the effect
      • If this isn't possible, you can have the effect return the input audio samples on any errors
  • Have a function that the user must define which is then called by osci-render to either generate audio or apply an audio effect
    • All boilerplate for this function and the lua code can be included when creating a new effect/file
  • Have any lua files created saved with the .osci project file
  • Allow extensible and unlimited extra effects
    • This means you can apply multiple lua effects
Clone this wiki locally