Migrate script parameters between different script versions using the supplied ‘Migration Manager Include’ script snippet.
One can easily state-safe a script and reload its full settings including the scripts source
into another Mozaic instance – but if you change the source and do an ‘upload’ or load a
newer version of the script, all your precious settings are lost.
The ‘Migration Manager Script Include’ adds version independent script-to-script parameter transmission to any of your scripts, with minimal support from your code (add 3 event calls, and define 4 events for callbacks)
* Load two Mozaic instances containing this demo script. Both will show differnt
random IDs on the right and have different pad colors. The SEL knob toggles the
display the three migrated arrays, all based on the ID.
* Save a new preset of the instance you want to transfer.
* In the receiver instance, double tap the IMPORT knob to start waiting for data
* Reload the saved preset in the sender instance.
* The ‘receiver’ will pick up the values of the arrays and the color scheme of the
‘sender’, but keep its ID (because that’s not transfered)
Migration Instructions for ‘End Users’
* Before loading a new script version, save the to-be-preseved configuration to a new
preset name (either in the host or in Mozaic)
* Update the script to the new version by loading the script – this will come up with
the scripts default settings
* Turn the IMPORT knob of the script
* Open a second Moazic instance and load the save configuration, you have
ten seconds to do this
* The new version will pick up the configuration and you are ready to go
Use-Case for Script-Devs
If you are a script dev, you can use this feature to fast-restre your settings after
you minimally changed code and hit ‘UPLOAD’. Just keep the ‘sender’ instance open
and reload it when importing to the receiver.
– Your script should have many parmeters, more than you would like to dial in manually
either when updating or for every test during development the script
– Updating of the script should be intended
Adding the ‘Migration Manager’ to own scripts
You just need to add the ‘include part’ from the end of this script starting below the line
>>>>>>>> MIGRATION MANAGER INCLUDE <<<<<<<<
to the end of your own script.
Add an 'IMPORT' knob in your scripts GUI and call two MigrationManager event functions,
one at the end of your @OnLoad and the other when the 'IMPORT' knob is turned.
Your scipt also needs to define the 4 event functions @MigrateSend, @MigrateRead, @MigrateImportDone
and @MigrateExportDone that will be called be the Migration Manager. The comments
in these demo scripts functions point out what these functions need to do.
Other examples for Migration Manager Usage
* The 'MIDI MultiCast' script transfers its up to 7×16 routing scenes and config variables
* The 'MutatoR' transfers around 12KB of data in 13 migration steps