Skip to content

Using the Copy Bindings Command in Cantabile Batch Editor

Cantabile Batch Editor (CBE) version 1.3 introduces a new command – ‘Copy Bindings’. This feature was suggested by a CBE user – thanks for the idea, Michael!

What’s it For?

Have you ever wished that you could copy bindings from one song or rack to several other songs or racks? Here’s a common scenario: You create a song file that you use as a template for all other songs. After creating a couple dozen songs, you realize that it would be handy to add a new binding to your template. Fine, that’s easy enough, but what about all the songs you already created with the old template? Those will not get changed. Adding the new binding to each file one at a time would be a real pain. That’s where the Copy Bindings command comes into play. Simply choose a source file that contains one or more bindings that you want to copy. CBE will find all of the bindings in that file and present them in a list like the one shown above. It even color codes them according to the colors assigned in Cantabile! Check the bindings you want to copy, press the ‘Copy Bindings’ button, and CBE will copy all selected bindings to every file in the File List on the main screen.

State Handling

One tricky aspect of developing this feature is that binding properties can change with song or rack states. Since the source and target files likely have different state names and counts, it isn’t possible to simply copy all of the JSON text found in a binding definition in a .cantabileSong or .cantabileRack file. To deal with this issue, the Copy Bindings command lets you choose between two ways to handle binding state data:

1- Ignore States: Most bindings have no need to change behavior from one state to the next. Even when they do, you may not want to copy these state changes to a new song, as they are likely specific to the song they were created in. For this reason, the default behavior is to ignore states – only the default properties of the binding will be copied.

2- Copy All Possible State Data: All changes in binding properties due to state changes will be copied, limited by the number of states in the target file. States are matched by name first, then by position. For example, if your source file has four states:

  • Intro
  • Verse
  • Chorus
  • Bridge

And a target file has these three states:

  • Verse
  • Chorus
  • Outro

The binding state data will get copied like so:

Note that binding data for ‘Bridge’ does not get copied to the target file, because there are only three states in the target file. You may be wondering why ‘Intro’ gets mapped to ‘Outro’. CBE first matches states by name, so ‘Verse’ maps to ‘Verse’ and ‘Chorus’ maps to ‘Chorus’. After that, it matches whatever is left over by position. ‘Intro’ is the first unmatched source state and ‘Outro’ is the first unmatched target state, so they get matched together. While that may not seem the most logical in this case, it illustrates the need to think carefully about how you want state data mapped. There is no simple, one-size-fits-all approach to this, so in the interest of keeping the UI simple, I settled on the above approach which should work well for most cases. Keep in mind, you can always edit the bindings after copying for special cases.

Available Now

You can download Cantabile Batch Editor 1.3 for free here: Download CBE 1.3

Leave a Reply