It is currently Fri Mar 29, 2024 10:38 am


Switch Secrets Sought?

Sampling pipe organs and turning them into something you can play in Hauptwerk.
  • Author
  • Message
Offline

jrball

Member

  • Posts: 197
  • Joined: Fri Feb 06, 2004 2:07 pm
  • Location: Virginia, US

Switch Secrets Sought?

PostSat Apr 02, 2022 4:25 pm

The CODM can do several useful TO actions but they each require 1 or 2 non-standard divisions. Before long we run out of them.

Therefore the ODF becomes essential. I have mapped out the switch-associated E-R diagrams for a STOP and a COUPLER. They show loops and dead ends and conflicting field values. The sample guide suggests that any logic can be done but is cryptic as to how. I have studied these diagrams for long enough to realize I may not solve it alone.

Does any other sample developer have a "switch logic guide" or even some partial insights to share with me?
Offline
User avatar

mdyde

Moderator

  • Posts: 15446
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Switch Secrets Sought?

PostSun Apr 03, 2022 4:41 am

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.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline

jrball

Member

  • Posts: 197
  • Joined: Fri Feb 06, 2004 2:07 pm
  • Location: Virginia, US

Re: Switch Secrets Sought?

PostWed Apr 06, 2022 12:19 pm

Martin,
I posed my question to developers to avoid taking your time. It didn't work.
So thank you for a most informative reply.

I have studied detailed flow diagrams for stop and coupler. Please consider a short question.

I see a coded link from Stop (StopID=123, ControllingSwitchID=890) to Switch890
The is another loop of switches and links involving the namesake SwitchID123
Where is the link to the namesake Switch123 to Stop123?
I cannot see a forward link from Stop (StopID=123) to Switch (SwitchID=123)
There does exist a backward link from Switch890. Does the engine work backwards?
Does the engine automatically invoke Switch123? When and why?
Thanks again,
John
Offline
User avatar

mdyde

Moderator

  • Posts: 15446
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Switch Secrets Sought?

PostWed Apr 06, 2022 12:40 pm

Thanks, John.

[I assume you're referring to an (unaltered) ODF that has been compiled by the CODM, although the following applies equally in all cases.]

Stop, StopRank, Rank, Keyboard, KeyboardKey, Division, and DivisionInput objects aren't themselves part of Hauptwerk's virtual 'relay' directly -- Hauptwerk just compiles them as needed to Switch and SwitchLinkage objects in memory as it loads the ODF. Hence you can't directly link to/from those objects using Switch/SwitchLinkage objects -- SwitchLinkages can only link to/from Switch objects. See also the "The organ control system" chapter in the sample set creator's guide for full details.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline

jrball

Member

  • Posts: 197
  • Joined: Fri Feb 06, 2004 2:07 pm
  • Location: Virginia, US

Re: Switch Secrets Sought?

PostWed Apr 06, 2022 12:44 pm

Martin,
Yes, of course. Sorry for my faux pas.
John
Offline
User avatar

mdyde

Moderator

  • Posts: 15446
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Switch Secrets Sought?

PostWed Apr 06, 2022 1:03 pm

Thanks, John. You're very welcome.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.

Return to Creating sample sets / recording organs

Who is online

Users browsing this forum: No registered users and 1 guest