GrandOrgue / GoOdf

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

Number of pipes to load from ranks is not always correct #11

Closed davidgritter closed 1 year ago

davidgritter commented 1 year ago

Loading incorrect number of pipes from ranks

Foreign ODF defines a stop as follows Note that Rank999PipeCount is included: [Stop008] Name=2009_Principal 4 NumberOfAccessiblePipes=32 FirstAccessiblePipeLogicalKeyNumber=1 NumberOfRanks=2 Rank001=015 Rank001PipeCount=32 Rank001FirstAccessibleKeyNumber=1 Rank001FirstPipeNumber=13 Rank002=016 Rank002PipeCount=32 Rank002FirstAccessibleKeyNumber=1 Rank002FirstPipeNumber=13 Function=And SwitchCount=1 Switch001=036

GOODF reads this correctly, and writes to its own ODF file the following data. Note that Rank999PipeCount is not written out. but GrandOrgue properly loads data for the stop;

[Stop008] Name=2009_Principal 4 Function=And SwitchCount=1 Switch001=036 FirstAccessiblePipeLogicalKeyNumber=1 NumberOfAccessiblePipes=32 NumberOfRanks=2 Rank001=015 Rank001FirstPipeNumber=13 Rank002=016 Rank002FirstPipeNumber=13

Now if GOODF reads the ODF it just wrote, then writes it out again without any manual changes we get the following data:

[Stop008] Name=2009_Principal 4 Function=And SwitchCount=1 Switch001=036 FirstAccessiblePipeLogicalKeyNumber=1 NumberOfAccessiblePipes=32 NumberOfRanks=2 Rank001=015 Rank001FirstPipeNumber=13 Rank001PipeCount=44 Rank002=016 Rank002FirstPipeNumber=13 Rank002PipeCount=44

PipeCount is now 44, which throws a GrandOrgue error. Note that in GOOODF Gui itself the PipeCount reads the correct value of 32

larspalo commented 1 year ago

GOODF reads this correctly, and writes to its own ODF file the following data. Note that Rank999PipeCount is not written out. but GrandOrgue properly loads data for the stop

This is by default. If all the remaining pipes are used then the pipe count is not needed.

PipeCount is now 44, which throws a GrandOrgue error. Note that in GOOODF Gui itself the PipeCount reads the correct value of 32

Right. The calculations were done in the Stop panel gui for display but never applied to the backend reference itself which then would have wrong value. I've tried to fix this issue by implementing that calculation already at reading time so that it should match the default calculation later at writing time... This (as well as a few other issues) should be fixed with my latest commit.

davidgritter commented 1 year ago

latest commit has this issue working properly now -- tested with first pipe =13 and first pipe =25

davidgritter commented 1 year ago

However, there is still a problem if the initial ODF has the wrong value: In the example above when [Stop008] Name=2009_Principal 4 Function=And SwitchCount=1 Switch001=036 FirstAccessiblePipeLogicalKeyNumber=1 NumberOfAccessiblePipes=32 NumberOfRanks=2 Rank001=015 Rank001FirstPipeNumber=13 Rank001PipeCount=44 Rank002=016 Rank002FirstPipeNumber=13 Rank002PipeCount=44

Is read into GOODF, the GOODF GUI displays the PipeCount as 32. If I retype as 32 in the GUI then save to the ODF the pipe count in the new ODF remains at 44. However if I retype as 25 in the GUI, the pipe count changes to 25 when I save the odf. If I edit the value of 32 by hitting the minus then the plus in the data entry box the ODF is written correcty (there is no pipe count written, which per our conversation before is acceptable) To my mind, if the incorrect value in the original odf is read, it should be displayed as read in the GUI, or GOODF should make an immediate correction so that the 32 that's shown in the GUI is written to the ODF when a save is done

larspalo commented 1 year ago

@davidgritter The latest commit should fix this.