4Devs: Migration Manager (Include) v1.2

Migrate script parameters between different script versions using the supplied ‘Migration Manager Include’ script snippet.

The Problem
————–
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 Solution
————–

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)

Migration Demo
—————-
* 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.

Suitable Scripts
——————
– 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

Author
930 PM
  • Platform:
  • Category: Utility
  • Revision: 1.2
  • License: Creative Commons Attribution Share Alike 4.0
  • Views: 61
  • Modified: 6 days ago
Chat about this patch on Discord! Download (2)
Appreciate 1
2 comments on “4Devs: Migration Manager (Include) v1.2
  • -ki on said:

    Updated to v1.1
    ==============
    + Support for scripts with various OnTimer handlings.
    + Added a lot more in-script documentation
    + Added logging during the migration steps on sender and receiver
    + Demo showcases the more complicated script type c)
    ….. Using an own OnTimer, but intended with slower timer interval
    ….. and not running after OnLoad
    ….. In that case the timer must be temporary re-configured.

  • -ki on said:

    Updated to v1.2
    ==============
    + Better support for multiple active instances of the Manager in
    … several different scripts in one host session

  • Leave a Reply