Norns-Crow distributed computation library #300
Comments
Why?I really like writing scripts that run standalone on crow, but there's a couple issues:
This proposed library attempts to remove the awkwardness of writing crow & norns scripts that can coexist. I specifically want to write sequencers that run on crow, but use norns as an interface into configuring that sequence (and performing other more norns-y duties). Similarly, I'd love to build a single screen norns script that allows for configuration of the 4 output channels, triggerable/resettable by the inputs. This concept could be extended to a multi-page script with modular assignment of inputs/metros/ii to outputs/variables/ii. Currently this kind of thing is only possible with Max, or by rolling your own application from scratch. It would also be nice to have a simple crow-script-loader on norns which can pull in the Questions
|
|
like the norns params! this is useful for the webapp idea. @tehn has some ideas on how this can be almost identical to the params system and not need to reinvent a whole new interaction metaphor! |
|
might actually not need something as heavy as the norns params system, but worth looking at as a reference and for potential continuity. a super-simple approach may be something like:
the script itself can be super simple, ie, not using get-set methods, just accessing the "remote" norns script or web UI can modify a running script by simply setting the value to "store" a "preset" the crow script gets rewritten with a code block at the end which sets the
the remote editor/controller (which is basically reading the crow script and sending it to crow for execution) can scrape a comment to populate the UI elements:
the what remains then is to identify the param types and attributes we'd like to support. if a script doesn't have a |
|
re: serial via web |
Motivation
norns scripts almost universally control crow's behaviour with direct commands being called by the active norns script. When a musician wants to have crow operate in a free-standing manner, they typically will write a script in a text editor & upload with the
druidapplication. one goal of this issue is to unify these processes for norns users (ie, edit & upload crow-scripts from norns (via maiden)), and provide a mechanism for distributed computation on crow.Edit & Upload
This element simply requires a bulk-upload command to be added to the
norns.crowlibrary. It just extends the current functionality of uploading short code-blocks with the appropriateuploadandruncommands, and some timing management to make sure buffers aren't overflowed.I have a working prototype of this, but it needs stress testing (hasn't been tested since crow 1.0.1).
Distributed components
This section is about a mutual library that makes distributed computation on crow work seamlessly with the existing norns platform. This is useful / meaningful in two contexts:
A lua library is required for both norns & crow. I'm currently calling it
syncbut this needs to be changed. These libraries will perform a handshake when connected, maintain synchronization of shared parameters, store parameters, and gracefully handle disconnection.norns lib
*.luafile from the file-system to an attached crowcrow lib
Parameter synchronization
Consider that the params are 'owned' by crow, so:
remoteparameter.publicparameter.All actions on these parameters are just like normal lua usage, implemented with metatables, so you can assign to, and read from, a public/remote parameter regardless of which device you're on. When a param is changed it will automatically be updated on the other device (though no callback event is triggered).
Either device may declare a parameter, though the idiom shall be to declare them all in the crow init function. This is to allow crow to handle initialization from saved or default values, in lieu of an active connection to norns.
Either device may put functions into the shared table enabling the other device to call those functions.
Initially, numbers, and strings will be supported as data types. In future I'd like to add bools & flat tables, and perhaps nested tables later on.
Saving a parameter set is implemented by re-uploading the script with the list of remote params appended to the script. When crow initializes, it will check if the
sync.sharedtable already has data, indicating the defaults should not be used.example
This doesn't do anything interesting, but it shows the way params are handled natively in both cases (just inside the
syncnamespace). Demonstrates reading & updating params on both devices, calling functions on a remote device, and load/save functionality.The text was updated successfully, but these errors were encountered: