You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3 KiB
Plaintext

5 years ago
(
// MAIN LAUNCH (loads necessary files and definitions)
var appEnvironment;
5 years ago
//push new environment
5 years ago
appEnvironment = Environment.make;
appEnvironment.push;
s.waitForBoot({
~hash = Date.getDate.hash.asString;
// load all files
"cicc_musical_data_generator.scd".loadRelative;
"cicc_sonifier.scd".loadRelative;
"cicc_gui.scd".loadRelative;
"cicc_transcriber.scd".loadRelative;
5 years ago
// generate all the data
~genAll = {arg seed;
~allMusicData = ~genMusicData.value(seed);
~patterns = ~allMusicData[0];
~scoreData = ~allMusicData[1];
~sectionOffsets = ~allMusicData[2];
~currentSection = 0;
~currentSubsection = 0;
~isPlaying = false;
};
5 years ago
// set the global variables
5 years ago
~tempoClock = TempoClock.new(90 / 60);
~dir = thisProcess.nowExecutingPath.dirname;
4 years ago
"loading app".postln;
~genAll.value(20200525);
5 years ago
~play = Synth.new(\masterPlayerControl ++ ~hash);
4 years ago
{
var freq1, freq2, tremRate;
freq1 = (50 + 7.rand2).midicps;
freq2 = (freq1.cpsmidi + 3.0.rand + 2).midicps;
tremRate = 50 + 4.0.rand2;
~interludeTremelo = Synth.new(\interludeTremelo ++ ~hash, [\freq1, freq1, \freq2, freq2, \tremRate, tremRate]);
}.value;
~autoAdvance = true;
~interludes = false;
~sectionOrder = ~patterns.size.collect({arg sec; sec});
~generateGUI.value;
4 years ago
"ready".postln;
});
5 years ago
appEnvironment.pop;
)