Compare commits

..

No commits in common. "18253e6ba2dd5d54c7bb2b420b8aeeede69c2fab" and "8726241d91cf754dc2b7aa8b78b2405eac26f8b1" have entirely different histories.

19 changed files with 2668 additions and 27995 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,171 +0,0 @@
\version "2.19.83"
#(define (override-color-for-all-grobs color)
(lambda (context)
(let loop ((x all-grob-descriptions))
(if (not (null? x))
(let ((grob-name (caar x)))
(ly:context-pushpop-property context grob-name 'color color)
(loop (cdr x)))))))
#(define-markup-command (relMark layout props mus) (ly:music?)
#:properties ((size -2))
(interpret-markup layout props
#{
\markup {
\score {
\new Staff { $mus }
\layout {
\context {
\Staff
\remove Time_signature_engraver
fontSize = #-2
\hide Stem
\override TextScript.outside-staff-priority = ##f
\override StaffSymbol.staff-space = #(magstep -2)
\override StaffSymbol.thickness = #(magstep -2)
\override TextScript.self-alignment-X = #-0.4
\override TextScript.staff-padding = #1
}
\context {
\Score
proportionalNotationDuration = #(ly:make-moment 1/16)
\remove "Separating_line_group_engraver"
\override SpacingSpanner.strict-note-spacing = ##t
\override RehearsalMark.self-alignment-X = #-1
\override RehearsalMark.Y-offset = #10
\override RehearsalMark.X-offset = #10
}
\context {
\Voice
\consists "Horizontal_bracket_engraver"
\override HorizontalBracket.direction = #UP
}
indent = 0
line-width = 4\cm
}
}
}
#}))
\paper {
#(set-paper-size "a4" 'portrait)
top-margin = 1 \cm
bottom-margin = 1 \cm
left-margin = 2 \cm
ragged-bottom = ##t
top-system-spacing =
#'((basic-distance . 15 )
(minimum-distance . 15 )
(padding . 0 )
(stretchability . 0))
system-system-spacing =
#'((basic-distance . 35 )
(minimum-distance . 35 )
(padding . 0 )
(stretchability . 0))
last-bottom-spacing =
#'((basic-distance . 10 )
(minimum-distance . 10 )
(padding . 0 )
(stretchability . 0))
%systems-per-page = 8
%max-systems-per-page = 8
first-page-number = 1
print-first-page-number = ##t
print-page-number = ##t
oddHeaderMarkup = \markup { \fill-line { \line { \on-the-fly #not-first-page {\pad-markup #2 { \concat {\italic {"to kill a monarch "} (seed: 19800725)}}}}}}
evenHeaderMarkup = \markup { \fill-line { \line { \on-the-fly #not-first-page {\pad-markup #2 { \concat {\italic {"to kill a monarch "} (seed: 19800725)}}}}}}
oddFooterMarkup = \markup { \fill-line {
\concat {
"-"
\fontsize #1.5
\on-the-fly #print-page-number-check-first
\fromproperty #'page:page-number-string
"-"}}}
evenFooterMarkup = \markup { \fill-line {
\concat {
"-"
\fontsize #1.5
\on-the-fly #print-page-number-check-first
\fromproperty #'page:page-number-string
"-"}}}
}
\header {
title = \markup { \italic {to kill a monarch}}
composer = \markup \right-column {"michael winter" "(berlin, germany; 2021)"}
poet = "seed: 19800725"
tagline = ""
}
#(set-global-staff-size 11)
\layout {
indent = 0.0\cm
line-width = 17.5\cm
ragged-last = ##f
ragged-right = ##f
\context {
\Score
\override BarNumber.stencil = #(make-stencil-circler 0.1 0.25 ly:text-interface::print)
\override Stem.stemlet-length = #0.75
proportionalNotationDuration = #(ly:make-moment 1/16)
\remove "Separating_line_group_engraver"
\override RehearsalMark.self-alignment-X = #-1
\override RehearsalMark.Y-offset = #10
\override RehearsalMark.X-offset = #-8
%\override RehearsalMark.outside-staff-priority = #0
}
\context {
\Staff
\override VerticalAxisGroup.staff-staff-spacing =
#'((basic-distance . 20 )
(minimum-distance . 20 )
(padding . 0 )
(stretchability . 0))
\override VerticalAxisGroup.default-staff-staff-spacing =
#'((basic-distance . 20 )
(minimum-distance . 20 )
(padding . 0 )
(stretchability . 0))
\override TextScript.staff-padding = #2
\override TextScript.self-alignment-X = #0
}
\context {
\StaffGroup
\name "SemiStaffGroup"
\consists "Span_bar_engraver"
\override SpanBar.stencil =
#(lambda (grob)
(if (string=? (ly:grob-property grob 'glyph-name) "|")
(set! (ly:grob-property grob 'glyph-name) ""))
(ly:span-bar::print grob))
}
\context {
\Score
\accepts SemiStaffGroup
}
}
\midi { }
\score{
\new Score
<<
\include "includes/part_star_8_systemsperpage.ly"
>>
\layout{}
\midi{}
}

View file

@ -99,7 +99,7 @@
\header {
title = \markup { \italic {to kill a monarch}}
composer = \markup \right-column {"michael winter" "(berlin, germany; 2021)"}
composer = \markup \right-column {"michael winter" "(berlin, germany; 2020)"}
poet = "seed: 19800725"
tagline = ""
}
@ -109,7 +109,7 @@
\layout {
indent = 0.0\cm
line-width = 17.5\cm
ragged-last = ##f
ragged-last = ##t
ragged-right = ##f
\context {

View file

@ -99,7 +99,7 @@
\header {
title = \markup { \italic {to kill a monarch}}
composer = \markup \right-column {"michael winter" "(berlin, germany; 2021)"}
composer = \markup \right-column {"michael winter" "(berlin, germany; 2020)"}
poet = "seed: xxx"
tagline = ""
}
@ -109,7 +109,7 @@
\layout {
indent = 0.0\cm
line-width = 17.5\cm
ragged-last = ##f
ragged-last = ##t
ragged-right = ##f
\context {

View file

@ -1,11 +0,0 @@
{
"tempo": 60,
"master_volume": 0.8,
"master_mute": 0,
"master_out": 0,
"track_volumes": [0.8,0.8,0.8,0.8,0.8,0.8,0.8],
"track_solos": [0,0,0,0,0,0,0],
"track_mutes": [1,1,1,1,0,0,0],
"track_pans": [0.5,0.5,0.5,0.5,0.5,0.5,0.5],
"track_outs": [0,0,0,0,0,0,3]
}

View file

@ -1,7 +1,7 @@
(
var clockStringFunc, metronomeStringFunc, metronomeColorFunc, updateTransport, updateSection, updateSubsection,
buildGenerator, buildMetronome, buildTransport, buildTempoControl, buildMasterFader, buildTrackFader,
buildMasterView, buildFaderView, buildHelpView, currentSection = 1, currentSubsection = 1;
var clockStringFunc, metronomeStringFunc, metronomeColorFunc, updateTransport, updateSubsection,
buildGenerator, buildMetronome, updateSection, buildTransport, buildTempoControl, buildMasterFader, buildTrackFader,
masterView, faderView, helpView, currentSection = 1, currentSubsection = 1;
// these funcs update the elements of the transport panel
clockStringFunc = {
@ -27,6 +27,20 @@ updateTransport = {arg clock, metronome, sectionDisplay, measure, beat, section,
{0.75.wait; {metronome.string = ""}.defer}.fork(~tempoClock, quant: 0);
}.inEnvir;
updateSubsection = {arg mod, clock, metronome, sectionDisplay, refresh = true;
if(~sectionNavDict[[currentSection, currentSubsection + mod]] != nil, {
currentSubsection = currentSubsection + mod;
if(refresh, {
updateTransport.value(clock, metronome, sectionDisplay,
~sectionNavDict[[currentSection, currentSubsection]][0], 1,
currentSection, currentSubsection
);
});
}, {
updateSection.value(mod, clock, metronome, sectionDisplay, refresh, true)
})
};
buildGenerator = {arg view;
var ranSeed;
HLayout(
@ -89,20 +103,6 @@ updateSection = {arg mod, clock, metronome, sectionDisplay, refresh = true, indi
});
};
updateSubsection = {arg mod, clock, metronome, sectionDisplay, refresh = true;
if(~sectionNavDict[[currentSection, currentSubsection + mod]] != nil, {
currentSubsection = currentSubsection + mod;
if(refresh, {
updateTransport.value(clock, metronome, sectionDisplay,
~sectionNavDict[[currentSection, currentSubsection]][0], 1,
currentSection, currentSubsection
);
});
}, {
updateSection.value(mod, clock, metronome, sectionDisplay, refresh, true)
})
};
buildTransport = {arg win, view, clock, metronome, preampBusses, accompBusses, postampBusses;
var sec, subsec, sectionDisplay, layout, player;
@ -152,18 +152,18 @@ buildTransport = {arg win, view, clock, metronome, preampBusses, accompBusses, p
[sectionDisplay, layout]
};
buildTempoControl = {arg view;
var layout, tempoField, address, updateSection;
layout = HLayout(
tempoField = TextField(view).string_("60").action_({arg v;
var tempo = v.value.asInteger; ~tempoClock.tempo = tempo / 60}.inEnvir),
Button(view).states_([["set tempo"]]).action_({arg v; ~tempoClock.tempo = tempoField.string.asInteger / 60}.inEnvir),
[StaticText(view).string_(" "), stretch: 1]);
[layout, tempoField]
var tempo, address, updateSection;
HLayout(
tempo = TextField(view).string_("60"),
Button(view).states_([["set tempo"]]).action_({~tempoClock.tempo = tempo.string.asInteger / 60}.inEnvir),
[StaticText(view).string_(" "), stretch: 1])
};
buildMasterFader = {arg view;
var trackIndicators, layout, volSlider, muteButton, outMenu;
var trackIndicators, layout, volSlider, muteButton;
trackIndicators = {LevelIndicator()} ! 2;
@ -181,18 +181,15 @@ buildMasterFader = {arg view;
trackIndicators[1]),
muteButton = Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
{arg v; var masterMute = (1 - v.value).abs; ~play.set(\masterMute, masterMute)}.inEnvir),
StaticText(view).string_("out").align_(\center),
outMenu = PopUpMenu(view).items_((1..16).collect({arg o; o + "-" + (o + 1)})).action_(
{arg v; var out = v.value.postln; ~play.set(\masterOut, out)}.inEnvir),
StaticText(view).string_("master").align_(\center)
), stretch: 2], nil);
[layout, volSlider, muteButton, outMenu]
[layout, volSlider, muteButton]
};
buildTrackFader = {arg view, name, index;
var trackIndicator, netAddr, layout, volSlider, soloButton, muteButton, panKnob, outMenu;
netAddr = NetAddr("127.0.0.1", NetAddr.langPort);
buildTrackFader = {arg view, name, index;
var trackIndicator, layout, volSlider, muteButton, panKnob;
trackIndicator = LevelIndicator();
OSCFunc.new({arg msg; {trackIndicator.value = msg[3].ampdb.linlin(-50, 0, 0, 1)}.defer},
@ -204,35 +201,27 @@ buildTrackFader = {arg view, name, index;
volSlider = Slider(view).value_(0.8).action_(
{arg v; var vol = v.value * 1.25; ~play.set(\vol_ ++ index, vol)}.inEnvir),
trackIndicator),
soloButton = Button(view).states_([["solo", Color.black], ["solo", Color.black, Color.grey]]).action_(
{netAddr.sendMsg("/soloer_" ++ ~hash, index)}.inEnvir).value_(0),
muteButton = Button(view).states_([["mute", Color.black], ["mute", Color.black, Color.grey]]).action_(
{arg v; var mute = (1 - v.value).abs;
~play.set(\mute_ ++ index, mute)}.inEnvir).valueAction_(if(index < 4, {1}, {0})),
{arg v; var mute = (1 - v.value).abs; ~play.set(\mute_ ++ index, mute)}.inEnvir).value_(0),
VLayout(
StaticText(view).string_("pan").align_(\center),
panKnob = Knob(view).action_({arg v; var pan = v.value * 2 - 1; ~play.set(\pan_ ++ index, pan)}.inEnvir).valueAction_(0.5)
panKnob = Knob(view).action_({arg v; var pan = v.value * 2 - 1; ~play.set(\pan_ ++ index, pan)}.inEnvir).value_(0.5)
),
StaticText(view).string_("out").align_(\center),
outMenu = PopUpMenu(view).items_(["master"] ++ (1..16)).action_(
{arg v; var out = v.value; ~play.set(\out_ ++ index, out)}.inEnvir).valueAction_(if(index < 6, {0}, {3})),
StaticText(view).string_(name).align_(\center)
//StaticText(view).string_("output").align_(\center),
),
nil);
[layout, volSlider, soloButton, muteButton, panKnob, outMenu]
[layout, volSlider, muteButton, panKnob]
};
buildMasterView = {arg win, preampBusses, accompBusses, postampBusses;
var view, generatorLayout, clock, metronome, metronomeLayout, transportLayout,
tempoContol, auxControlsLayout, countOff, ranSeed, order, tempo, sectionDisplay, address;
masterView = {arg win, preampBusses, accompBusses, postampBusses;
var view, generatorLayout, clock, metronome, metronomeLayout, transportLayout, auxControlsLayout, countOff, ranSeed, order, tempo, sectionDisplay, address;
view = View(win);
generatorLayout = buildGenerator.value(view);
# clock, metronome, metronomeLayout = buildMetronome.value(win);
# sectionDisplay, transportLayout = buildTransport.value(win, view, clock, metronome, preampBusses, accompBusses, postampBusses);
tempoContol = buildTempoControl.value(view);
auxControlsLayout = tempoContol[0];
auxControlsLayout = buildTempoControl.value(view);
view.layout_(
HLayout(
@ -248,18 +237,16 @@ buildMasterView = {arg win, preampBusses, accompBusses, postampBusses;
alignment: \top
]
)
);
[view, tempoContol[1]]
)
};
buildFaderView = {arg win, tempoField;
var view, masterIndicators, trackIndicators, master, tracks, openButton, basePath, saveButton;
var partAbbr = ["*", "III", "II", "I", "accomp_II", "accomp_I", "click"];
var trackNames = ["*", "III", "II", "I", "accomp_II", "accomp_I", "click"];
faderView = {arg win;
var view, masterIndicators, trackIndicators, master, tracks, openButton, saveButton;
var partAbbr = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var trackNames = ["*", "III", "II", "I", "accomp_I", "accomp_II", "click"];
var partVols, partMutes, partPans;
var masterMute, masterVol;
var netAddr = NetAddr("127.0.0.1", NetAddr.langPort);
var player = ~play;
// set initial mixer values
partVols = [1, 1, 1, 1, 1, 1];
@ -277,72 +264,35 @@ buildFaderView = {arg win, tempoField;
buildTrackFader.value(view, trackNames[part], part);
} ! 7;
OSCFunc.new({arg msg; {
tracks.slice(nil, 3).do({arg mute, m;
if(tracks[msg[1]][2].value == 1, {
mute.valueAction = if(msg[1] == m, {0}, {1});
tracks[m][2].value = if(msg[1] != m, {0}, {1})
}, {
mute.valueAction = 0
});
});
}.defer}, '/soloer_' ++ ~hash, netAddr);
basePath = ~dir +/+ ".." +/+ "mixer_settings";
openButton = Button(view).states_([["open", Color.black]]).action_({
Dialog.openPanel({ arg path;
var settings;
settings = File.readAllString(path).parseJSON;
tempoField.valueAction = settings["tempo"];
master[1].valueAction = settings["master_volume"];
master[2].valueAction = settings["master_pan"];
master[3].valueAction = settings["master_out"];
settings["track_volumes"].do({arg val, v; tracks[v][1].valueAction = val});
settings["track_solos"].do({arg val, v; tracks[v][2].valueAction = val});
settings["track_mutes"].do({arg val, v; tracks[v][3].valueAction = val});
settings["track_pans"].do({arg val, v; tracks[v][4].valueAction = val});
settings["track_outs"].do({arg val, v; tracks[v][5].valueAction = val});
},{}, false, basePath);
path.postln;
},{
"cancelled".postln;
});
});
saveButton = Button(view).states_([["save", Color.black]]).action_({
Dialog.savePanel({ arg path;
var settings, file;
settings = "{\n";
settings = settings ++ "\"tempo\": " ++ tempoField.string ++ ",\n";
settings = settings ++ "\"master_volume\": " ++ master[1].value ++ ",\n";
settings = settings ++ "\"master_mute\": " ++ master[2].value ++ ",\n";
settings = settings ++ "\"master_out\": " ++ master[3].value ++ ",\n";
settings = settings ++ "\"track_volumes\": [" ++ tracks.collect({arg track; track[1].value}).join(",") ++ "],\n";
settings = settings ++ "\"track_solos\": [" ++ tracks.collect({arg track; track[2].value}).join(",") ++ "],\n";
settings = settings ++ "\"track_mutes\": [" ++ tracks.collect({arg track; track[3].value}).join(",") ++ "],\n";
settings = settings ++ "\"track_pans\": [" ++ tracks.collect({arg track; track[4].value}).join(",") ++ "],\n";
settings = settings ++ "\"track_outs\": [" ++ tracks.collect({arg track; track[5].value}).join(",") ++ "]\n";
settings = settings ++ "}";
file = File(path, "w");
file.write(settings);
file.close;
},{}, basePath);
path.postln;
},{
"cancelled".postln;
});
});
view.layout_(HLayout(HLayout(master[0], nil, *tracks.slice(nil, 0)), VLayout(nil, saveButton, openButton)))
view.layout_(HLayout(HLayout(master[0], nil, *tracks.slice(nil, 0)), VLayout(nil, openButton, saveButton)))
};
buildHelpView = {arg win;
helpView = {arg win;
TextView(win).string_(File.readAllString(~dir +/+ "tkam_readme.scd")).editable_(false);
};
~generateGUI = {arg preampBusses, accompBusses, postampBusses;
var win, tabButtonReset, transportButton, mixerButton, helpButton, masterConrol, tempoControl, masterView, faderView, helpView, tabs;
var win, tabButtonReset, transportButton, mixerButton, helpButton, tabs;
win = Window("to kill a monarch", Rect(500, 500, 1100, 575), false).front;
tabButtonReset = {transportButton.value = 1; mixerButton.value = 1; helpButton.value = 1};
masterConrol = buildMasterView.value(win, preampBusses, accompBusses, postampBusses);
masterView = masterConrol[0];
tempoControl = masterConrol[1];
faderView = buildFaderView.value(win, tempoControl);
helpView = buildHelpView.value(win);
win.layout = VLayout(
HLayout(
HLayout(
@ -357,6 +307,6 @@ buildHelpView = {arg win;
helpButton = Button().states_([["help", Color.white, Color.grey], ["help", Color.black]]).action_(
{tabButtonReset.value; helpButton.value = 0; tabs.index = 2 }.inEnvir).value_(1)
),
tabs = StackLayout(masterView, faderView, helpView));
tabs = StackLayout(masterView.value(win, preampBusses, accompBusses, postampBusses), faderView.value(win), helpView.value(win)));
};
)

View file

@ -1,6 +1,5 @@
(
// DATA GENEREATOR - this file IS the piece
var frAdd, frDiff, frToFloat, frNearestInList, frCollapse, harmonicDistance,
var frAdd, frDiff, frToFloat, frNearestInList, frCollapse, harmonicDistance, //helper functions
genMode, hdChoose, wchooseDict, collectRoots,
initModeState, advanceMode,
initTemporalState, genTemporalData,
@ -39,7 +38,7 @@ frNearestInList = {arg frComp, frDict;
frDict.reject({arg item;
(item[\root][0] == frComp[1]) ||
(item[\fr] == frComp[1])
}).keys.asList.sort({arg a, b; harmonicDistance.value(a) < harmonicDistance.value(b)}).do({arg fr;
}).keys.asList.sort({arg a, b; a.asString < b.asString}).do({arg fr;
var diff = abs(frToFloat.value(fr) - frToFloat.value(frComp[0]));
if(diff < diffNearest, {diffNearest = diff; frNearest = fr});
});
@ -59,17 +58,17 @@ harmonicDistance = {arg fr; log2(fr[0].asFloat.product * fr[1].asFloat.product)}
//~~~~~~~~~~~~GENERATE MODE~~~~~~~~~~~~
genMode = {arg forceHS = false;
var mode, alternateProb;
alternateProb = [1, 0].wchoose([if(forceHS, {0}, {1}), 4].normalizeSum);
//TODO: Play with this a bit more (should I go back to the old way)
genMode = {
var mode;
mode = [
[1, 1],
[9, 8],
[[5, 4], [6, 5]].wchoose([3, if(forceHS, {0}, {1})].normalizeSum),
[[4, 3], [11, 8]].wchoose([alternateProb, 1].normalizeSum),
[[5, 4], [6, 5]].wchoose([3, 1].normalizeSum),
[[4, 3], [11, 8]].wchoose([1, 10].normalizeSum),
[3, 2],
[[8, 5], [13, 8]].wchoose([alternateProb, 1].normalizeSum),
[[15, 8], [7, 4]].wchoose([alternateProb, 1].normalizeSum)
[[8, 5], [13, 8]].wchoose([1, 10].normalizeSum),
[[15, 8], [7, 4]].wchoose([1, 10].normalizeSum)
];
mode.collect({arg fr; [[1] ++ fr[0].factors, [1] ++ fr[1].factors]});
};
@ -83,13 +82,10 @@ hdChoose = {arg mode, exp = 1, weights = [1, 1, 1, 1, 1, 1, 1];
mode.wchoose(probs.normalizeSum)
};
wchooseDict = {arg dict, exp = 1, limit = 0, isFR = true;
//faster sorting algorithm?
wchooseDict = {arg dict, exp = 1, limit = 0;
var keyList, probs;
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)});
});
keyList = dict.keys.asList.sort({arg a, b; a.asString < b.asString});
probs = keyList.collect({arg key;
var count = dict[key][\count];
if(count < limit, {0}, {count})
@ -99,7 +95,7 @@ wchooseDict = {arg dict, exp = 1, limit = 0, isFR = true;
};
collectRoots = {arg dict; dict.keys.collect({arg fr;
dict[fr][\root][0]}).asList.sort({arg a, b; harmonicDistance.value(a) < harmonicDistance.value(b)});
dict[fr][\root][0]}).asList.sort({arg a, b; a.asString < b.asString})
};
@ -119,19 +115,19 @@ initModeState = {
curModeState;
};
advanceMode = {arg lastModeState, lastCadenceState, forceHS = false;
var curModeState, curRoots, lastRoots, lastCadenceRoot, changeCount, modSpeed;
advanceMode = {arg lastModeState, lastCadenceState;
var curModeState, curRoots, lastRoots, lastCadenceRoot, changeCount;
curModeState = lastModeState.deepCopy;
curRoots = collectRoots.value(curModeState);
lastRoots = collectRoots.value(lastModeState);
lastCadenceRoot = collectRoots.value(lastCadenceState).asList[0];
changeCount = 0;
modSpeed = if(forceHS, {1}, {[1, 2, 3].wchoose([2, 3, 1].normalizeSum)});
//change either when there is a single root or a few notes have changed in the mode
while({
((curRoots == lastRoots) && (changeCount < modSpeed)) ||
((changeCount < modSpeed) && (curRoots.size > 1))
((curRoots == lastRoots) && (changeCount < 3)) ||
((changeCount < 2) && (curRoots.size > 1))
}, {
var roots, rootSel, mults, multProbs, multSel, new;
@ -169,9 +165,10 @@ advanceMode = {arg lastModeState, lastCadenceState, forceHS = false;
old = frNearestInList.value([new, rootSel], curModeState);
if(curModeState[old][\count] >= 20, {
var mode, root;
mode = genMode.value;
root = [rootSel, curModeState[rootSel][\mode]];
curModeState.add(new ->
Dictionary.with(*[\count->1,\mode->genMode.value(forceHS), \root->root, \mult->multSel, \fr->new]));
Dictionary.with(*[\count->1,\mode->genMode.value, \root->root, \mult->multSel, \fr->new]));
curModeState.removeAt(old);
changeCount = changeCount + 1;
})
@ -188,13 +185,14 @@ initTemporalState = {
tuple->Dictionary.with(*[\count->1])}))
};
//The temporal density could / should also be based on the parts contribution to the mode
genTemporalData = {arg lastTupleState, modeState, cadenceOverride, noParts = 4;
var cadence, curTupleState, timeToNextEvent, tuple, temporalData;
cadence = if(collectRoots.value(modeState).size == 1, {cadenceOverride.not}, {false});
curTupleState = lastTupleState.deepCopy;
timeToNextEvent = (64 + 50.rand + if(cadence, {50}, {0})).round(16);
tuple = wchooseDict.value(curTupleState, isFR: false);
tuple = wchooseDict.value(curTupleState);
if(cadence, {tuple = [1, 1, 1]});
curTupleState = curTupleState.keysValuesDo({arg key, val;
curTupleState[key][\count] = val[\count] + 1});
@ -205,7 +203,7 @@ genTemporalData = {arg lastTupleState, modeState, cadenceOverride, noParts = 4;
var flourishDensity, genDensity, flourish, beforeLen, before, after, buffer;
flourishDensity = if(tuple[p] == 1, {0.125 + 0.5.rand}, {3});
if((p == 0) && cadence.not, {flourishDensity = 3});
genDensity = if(p == 0, {5}, {20});
genDensity = if(p == 0, {3}, {20});
flourish = (if(cadence, {16}, {8}) + 32.rand).collect({[0, 1].wchoose([flourishDensity, 1].normalizeSum)});
buffer = 16.collect({0});
@ -241,9 +239,7 @@ distributeRoots = {arg modeState, lastRoots;
var roots;
roots = modeState.keys.asList.collect({arg fr; modeState[fr][\root]});
roots = roots.asBag.contents.asPairs.reverse.clump(2);
roots = roots = roots.sort({arg a, b;
if(a[0] != b[0], {a[0] > b[0]}, {frToFloat.value(a[1][0]) > frToFloat.value(b[1][0])})}).collect({arg item; item[1]}).wrapExtend(4);
roots = roots.sort({arg a, b; a[0] > b[0]}).collect({arg item; item[1]}).wrapExtend(4);
roots = [roots[0]] ++ roots[..2].scramble;
roots = 4.collect({arg part;
var root, rootMod, rootFreq, mode;
@ -270,6 +266,7 @@ genEnsemblePart = {arg partState, modeState, temporalData, roots, part, offset;
firstChange = false;
cadence = if(collectRoots.value(modeState).size == 1, {true}, {false});
lastInsRef = nil;
if(offset == 0, {cadence = false});
ensData = [];
temporalData.do({arg val, ts;
@ -277,7 +274,7 @@ genEnsemblePart = {arg partState, modeState, temporalData, roots, part, offset;
partState[\lastDur] = partState[\lastDur] + 1;
timeStamp = ts + offset;
change = [val == 1, (val == 1) && firstChange.not].wchoose([1, 2].normalizeSum);
change = [val == 1, (val == 1) && firstChange.not].wchoose([1, 2].normalizeSum);//5 * abs((curPulse / totalLen).clip(0, 1) - 1)].normalizeSum);
if(
(partState[\index] == 0) &&
(frToFloat.value(partState[\lastFreqRatio]) >= 4.0) &&
@ -288,12 +285,20 @@ genEnsemblePart = {arg partState, modeState, temporalData, roots, part, offset;
if(change, {
var mult, multWeights, freq, rootFreq, insRef;
//this weights notes that are richer and mixes with the DCA algorithm
//check that this is working correctly
multWeights = mults.collect({arg fr;
var comp = frCollapse.value(frAdd.value(root, fr));
if(modeState.keys.includes(comp), {3}, {1}) * pow(partState[\multCounts][fr], 1);
});
/*
mult = if( (i == (curPhrase.size - 1)), {
hdChoose.value(mults, 3, multWeights);
}, {
hdChoose.value(mults, 0.5, multWeights);
});
*/
mult = hdChoose.value(mults, 0.5, multWeights);
mults.do({arg fr; partState[\multCounts][fr] = partState[\multCounts][fr] + 1});
partState[\multCounts][mult] = 0;
@ -309,15 +314,11 @@ genEnsemblePart = {arg partState, modeState, temporalData, roots, part, offset;
modeState[fr][\root][0], modeState[fr][\mult]
]
});
mode = mode.sort({arg a, b;
case
{frToFloat.value(a[0]) != frToFloat.value(b[0])} {frToFloat.value(a[0]) < frToFloat.value(b[0])}
{frToFloat.value(a[1]) != frToFloat.value(b[1])} {frToFloat.value(a[1]) < frToFloat.value(b[1])}
{true} {frToFloat.value(a[2]) < frToFloat.value(b[2])};
});
mode = mode.sort({arg a, b; frToFloat.value(a[0]) < frToFloat.value(b[0])});
mode = mode ++ mode.collect({arg fr; [frAdd.value(fr[0], [[2], [1]]), fr[1], fr[2]]});
mode = mode ++ mode.collect({arg fr; [frAdd.value(fr[0], [[4], [1]]), fr[1], fr[2]]});
continue = true;
//check that this is working correctly
while({continue}, {
# freqRatio, root, mult = mode[partState[\noteCount] % 15];
freq = 36.midicps * trans * frToFloat.value(frAdd.value([[1], [1]], freqRatio));
@ -354,7 +355,7 @@ genAccompPart = {arg modeState, temporalData, offset, trans, part, register;
accompData = [];
temporalData.do({arg val, tS;
var change;
change = [val == 1, (val == 1) && firstChange.not].wchoose([1, if(part == 0, {5}, {3})].normalizeSum);
change = [val == 1, (val == 1) && firstChange.not].wchoose([1, if(part == 0, {5}, {3})].normalizeSum); //5 * abs((curPulse / totalLen).clip(0, 0.8) - 1)].normalizeSum);
if(change, {
var sel, freq, amp;
sel = wchooseDict.value(modeState, 0.1);
@ -401,24 +402,24 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
{1} {temporalData2[0].size - firsts2.maxItem}
{2} {(offset2 - temporalData2[0].size) - offset1} ;
min = switch(type)
{0} {0.15}
{0} {0.25}
{1} {0}
{2} {0};
{2} {0} ;
max = switch(type)
{0} {0.5}
{1} {0.65}
{2} {1};
{1} {0.75}
{2} {1} ;
env = Env.dadsr(delay, attack, decay, 0.25, release, curve: \cub).range(min, max);
((delay + attack + decay + release) / 1).asInteger.collect({arg iter; [env.at(iter * 1), offset1 + (iter * 1)]})
};
//~~~~~~~~~~~~GENERATE ALL MUSIC DATA~~~~~~~~~~~~
~genMusicData = {arg seed;
var minTotalDur, minSection1Dur, dUnit, curLen, cadence,
ultimateSubsection, ultimateSection, ultimateCadenceCount,
minTotalLen, minSection1Len,
var totalDur, section1Dur, dUnit, curLen, cadence, ultimate,
totalLen, section1Len,
modeState, temporalState, partStates,
lastCadenceTemporalData, lastCadenceState, lastSectionPoint,
ensData, accompData, bassData, ampData,
@ -426,51 +427,47 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
sectionCount, subsectionCount,
lastRoots, roots, ampDataTmp;
thisThread.randSeed = seed;
thisThread.randSeed = seed.postln;
# minTotalDur, minSection1Dur, dUnit, curLen, cadence = [23 * 60, 8 * 60, 8.reciprocal, 0, false];
# ultimateSubsection, ultimateSection, ultimateCadenceCount = [false, false, 0];
# minTotalLen, minSection1Len = [(minTotalDur / dUnit).round(16), (minSection1Dur / dUnit).round(16)];
# totalDur, section1Dur, dUnit, curLen, cadence, ultimate = [2 * 60, 1 * 60, 8.reciprocal, 0, false, false];
# totalLen, section1Len = [(totalDur / dUnit).round(16), (section1Dur / dUnit).round(16)];
# modeState, temporalState, partStates = [initModeState.value, initTemporalState.value, initPartStates.value];
# lastCadenceTemporalData, lastCadenceState, lastSectionPoint = [nil, modeState.deepCopy, 0];
# ensData, accompData, bassData, ampData = [4.collect({[]}), 4.collect({6.collect({[]})}), 2.collect({[]}), 3.collect({[]})];
# sectionData, sectionNavDict = [Dictionary.new, Dictionary.new];
# sectionCount, subsectionCount = [1, 1];
while({(curLen < minTotalLen) || ((curLen >= minTotalLen) && cadence.not) || ultimateSection.not}, {
while({(curLen < totalLen) || ((curLen >= totalLen) && cadence.not)}, {
var temporalData;
# temporalData, temporalState = genTemporalData.value(temporalState, modeState, curLen <= minSection1Len);
# temporalData, temporalState = genTemporalData.value(temporalState, modeState, curLen <= section1Len);
collectRoots.value(modeState).collect({arg fr; [fr[0].asFloat.product, fr[1].asFloat.product]}).postln;
//modeState.keys.postln;
("-- " ++ sectionCount ++ "." ++ subsectionCount ++ " -----").postln;
"-----------".postln;
lastRoots = if(curLen == 0, {4.collect({[[1], [1]]})}, {roots.slice(nil, 0)});
roots = distributeRoots.value(modeState, lastRoots);
sectionData.add((curLen / 4).asInteger->[roots, lastRoots.collect({arg fr, part;
[fr, 36.midicps * pow(2, [1, 0, 1, 2][part]) * frToFloat.value(fr)]}), sectionCount, subsectionCount, cadence, ultimateSubsection]);
[fr, 36.midicps * pow(2, [1, 0, 1, 2][part]) * frToFloat.value(fr)]}), sectionCount, subsectionCount, cadence, ultimate]);
sectionNavDict.add([sectionCount, subsectionCount]->[(curLen / 16 + 1).asInteger]);
4.do({arg part;
var musicData, partState, accompRoutine;
var musicData, partState, noteCountInd;
# musicData, partState = genEnsemblePart.value(partStates[part], modeState, temporalData[part], roots, part, curLen);
ensData[part] = ensData[part] ++ musicData;
partStates[part] = partState;
//use an independent random number generator for the accompaniment
accompRoutine = Routine({
thisThread.randSeed = Date.seed;
6.do({arg register;
musicData = genAccompPart.value(modeState, temporalData[part], curLen, pow(2, part + register), part, register);
accompData[part][register] = accompData[part][register] ++ musicData;
});
thisThread.randSeed = Date.seed;
6.do({arg register;
musicData = genAccompPart.value(modeState, temporalData[part], curLen, pow(2, part + register), part, register);
accompData[part][register] = accompData[part][register] ++ musicData;
});
accompRoutine.value;
});
subsectionCount = subsectionCount + 1;
thisThread.randSeed = (seed + (sectionCount * 200) + subsectionCount);
if(curLen == 0, {
lastCadenceTemporalData = temporalData;
@ -479,7 +476,7 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
curLen = curLen + temporalData[0].size;
if(curLen > minSection1Len, {
if(curLen > section1Len, {
if(collectRoots.value(modeState).size == 1, {
ampData[0] = ampData[0] ++ genAmpCurve.value(lastCadenceTemporalData, temporalData, lastSectionPoint, curLen, 0);
@ -504,18 +501,14 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
# sectionCount, subsectionCount = [sectionCount + 1, 1];
# lastCadenceTemporalData, lastCadenceState, lastSectionPoint = [temporalData, modeState, curLen];
cadence = true;
//this should ensure that the final cadence is a HS
if(curLen >= minTotalLen, {ultimateCadenceCount = ultimateCadenceCount + 1});
ultimateSection = ultimateCadenceCount > 1;
}, {
cadence = false
});
modeState = advanceMode.value(modeState, lastCadenceState, curLen >= minTotalLen);
modeState = advanceMode.value(modeState, lastCadenceState);
});
});
ampDataTmp = genAmpCurve.value(lastCadenceTemporalData, [[1], [1], [1], [1]], lastSectionPoint, lastSectionPoint + 360, 2);
ampDataTmp = genAmpCurve.value(lastCadenceTemporalData, [[1], [1], [1], [1]], lastSectionPoint, lastSectionPoint + 80, 2);
ampData[2] = ampData[2] ++ ampDataTmp;
bassData[1] = bassData[1] ++ genBassPart.value(collectRoots.value(lastCadenceState).asList[0], ampDataTmp, false);

View file

@ -8,11 +8,13 @@ The play button will always start from the beginning of the current section.
The transport buttons allow you to advance by subsection (<,>) and section (<<,>>).
Tempo change will only go into effect once the enter key or "set tempo" button is pressed.
Tempo change will only go into effect once "set tempo" button is pressed.
The default seed given in the application will generate the first version of the 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.
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.
~~~~mixer tab
This allow invidual control of each of the sonic elements. The three parts that can be played on acoustic instruments are automatically muted. The outputs will go out to whatever sound card is being used by the system.
This allow invidual control of each of the sonic elements. The synthesized guitar part is automatically muted is at should only be used for audition and practice. The low accompaniment has two separate tracks in case a performer cannot play both the notes. The sonification will go to outputs 1 and 2 while the click will go to outputs 3 and 4.
*/

View file

@ -15,56 +15,58 @@ var formatPatternData;
var sdPlayer, sdTransport, sdClick, sdAmpCurve, sdEns, sdAccomp, sdClip, sdBass, sdDiskOut, allSds;
sdPlayer = SynthDef(\masterPlayerControl_ ++ ~hash, {
var router, sigs, sigsPanned, masterSig, imp;
var sigs, sigsPanned, masterSig, imp;
sigs = postampBusses.collect({arg bus, i; In.ar(bus) * NamedControl.kr(\vol_ ++ i, 1, 0.1) * NamedControl.kr(\mute_ ++ i, 1, 0.1)});
router = sigs.collect({arg sig, i; NamedControl.kr(\out_ ++ i, 0, 0)});
sigs.collect({arg sig, i; Out.ar(router[i] - 1, sig * router[i].sign)});
sigs = postampBusses.collect({arg bus, i; In.ar(bus) * NamedControl.kr(\vol_ ++ i, 1, 0.1)});
sigsPanned = sigs.collect({arg sig, i; Pan2.ar(sig * NamedControl.kr(\mute_ ++ i, 1, 0.1), NamedControl.kr(\pan_ ++ i, 0, 0.1))});
masterSig = Mix.ar(sigsPanned.drop(-1)) * NamedControl.kr(\masterVol, 1, 0.1) * NamedControl.kr(\masterMute, 1, 0.1);
sigsPanned = sigs.collect({arg sig, i; Pan2.ar(sig, NamedControl.kr(\pan_ ++ i, 0, 0.1))});
masterSig = Mix.ar(sigsPanned.collect({arg sig, i; sig * abs(router[i].sign - 1)}));
masterSig = masterSig * NamedControl.kr(\masterVol, 1, 0.1) * NamedControl.kr(\masterMute, 1, 0.1);
Out.ar(NamedControl.kr(\masterOut, 0, 0), masterSig);
Out.ar(0, masterSig);
Out.ar(2, sigsPanned.last); //change this if you want the click to go somewhere else
imp = Impulse.kr(10);
SendReply.kr(imp, '/masterLevels_' ++ ~hash, values: [Amplitude.kr(masterSig)]);
sigs.collect({arg sig, i; SendReply.kr(imp, '/trackLevel_' ++ i ++ "_" ++ ~hash, values: [Amplitude.kr(sig)])});
});
}).add;
sdTransport = SynthDef(\transport_ ++ ~hash, {arg measure = 0, beat = 0, section = 0, subsection = 0, gate = 1, dur = 1;
SendReply.kr(Impulse.kr(0) * (measure > 0) * (beat > 0),'/measureClock_' ++ ~hash, values: [measure, beat, section, subsection]);
//SendReply.kr(Impulse.kr(0),'/nextSubsection_' ++ ~hash);
EnvGen.kr(Env.sine(dur), gate, doneAction: 2);
});
}).add;
sdClick = SynthDef(\click_ ++ ~hash, {arg beat = 0, gate = 1, dur = 1;
Out.ar(postampBusses[6], 10 * BPF.ar(WhiteNoise.ar * EnvGen.kr(Env.perc(0.01, 0.1), gate), 440 * ((beat <= 1) + 1), 0.02));
EnvGen.kr(Env.sine(dur), gate, doneAction: 2);
});
}).add;
sdAmpCurve = SynthDef(\amp_curve_ ++ ~hash, {arg amp = 1, dur = 0.1, bus = 0;
Out.kr(bus, amp.lag)
});
sdAmpCurve = SynthDef(\amp_curve_ ++ ~hash, {arg amp = 0, dur = 0.1, gate = 1, bus = 0;
Out.kr(bus, amp)
}).add;
sdEns = SynthDef(\ens_ ++ ~hash, {arg freq = 440, amp = 1, dur = 1, gate = 1, bus = 0, ampBus = 0, rel = 0.1;
Out.ar(bus, SinOsc.ar(freq, 2pi.rand, 0.1) * amp * Latch.kr(In.kr(ampBus), Impulse.kr(0)) * EnvGen.kr(Env.asr(0.1, 1, rel), gate, doneAction: 2))
});
sdEns = SynthDef(\ens_ ++ ~hash, {arg freq = 440, amp = 1, dur = 1, gate = 1, bus = 0, ampBus = 0;
Out.ar(bus, SinOsc.ar(freq, 2pi.rand, 0.1) * Latch.kr(In.kr(ampBus), Impulse.kr(0)) * EnvGen.kr(Env.asr(0.1, 1, 0.1), gate, doneAction: 2))
}).add;
sdAccomp = SynthDef(\accomp_ ++ ~hash, {arg freq = 440, amp = 1, sustain = 1, dur = 1, gate = 1, bout = 0, ampBus = 0, rel = 0.01;
Out.ar(bout, SinOsc.ar(freq, 2pi.rand, 1) * 0.01 * amp * Latch.kr(In.kr(ampBus), Impulse.kr(0)) * EnvGen.kr(Env.asr(sustain, 1, rel), gate, doneAction: 2))
});
sdAccomp = SynthDef(\accomp_ ++ ~hash, {arg freq = 440, amp = 1, attack = 1, dur = 1, gate = 1, bout = 0, ampBus = 0;
Out.ar(bout, SinOsc.ar(freq, 2pi.rand, 1) * 0.01 * amp * Latch.kr(In.kr(ampBus), Impulse.kr(0)) * EnvGen.kr(Env.asr(attack, 1, 0.01), gate, doneAction: 2))
}).add;
sdClip = SynthDef(\clip_ ++ ~hash, {arg dur = 1, gate = 1, bin = 0, bus = 0;
Out.ar(bus, (In.ar(bin)).clip(0, 1) * 50)
});
//Out.ar([0, 1], (In.ar(bin)).clip(0, 1) * pow(Line.kr(0, 1, 240), 2))
Out.ar(bus, (In.ar(bin)).clip(0, 1) * 50 * pow(Line.kr(0, 1, 10), 2))
}).add;
sdBass = SynthDef(\bass_mono_ ++ ~hash, {arg freq = 440, ampBus = 0, bus = 0;
Out.ar(bus, (SinOsc.ar(freq) * 0.5 * In.kr(ampBus)))
});
Poll.kr(Changed.kr(In.kr(ampBus)), In.kr(ampBus));
Out.ar(bus, (SinOsc.ar(freq) * 0.4 * In.kr(ampBus)))
}).add;
sdDiskOut = SynthDef(\disk_out_ ++ ~hash, {arg bufnum, inbus;
DiskOut.ar(bufnum, In.ar(inbus));
});
}).add;
allSds = [sdPlayer, sdTransport, sdClick, sdAmpCurve, sdEns, sdAccomp, sdClip, sdBass, sdDiskOut];
allSds.do({arg sd; sd.add});
@ -73,14 +75,12 @@ var formatPatternData;
// group data by measures for navigation
formatPatternData = {arg musData, measureLen, rel, print = false;
formatPatternData = {arg musData, measureLen;
var dataLen;
dataLen = musData[0][0].size + 1;
dataLen = musData[0][0].size;
musData.collect({arg partData;
var res;
res = partData;
res = res.collect({arg mData, index; mData.add(if(index != (res.size - 1), {rel}, {5.rand + 5}))});
res = res.flop;
res = partData.flop;
res = res.add(res[1]);
res[1] = (res[1].differentiate.drop(1) ++ [10]);
res = res.flop ++ measureLen.collect({arg measure; dataLen.collect({0}) ++ [measure * 16]});
@ -104,8 +104,8 @@ formatPatternData = {arg musData, measureLen, rel, print = false;
accompData.flatten.collect({arg partData; partData.last[1]})
).maxItem.ceil(16) / 16).asInteger + 1;
ensDataFormatted = formatPatternData.value(ensData, measureLen, 0.1, true);
accompDataFormatted = formatPatternData.value(accompData.flatten, measureLen, 0.01);
ensDataFormatted = formatPatternData.value(ensData, measureLen);
accompDataFormatted = formatPatternData.value(accompData.flatten, measureLen);
dUnit = 8.reciprocal;
patterns = measureLen.collect({arg measure;
@ -115,29 +115,30 @@ formatPatternData = {arg musData, measureLen, rel, print = false;
});
Ppar(
//check how amplitude is being handled
ensDataFormatted[measure].collect({arg musData, p;
ensDataFormatted[measure].collect({arg musData, m;
Pbind(
\instrument, \ens_ ++ ~hash,
\freq, Pseq(musData[0].replace(0, Rest(0))),
\dur, Pseq(musData[1] * dUnit),
\sustain, Pseq(musData[2] * dUnit),
\amp, [1, 0.7, 0.5, 0.3][p],
\amp, [0.5, 0.3, 0.3, 0.3][m],
//\amp, Pseq(musData[2].collect({arg item; [0, 0.25, 0.5, 0.75][item]}) * [1, 0.5, 0.25, 0.1][m] * 16);
\ampBus, preampBusses[0].index,
\bus, postampBusses[p].index,
\rel, Pseq(musData[6])
\bus, postampBusses[m].index
)
}) ++
//check how amplitude and attack are being handled
accompDataFormatted[measure].collect({arg musData;
accompDataFormatted[measure].collect({arg musData, m;
Pbind(
\instrument, \accomp_ ++ ~hash,
\freq, Pseq(musData[0].replace(0, Rest(0))),
\dur, Pseq(musData[1] * dUnit),
\sustain, Pseq(musData[2] * dUnit),
\amp, Pseq(musData[3].collect({arg item; [0, 2, 4, 8][item]}) * 0.0125 * 1),
//\attack, Pseq(musData[1] * abs(musData[3].clip(0, 0.25) * 2 - 1) * dUnit),
\attack, Pseq(musData[2] * 1 * dUnit),
\ampBus, preampBusses[0].index,
\bout, Pseq(musData[4].collect({arg index; accompBusses[index].index})),
\rel, Pseq(musData[5])
\bout, Pseq(musData[4].collect({arg index; accompBusses[index].index}))
)
}) ++
[
@ -192,7 +193,7 @@ formatPatternData = {arg musData, measureLen, rel, print = false;
preampBusses, nextNode, accompBusses, postampBusses,
synths, prePatterns, playablePatterns, score;
trackNames = ["part_star", "part_III", "part_II", "part_I", "accomp_II", "accomp_I", "click"];
trackNames = ["part_start", "part_III", "part_II", "part_I", "accomp_I", "accomp_II", "click"];
basePath = ~dir +/+ ".." +/+ "audio" +/+ "seed_" ++ seed;
basePath.mkdir;
@ -212,7 +213,7 @@ formatPatternData = {arg musData, measureLen, rel, print = false;
playablePatterns = ~genPlayablePatterns.value(0, prePatterns, preampBusses, accompBusses, postampBusses);
recDur = (prePatterns[2][0].size / 8) + 45;
recDur = (prePatterns[2][0].size / 8) + 10;
score = playablePatterns.asScore(duration: recDur, timeOffset: 0.001);
nextNode = score.score.slice(nil, 1).select({arg msg; msg[0] == 9}).slice(nil, 2).maxItem + 1;

View file

@ -22,9 +22,9 @@ formatMusicData = {arg rawMusicData;
res
});
//make them all the same length
maxSize = maxSize.trunc(64) + 64;
musicData = musicData.collect({arg partData, p; partData.extend(maxSize, partData.last)});
// make them all the same length
maxSize = maxSize.trunc(16) + 16;
musicData = musicData.collect({arg partData, p; partData.extend(maxSize, [-1, -1, -1, partData.last[1]])});
musicData
};
@ -56,7 +56,7 @@ lyStaffDef = {arg name, nameShort, nameMidi;
"\\new Staff = \"" ++ name ++ "\" \\with { \n" ++
"instrumentName = \"" ++ name ++ "\" \n" ++
"shortInstrumentName = \"" ++ nameShort ++ "\" \n" ++
"midiInstrument = #\"" ++ nameMidi ++ "\" \n" ++
"midiInstrument = #\"" ++ nameMidi ++ "\"\n" ++
"\n}\n"
};
@ -68,7 +68,7 @@ lyFinalizeMusic = {arg lyStr, part, name, nameShort, nameMidi, clef;
"\n\\set Score.markFormatter = #format-mark-box-numbers " +
"\\tempo 2 = 60\n" +
"\\numericTimeSignature \\time 2/2\n" +
"\\clef " ++ clef ++ "\n" ++ lyStr + "\\fermata" +
"\\clef " ++ clef ++ "\n" ++ lyStr ++
" }>> \\bar \"|.\" \n} \n\n>>" ++
"\n>>"
};
@ -113,7 +113,7 @@ lyRelMark = {arg root, lastRoot, section, subsection;
lyRelMarkNote.value(root, lastRoot, 1, "bass") ++ "^\\markup{\\large \\raise #2 \"III\"}" ++
lyHBracket.value(lyFreqRatio.value(root[1][4][2], nil, true, 0, false), 8.5, 1, 2, 1, 1) ++
lyHBracket.value(lyFreqRatio.value(root[2][4][2], nil, true, 0, false), 8.5, 1, 2, 1, 1) ++
lyHBracket.value(lyFreqRatio.value(root[2][4][1], nil, true, 0, false), 5.5, 3, 3, 0, 0) ++
"\\hide c16 \n " ++
@ -121,7 +121,7 @@ lyRelMark = {arg root, lastRoot, section, subsection;
lyRelMarkNote.value(root, lastRoot, 2, "alto") ++ "^\\markup{\\large \\raise #2 \"II\"}" +
"\\stopGroup \\hide c'16 \n " ++
lyHBracket.value(lyFreqRatio.value(root[2][4][2], nil, true, 0, false), 5.5, 1, 3, 0, 0) ++
lyHBracket.value(lyFreqRatio.value(root[1][4][2], nil, true, 0, false), 5.5, 1, 3, 0, 0) ++
lyRelMarkNote.value(root, lastRoot, 3, "treble") ++ "^\\markup{\\large \\raise #2 \"I\"}" +
"\\stopGroup \\stopGroup \n " ++

Binary file not shown.