GrandOrgue / GoOdf

A tool for creating/editing organ definition files for GrandOrgue
GNU General Public License v3.0
11 stars 1 forks source link

writing and reading switch references in stops #21

Closed davidgritter closed 1 year ago

davidgritter commented 1 year ago

I am creating stops to implement the drawstop sounds when a switch is activated and de-activated. There is a stop, '1on' to reference the stop on sound through an external rank. There is a second stop, '1off ' to reference the stop off sound through an external rank. 1on references a switch using the 'and' function, and 1off references the same switch using a 'not' function. Goodf writes the following to the odf:

[Stop056] Name=1on Function=And SwitchCount=1 Switch001=002 FirstAccessiblePipeLogicalKeyNumber=1 NumberOfAccessiblePipes=1 NumberOfRanks=1 Rank001=127

[Stop057] Name=1off Function=Not Switch001=2 FirstAccessiblePipeLogicalKeyNumber=1 NumberOfAccessiblePipes=1 NumberOfRanks=1 Rank001=128

note that GOODF v5.1 (compiled today) writes the [Stop057] Switch001=2 rather than 002 as it does for [stop056]. Then when GOODF reads the ODF file back in, the switch referenced by [Stop057] no longer appear as referenced. This happens even if I edit the ODF file to change =2 to =002.
My guess is that this is due to the fact that [Stop057] does not include a SwitchCount parameter (none needed for the not function?), but that GOODF ignores the Switch001 parameter when it does not see the SwitchCount

larspalo commented 1 year ago

@davidgritter This should be fixed with the latest commit.

davidgritter commented 1 year ago

I tested this and it appears to workas expected, issue can be closed