mixer save func basically working

main
mwinter 4 years ago
parent 8726241d91
commit 805ed9d5de

@ -0,0 +1,7 @@
{
"master_volume": 0.33644859813084,
"master_mute": 0,
"track_volumes": [0.5849582172702,0.37883008356546,0.46518105849582,0.67688022284123,0.29805013927577,0.63231197771588,0.59888579387187],
"track_mutes": [0,0,0,0,0,0,0],
"track_pans": [0.5,0.5,0.5,0.5,0.5,0.5,0.5]
}

@ -242,7 +242,7 @@ masterView = {arg win, preampBusses, accompBusses, postampBusses;
faderView = {arg win; faderView = {arg win;
var view, masterIndicators, trackIndicators, master, tracks, openButton, saveButton; var view, masterIndicators, trackIndicators, master, tracks, openButton, basePath, saveButton;
var partAbbr = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"]; var partAbbr = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var trackNames = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"]; var trackNames = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var partVols, partMutes, partPans; var partVols, partMutes, partPans;
@ -264,23 +264,37 @@ faderView = {arg win;
buildTrackFader.value(view, trackNames[part], part); buildTrackFader.value(view, trackNames[part], part);
} ! 7; } ! 7;
basePath = ~dir +/+ ".." +/+ "mixer_settings";
openButton = Button(view).states_([["open", Color.black]]).action_({ openButton = Button(view).states_([["open", Color.black]]).action_({
Dialog.openPanel({ arg path; Dialog.openPanel({ arg path;
path.postln; var settings;
},{ settings = File.readAllString(path).parseJSON;
"cancelled".postln; master[1].valueAction = settings["master_volume"];
}); master[2].valueAction = settings["master_pan"];
settings["track_volumes"].do({arg val, v; tracks[v][1].valueAction = val});
settings["track_mutes"].do({arg val, v; tracks[v][2].valueAction = val});
settings["track_pans"].do({arg val, v; tracks[v][3].valueAction = val});
},{}, false, basePath);
}); });
saveButton = Button(view).states_([["save", Color.black]]).action_({ saveButton = Button(view).states_([["save", Color.black]]).action_({
Dialog.savePanel({ arg path; Dialog.savePanel({ arg path;
path.postln; var settings, file;
},{ settings = "{\n";
"cancelled".postln; settings = settings ++ "\"master_volume\": " ++ master[1].value ++ ",\n";
}); settings = settings ++ "\"master_mute\": " ++ master[2].value ++ ",\n";
settings = settings ++ "\"track_volumes\": [" ++ tracks.collect({arg track; track[1].value}).join(",") ++ "],\n";
settings = settings ++ "\"track_mutes\": [" ++ tracks.collect({arg track; track[2].value}).join(",") ++ "],\n";
settings = settings ++ "\"track_pans\": [" ++ tracks.collect({arg track; track[3].value}).join(",") ++ "]\n";
settings = settings ++ "}";
file = File(path, "w");
file.write(settings);
file.close;
},{}, basePath);
}); });
view.layout_(HLayout(HLayout(master[0], nil, *tracks.slice(nil, 0)), VLayout(nil, openButton, saveButton))) view.layout_(HLayout(HLayout(master[0], nil, *tracks.slice(nil, 0)), VLayout(nil, saveButton, openButton)))
}; };

@ -429,7 +429,7 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
thisThread.randSeed = seed.postln; thisThread.randSeed = seed.postln;
# totalDur, section1Dur, dUnit, curLen, cadence, ultimate = [2 * 60, 1 * 60, 8.reciprocal, 0, false, false]; # totalDur, section1Dur, dUnit, curLen, cadence, ultimate = [6 * 60, 2 * 60, 8.reciprocal, 0, false, false];
# totalLen, section1Len = [(totalDur / dUnit).round(16), (section1Dur / dUnit).round(16)]; # totalLen, section1Len = [(totalDur / dUnit).round(16), (section1Dur / dUnit).round(16)];
# modeState, temporalState, partStates = [initModeState.value, initTemporalState.value, initPartStates.value]; # modeState, temporalState, partStates = [initModeState.value, initTemporalState.value, initPartStates.value];
# lastCadenceTemporalData, lastCadenceState, lastSectionPoint = [nil, modeState.deepCopy, 0]; # lastCadenceTemporalData, lastCadenceState, lastSectionPoint = [nil, modeState.deepCopy, 0];

@ -12,7 +12,7 @@ Tempo change will only go into effect once "set tempo" button is pressed.
Setting the address:port will create a pipe to recieve a message to advance the subsection externally with an OSC message '/nextSubsection. This could be used to set up a foot pedal / controller for the guitarist to advance the subsections manually. Setting the address:port will create a pipe to recieve a message to advance the subsection externally with an OSC message '/nextSubsection. This could be used to set up a foot pedal / controller for the guitarist to advance the subsections manually.
The default seed given in the application and reseeded when the "reset seed" button is pressed will generate the default music and score (as provided). Changing the seed will generate a new version with that seed once the "generate" button is pressed. After the new version is generated, new Lilypond files can be generated by pressing the "transcribe" button. This will create a cicc_score.ly file in a folder labeled "seed_[number]" which can be rendered by Lilypond. Note that the file must be rendered from that location as it dependes in files in that folder and the "includes" subfolder. The default seed given in the application and reseeded when the "reset seed" button is pressed will generate the default music and score (as provided). Changing the seed will generate a new version with that seed once the "generate" button is pressed. After the new version is generated, new Lilypond files can be generated by pressing the "transcribe" button. This will create a tkam_score.ly file in a folder labeled "seed_[number]" which can be rendered by Lilypond. Note that the file must be rendered from that location as it dependes on files in that folder and the "includes" subfolder.
~~~~mixer tab ~~~~mixer tab

Loading…
Cancel
Save