Skip to content

Commit

Permalink
fix bug in saving global params, looping is forced off at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
vizicist committed Dec 12, 2024
1 parent 6a3e626 commit ffaa1ff
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 115 deletions.
1 change: 1 addition & 0 deletions build/windows/build_all_mmtt_versions.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ call clean.bat
call build.bat

set PALETTE_MMTT=%save_PALETTE_MMTT%
set save_PALETTE_MMTT=
3 changes: 2 additions & 1 deletion build/windows/build_data.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ if not "%PALETTE_SOURCE%" == "" goto keepgoing1
:keepgoing1

set ship=%PALETTE_SOURCE%\build\windows\ship
set datadir=data_%data%

rm -fr %PALETTE_SOURCE%\%datadir%\logs
rm -fr %ship% > nul 2>&1
mkdir %ship%

set datadir=data_%data%
echo ================ Copying %datadir%
mkdir %ship%\%datadir%
xcopy /e /y %PALETTE_SOURCE%\%datadir%\* %ship%\%datadir% >nul
Expand Down
2 changes: 2 additions & 0 deletions build/windows/clean.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ rm -fr %PALETTE_SOURCE%\depthlib\build\.vs
rm -fr %PALETTE_SOURCE%\depthlib\build\x64
rm -fr %PALETTE_SOURCE%\depthlib\build\*.dir
del /s %PALETTE_SOURCE%\mmtt_kinect\build\windows\*.obj >nul 2>nul
del /s %PALETTE_SOURCE%\data_sfmoma\logs\*.log >nul 2>nul
del /s %PALETTE_SOURCE%\data_omnisphere\logs\*.log >nul 2>nul

:getout
4 changes: 2 additions & 2 deletions data_omnisphere/config/paramdefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@
"global.keykitoutput": {"valuetype":"string", "min":"", "max":"", "init":"Microsoft GS Wavetable Synth", "comment":"#" },
"global.keykitallow": {"valuetype":"string", "min":"", "max":"", "init":"127.0.0.1", "comment":"#" },
"global.log": {"valuetype":"string", "min":"log", "max":"log", "init":"", "comment":"# log type" },
"global.looping_override": {"valuetype":"bool", "min":"false", "max":"true", "init":"false", "comment":"#" },
"global.looping_fade": {"valuetype": "float", "min": "0.0", "max": "1.0", "init": "0.5", "comment": "# default fade factor" },
"global.looping_override": {"valuetype":"bool", "min":"false", "max":"true", "init":"true", "comment":"#" },
"global.looping_fade": {"valuetype": "float", "min": "0.0", "max": "1.0", "init": "0.0", "comment": "# default fade factor" },
"global.looping_fadethreshold": {"valuetype": "float", "min": "0.001", "max": "0.5", "init": "0.01", "comment": "# " },
"global.looping_beats": {"valuetype":"int", "min":"1", "max":"128", "init":"8", "comment":"# Loop length in beats" },
"global.emailto": {"valuetype":"string", "min":"", "max":"", "init":"", "comment":"#" },
Expand Down
2 changes: 1 addition & 1 deletion data_omnisphere/saved/global/Ambient.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"global.looping_beats":"8",
"global.looping_fade":"1.000000",
"global.looping_fadethreshold":"0.500000",
"global.looping_override":"false",
"global.looping_override":"true",
"global.midiinput":"",
"global.midisetexternalscale":"false",
"global.midithru":"false",
Expand Down
3 changes: 2 additions & 1 deletion data_omnisphere/saved/global/Looping_Off.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"params": {
"global.looping_override":"false"
"global.looping_override":"true",
"global.looping_fade":"0.000000"
}
}
4 changes: 2 additions & 2 deletions data_sfmoma/config/paramdefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@
"global.keykitoutput": {"valuetype":"string", "min":"", "max":"", "init":"Microsoft GS Wavetable Synth", "comment":"#" },
"global.keykitallow": {"valuetype":"string", "min":"", "max":"", "init":"127.0.0.1", "comment":"#" },
"global.log": {"valuetype":"string", "min":"log", "max":"log", "init":"", "comment":"# log type" },
"global.looping_override": {"valuetype":"bool", "min":"false", "max":"true", "init":"false", "comment":"#" },
"global.looping_fade": {"valuetype": "float", "min": "0.0", "max": "1.0", "init": "0.5", "comment": "# default fade factor" },
"global.looping_override": {"valuetype":"bool", "min":"false", "max":"true", "init":"true", "comment":"#" },
"global.looping_fade": {"valuetype": "float", "min": "0.0", "max": "1.0", "init": "0.0", "comment": "# default fade factor" },
"global.looping_fadethreshold": {"valuetype": "float", "min": "0.001", "max": "0.5", "init": "0.01", "comment": "# " },
"global.looping_beats": {"valuetype":"int", "min":"1", "max":"128", "init":"8", "comment":"# Loop length in beats" },
"global.emailto": {"valuetype":"string", "min":"", "max":"", "init":"", "comment":"#" },
Expand Down
105 changes: 0 additions & 105 deletions data_sfmoma/logs/palette.log

This file was deleted.

3 changes: 2 additions & 1 deletion data_sfmoma/saved/global/Looping_Off.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"params": {
"global.looping_override":"false"
"global.looping_override":"true",
"global.looping_fade":"0.000000"
}
}
Binary file removed data_surge_old.zip
Binary file not shown.
18 changes: 16 additions & 2 deletions kit/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,21 @@ func InitEngine() {

for name := range ParamDefs {
if strings.HasPrefix(name, "global.") {
LogInfo("global name","name",name)
// LogInfo("global name","name",name)
ActivateGlobalParam(name)
}
}

LogInfo("PaletteDataPath","path",PaletteDataPath())

// To avoid confusion, force looping off at startup
LogInfo("Looping is being forced off")
err := GlobalParams.SetParamWithString("global.looping_override", "true")
LogIfError(err)
err = GlobalParams.SetParamWithString("global.looping_fade", "0.00")
LogIfError(err)
err = SaveCurrentGlobalParams()
LogIfError(err)
}

func LocalEngineApi(api string, args ...string) (map[string]string, error) {
Expand Down Expand Up @@ -203,7 +214,10 @@ func LoadGlobalParamsFrom(filename string, activate bool) (err error) {
ActivateGlobalParam(nm)
}
}
return nil
if filename != "_Current" {
err = SaveCurrentGlobalParams()
}
return err
}

func (e *Engine) Start() {
Expand Down
Binary file modified release/palette_8.06_data_omnisphere.exe
Binary file not shown.
Binary file modified release/palette_8.06_data_sfmoma.exe
Binary file not shown.
Binary file modified release/palette_8.06_win_setup.exe
Binary file not shown.
Binary file modified release/palette_8.06_win_setup_with_kinect.exe
Binary file not shown.

0 comments on commit ffaa1ff

Please sign in to comment.