-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplay.js
49 lines (45 loc) · 2.83 KB
/
play.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Clean minimal code style with focus on direct & clear naming & structure, instead of distracting comments, excessive line breaks & empty lines. Global scope used where possible for cleaner simplicity. https://github.com/PolychronMidi/Polychron
require('./stage');
setTuningAndInstruments();
totalSections=ri(SECTIONS.min,SECTIONS.max);
for (sectionIndex=0; sectionIndex < totalSections; sectionIndex++) {
composer=ra(composers);
phrasesPerSection=ri(PHRASES_PER_SECTION.min,PHRASES_PER_SECTION.max);
for (phraseIndex=0; phraseIndex < phrasesPerSection; phraseIndex++) {
[numerator,denominator]=composer.getMeter();
getMidiMeter(); getPolyrhythm(); logUnit('phrase');
measuresPerPhrase=measuresPerPhrase1;
for (measureIndex=0; measureIndex < measuresPerPhrase; measureIndex++) { measureCount++;
setMeasureTiming(); logUnit('measure'); beatRhythm=setRhythm('beat');
for (beatIndex=0; beatIndex < numerator; beatIndex++) {trackBeatRhythm();beatCount++;
setBeatTiming(); logUnit('beat'); divRhythm=setRhythm('div');
setOtherInstruments(); setBinaural(); setBalanceAndFX(); playDrums();
stutterFX(flipBinaural ? flipBinauralT3 : flipBinauralF3);
stutterFade(flipBinaural ? flipBinauralT3 : flipBinauralF3);
rf()<.05 ? stutterPan(flipBinaural ? flipBinauralT3 : flipBinauralF3) : stutterPan(stutterPanCHs);
for (divIndex=0; divIndex < divsPerBeat; divIndex++) { trackDivRhythm();
setDivTiming(); logUnit('division'); subdivRhythm=setRhythm('subdiv');
for (subdivIndex=0; subdivIndex < subdivsPerDiv; subdivIndex++) {
setSubdivTiming(); logUnit('subdivision'); playNotes(); }
for (subsubdivIndex=0; subsubdivIndex < subdivsPerSub; subsubdivIndex++) {
setSubsubdivTiming(); logUnit('subsubdivision'); playNotes2(); }
}}}
beatRhythm=divRhythm=subdivRhythm=0;
numerator=polyNumerator; meterRatio=polyMeterRatio;
measuresPerPhrase=measuresPerPhrase2;
for (measureIndex=0; measureIndex < measuresPerPhrase; measureIndex++) {
setMeasureTiming(); logUnit('measure'); beatRhythm=setRhythm('beat');
for (beatIndex=0; beatIndex < numerator; beatIndex++) { trackBeatRhythm();
setBeatTiming(); logUnit('beat'); divRhythm=setRhythm('div'); playDrums2();
for (divIndex=0; divIndex < divsPerBeat; divIndex++) { trackDivRhythm();
setDivTiming(); logUnit('division'); subdivRhythm=setRhythm('subdiv');
for (subdivIndex=0; subdivIndex < subdivsPerDiv; subdivIndex++) {
setSubdivTiming(); logUnit('subdivision'); playNotes(); }
for (subsubdivIndex=0; subsubdivIndex < subdivsPerSub; subsubdivIndex++) {
setSubsubdivTiming(); logUnit('subsubdivision'); playNotes2(); }
}}}
nextPhrase();
}
logUnit('section'); nextSection();
}
grandFinale();