Scripts Reference

Why Script in Usine?

Usine's scripting layer opens inventive shortcuts that factory modules alone cannot offer. It lets you adapt patches to evolving shows, automate workflows, and share bespoke tools with collaborators. The learning curve is friendly when you build on the reference pages and sample modules bundled here.

Advantages

  • Extend modules with custom logic while staying inside the patching mindset.
  • Automate repetitive edits, calibration routines, or show prep in minutes.
  • Access workspace objects, buses, and UI from one Pascal-flavoured language.
  • Prototype ideas quickly, then wrap them into reusable libraries for your team.

Drawbacks (worth tackling)

  • Pascal-style syntax needs a little acclimation, yet the docs and snippets keep you moving.
  • Debugging demands planning, but Trace output and chunk logging spotlight issues fast.
  • Efficiency matters; fortunately callbacks, ProcessThread, and IDLE contexts keep audio safe.

Use Cases

  • Build adaptive arpeggiators or sequencers responsive to live gestures.
  • Design monitoring panels that recolor racks and broadcast status across the workspace.
  • Auto-assemble patches, route buses, or synchronize remote devices before each performance.
  • Generate MIDI clips, OSC gestures, or lighting cues from sensor feeds and global arrays.
procedure Init;
begin
  Trace('Script engine ready to explore!');
end;

What can you find in this?

  • Quick primers on script lifecycle, callbacks, and performance best practices.
  • A parameter cookbook covering creation, formatting, and UI behaviors.
  • An object access atlas for grabbing or setting values anywhere in the workspace.
  • Step-by-step array, bus, and chunk recipes for moving data between modules.
  • String and file utilities ready for logging, parsing, and content generation.
  • Math and randomization cheatsheets to animate scores or generative patches.
  • Messaging and automation patterns for IML, dynamic patching, and routing.
  • Color, variant, and date/time helper indexes for interface polish and timing.
  • Windows-specific persistence tips with registry read/write examples.
  • A mega summary page that links every API table for lightning-fast lookups.

Chapters

version 7.0.250121

Edit All Pages