Hello John,
Briefly (given that we only officially support ODF editing for major sample set producers), here are a few tips:
- Consider whether introducing additional intermediate 'node' switches helps for the logic you want to implement. E.g. keyboards' keys and coupled keys both play division action node switches, so that the couplers don't need to affect the keys themselves on the coupled division.
- Consider whether each switch should be latching or momentary. Latching switches can help to avoid infinite loops since linkages from a switch won't be followed if the switch is already in that state. Latching switches are also good for implementing 'memory' within a system.
- For complex logic, consider whether SwitchLinkage.EngageLinkActionCode/DisengageLinkActionCode values other than 1 and 2 (respectively) may help to simplify the logic.
- Similarly, SwitchLinkage.ReevaluateIfCondSwitchChangesState=N can be occasionally be useful, and SourceSwitchLinkIfEngaged=N and/or ConditionSwitchLinkIfEngaged=N allow inverting states (e.g. for NOT gates).
- Make a test ODF with just some displayed switches so that you can easily test out and debug logic between them (implementing nodes and linkages between them if/as necessary for the desired logic). E.g. as an exercise you could use it to implement standard logic gates (OR, AND, XOR, NOT, etc.).
- As general examples, have a look at the logic in ODFs that the CODM compiles (especially from CODM ODFs with more-complex features), and at the logic in non-encrypted full-format ODFs from sample set producers. Exporting ODFs to SQLite usually makes it quicker and easier to browse their data than by using XML alone. Then try drawing out diagrams showing how the switches and linkages connect together (indicating whether each switch is latching/momentary, whether each linkage inverts sates, its linkage actions [if other than 1=engage/2=disengage], etc.). For key/division/pipe logic, pick a single key (e.g. middle C) and follow the logic from it, drawing out a diagram to show it, so that you can see more easily how it works.