main
mwinter 4 years ago
parent 805ed9d5de
commit 245865ef41

@ -1,4 +1,4 @@
\version "2.19.83" \version "2.22.0"
#(define (override-color-for-all-grobs color) #(define (override-color-for-all-grobs color)
(lambda (context) (lambda (context)
@ -75,7 +75,7 @@
(stretchability . 0)) (stretchability . 0))
%systems-per-page = 3 %systems-per-page = 3
first-page-number = 1 first-page-number = 4
print-first-page-number = ##t print-first-page-number = ##t
print-page-number = ##t print-page-number = ##t
@ -137,7 +137,7 @@
(minimum-distance . 20 ) (minimum-distance . 20 )
(padding . 0 ) (padding . 0 )
(stretchability . 0)) (stretchability . 0))
\override TextScript.staff-padding = #2 \override TextScript.staff-padding = #1
\override TextScript.self-alignment-X = #0 \override TextScript.self-alignment-X = #0
} }
\context { \context {

@ -243,8 +243,8 @@ masterView = {arg win, preampBusses, accompBusses, postampBusses;
faderView = {arg win; faderView = {arg win;
var view, masterIndicators, trackIndicators, master, tracks, openButton, basePath, 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_II", "accomp_I", "click"];
var trackNames = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"]; var trackNames = ["*", "III", "II", "I", "accomp_II", "accomp_I", "click"];
var partVols, partMutes, partPans; var partVols, partMutes, partPans;
var masterMute, masterVol; var masterMute, masterVol;

@ -38,7 +38,7 @@ frNearestInList = {arg frComp, frDict;
frDict.reject({arg item; frDict.reject({arg item;
(item[\root][0] == frComp[1]) || (item[\root][0] == frComp[1]) ||
(item[\fr] == frComp[1]) (item[\fr] == frComp[1])
}).keys.asList.sort({arg a, b; a.asString < b.asString}).do({arg fr; }).keys.asList.sort({arg a, b; harmonicDistance.value(a) < harmonicDistance.value(b)}).do({arg fr;
var diff = abs(frToFloat.value(fr) - frToFloat.value(frComp[0])); var diff = abs(frToFloat.value(fr) - frToFloat.value(frComp[0]));
if(diff < diffNearest, {diffNearest = diff; frNearest = fr}); if(diff < diffNearest, {diffNearest = diff; frNearest = fr});
}); });
@ -82,10 +82,13 @@ hdChoose = {arg mode, exp = 1, weights = [1, 1, 1, 1, 1, 1, 1];
mode.wchoose(probs.normalizeSum) mode.wchoose(probs.normalizeSum)
}; };
//faster sorting algorithm? wchooseDict = {arg dict, exp = 1, limit = 0, isFR = true;
wchooseDict = {arg dict, exp = 1, limit = 0;
var keyList, probs; var keyList, probs;
keyList = dict.keys.asList.sort({arg a, b; a.asString < b.asString}); keyList = if(isFR, {
dict.keys.asList.sort({arg a, b; harmonicDistance.value(a) < harmonicDistance.value(b)});
}, {
dict.keys.asList.sort({arg a, b; a.convertDigits(2) < b.convertDigits(2)});
});
probs = keyList.collect({arg key; probs = keyList.collect({arg key;
var count = dict[key][\count]; var count = dict[key][\count];
if(count < limit, {0}, {count}) if(count < limit, {0}, {count})
@ -95,7 +98,7 @@ wchooseDict = {arg dict, exp = 1, limit = 0;
}; };
collectRoots = {arg dict; dict.keys.collect({arg fr; collectRoots = {arg dict; dict.keys.collect({arg fr;
dict[fr][\root][0]}).asList.sort({arg a, b; a.asString < b.asString}) dict[fr][\root][0]}).asList.sort({arg a, b; harmonicDistance.value(a) < harmonicDistance.value(b)});
}; };
@ -192,7 +195,7 @@ genTemporalData = {arg lastTupleState, modeState, cadenceOverride, noParts = 4;
cadence = if(collectRoots.value(modeState).size == 1, {cadenceOverride.not}, {false}); cadence = if(collectRoots.value(modeState).size == 1, {cadenceOverride.not}, {false});
curTupleState = lastTupleState.deepCopy; curTupleState = lastTupleState.deepCopy;
timeToNextEvent = (64 + 50.rand + if(cadence, {50}, {0})).round(16); timeToNextEvent = (64 + 50.rand + if(cadence, {50}, {0})).round(16);
tuple = wchooseDict.value(curTupleState); tuple = wchooseDict.value(curTupleState, isFR: false);
if(cadence, {tuple = [1, 1, 1]}); if(cadence, {tuple = [1, 1, 1]});
curTupleState = curTupleState.keysValuesDo({arg key, val; curTupleState = curTupleState.keysValuesDo({arg key, val;
curTupleState[key][\count] = val[\count] + 1}); curTupleState[key][\count] = val[\count] + 1});

@ -56,7 +56,7 @@ lyStaffDef = {arg name, nameShort, nameMidi;
"\\new Staff = \"" ++ name ++ "\" \\with { \n" ++ "\\new Staff = \"" ++ name ++ "\" \\with { \n" ++
"instrumentName = \"" ++ name ++ "\" \n" ++ "instrumentName = \"" ++ name ++ "\" \n" ++
"shortInstrumentName = \"" ++ nameShort ++ "\" \n" ++ "shortInstrumentName = \"" ++ nameShort ++ "\" \n" ++
"midiInstrument = #\"" ++ nameMidi ++ "\"\n" ++ "midiInstrument = #\"" ++ nameMidi ++ "\" \n" ++
"\n}\n" "\n}\n"
}; };

Loading…
Cancel
Save