Skip to content

Commit

Permalink
fix loops and transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jroitgrund committed Aug 4, 2021
1 parent 87b0e4e commit 91450e3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
24 changes: 12 additions & 12 deletions biosphere.scd
Expand Up @@ -82,9 +82,9 @@ var nappeBaleineAmpOutBus = Bus.control(s, 1);
\loop, 1,
\panBus, birds2PanBus,
\ampBus, birds2AmpBus,
\loopAtk, 4,
\loopSus, 40,
\loopRel, 4
\loopAtk, 4 / TempoClock.default.tempo,
\loopSus, 40 / TempoClock.default.tempo,
\loopRel, 4 / TempoClock.default.tempo
),
Pbind(
\dur, Pseq([48], repeats: inf),
Expand Down Expand Up @@ -114,9 +114,9 @@ var nappeBaleineAmpOutBus = Bus.control(s, 1);
\loop, 1,
\panBus, birds1PanBus,
\ampBus, birds1AmpBus,
\loopAtk, 4,
\loopSus, 24,
\loopRel, 4
\loopAtk, 4 / TempoClock.default.tempo,
\loopSus, 24 / TempoClock.default.tempo,
\loopRel, 4 / TempoClock.default.tempo
),
Pbind(
\dur, Pseq([32], repeats: inf),
Expand Down Expand Up @@ -387,8 +387,8 @@ var nappeBaleineAmpOutBus = Bus.control(s, 1);
\loop, 1,
\panBus, waterPanBus,
\ampBus, waterAmpBus,
\loopAtk, 16,
\loopRel, 16,
\loopAtk, 16 / TempoClock.default.tempo,
\loopRel, 16 / TempoClock.default.tempo,
\loopSus, 0
),
Pbind(
Expand All @@ -404,8 +404,8 @@ var nappeBaleineAmpOutBus = Bus.control(s, 1);
\dur, Pseq([duration]),
\legato, 1,
\instrument, \ampControl,
\atk, 16 / TempoClock.default.tempo,
\sus, (duration - 32) / TempoClock.default.tempo,
\atk, 8 / TempoClock.default.tempo,
\sus, (duration - 24) / TempoClock.default.tempo,
\rel, 16 / TempoClock.default.tempo,
\controlBus, waterAmpBus
),
Expand All @@ -418,7 +418,7 @@ var nappeBaleineAmpOutBus = Bus.control(s, 1);
var gouttesIn = (2 * firstPhaseDuration / 6).round(4);
var owlsIn = (3 * firstPhaseDuration / 6).round(4);
Ppar([
Pseq([Event.silent(0), ~nappeBaleine.value(firstPhaseDuration + 8)]),
Pseq([Event.silent(0), ~nappeBaleine.value(firstPhaseDuration + 16)]),
Pseq([Event.silent(sireneIn), ~sirens.value(firstPhaseDuration - sireneIn)]),
Pseq([Event.silent(gouttesIn), ~gouttes.value(firstPhaseDuration + secondPhaseDuration + 16 - gouttesIn)]),
Pseq([Event.silent(owlsIn), ~owls.value(firstPhaseDuration + secondPhaseDuration + 32 - owlsIn)])
Expand All @@ -428,7 +428,7 @@ var nappeBaleineAmpOutBus = Bus.control(s, 1);
~biospherePart2 = {
| secondPhaseDuration |
Ppar([
Pseq([Event.silent(0), ~melodie.value(secondPhaseDuration + 8)]),
Pseq([Event.silent(0), ~melodie.value(secondPhaseDuration + 16)]),
]);
};

Expand Down
7 changes: 4 additions & 3 deletions common.scd
Expand Up @@ -3,7 +3,7 @@ var loadedBuffers;
var makeSynthDef = {
|name, numChannels|
SynthDef.new(name, {
| out, buf, amp = 1.0, ampBus = -1, pitchRatio = 0, window = 0.2, hpf = 0, rate = 1, hardPan = -1, panBus = -1, atk = -1, sus = -1, rel = 1000000, lpfBus = -1, lpf = 20000, revTime = 0, delayTime = 0, delayRepeat = 40, lfoSpeed = 0, loop = 0, loopAtk = -1, loopSus = -1, loopRel = -1, gate = 1, gateRelease = 0, lpfRq = 1, loopEnvOutBus = nil, envOutBus = nil, ampOutBus = nil, amp0OutBus = nil, amp1OutBus = nil, amp2OutBus = nil, amp3OutBus = nil |
| out, buf, amp = 1.0, ampBus = -1, ampBus2 = -1, pitchRatio = 0, window = 0.2, hpf = 0, rate = 1, hardPan = -1, panBus = -1, atk = -1, sus = -1, rel = 1000000, lpfBus = -1, lpf = 20000, revTime = 0, delayTime = 0, delayRepeat = 40, lfoSpeed = 0, loop = 0, loopAtk = -1, loopSus = -1, loopRel = -1, gate = 1, gateRelease = 0, lpfRq = 1, loopEnvOutBus = nil, envOutBus = nil, ampOutBus = nil, amp0OutBus = nil, amp1OutBus = nil, amp2OutBus = nil, amp3OutBus = nil |
var envelope, sound, ampBusEnvelope, loopEnvelope, pan, left, right, middle, linen, delay;

// Used to release synths when a pattern event ends and triggers a note off event, setting gate to zero.
Expand Down Expand Up @@ -46,9 +46,10 @@ var makeSynthDef = {

// Get envelope from control amp if set.
ampBusEnvelope = Select.kr(ampBus >= 0, [1, In.kr(ampBus)]);

ampBusEnvelope2 = Select.kr(ampBus2 >= 0, [1, In.kr(ampBus2)]);
`
// Apply envelopes.
sound = sound * envelope * ampBusEnvelope * loopEnvelope * amp * linen * ~volume;
sound = sound * envelope * ampBusEnvelope * ampBusEnvelope2 * loopEnvelope * amp * linen * ~volume;

// Split into two channels.
left = sound[0];
Expand Down
18 changes: 10 additions & 8 deletions main.scd
Expand Up @@ -40,6 +40,8 @@ TempoClock.default.tempo = 90/60;
"./osc.scd".load;
"./biosphere.scd".load;
"./ritual.scd".load;

~ritualPart1.value(64).play;
)

// Runs everything! Adjust durations and comment stuff out to run individual parts.
Expand All @@ -54,9 +56,9 @@ TempoClock.default.tempo = 90/60;
"./ritual.scd".load;

getFullLoop = {
var biosphereFirstPhaseDuration = 64;
var biosphereSecondPhaseDuration = 64;
var biosphereThirdPhaseDuration = 64;
var biosphereFirstPhaseDuration = 128;
var biosphereSecondPhaseDuration = 128;
var biosphereThirdPhaseDuration = 128;
var biosphereTotalDuration = (
biosphereFirstPhaseDuration
+ biosphereSecondPhaseDuration
Expand All @@ -65,11 +67,11 @@ getFullLoop = {

var pause = 8;

var ritualFirstPhaseDuration = 64;
var ritualSecondPhaseDuration = 64;
var ritualThirdPhaseDuration = 64;
var ritualFourthPhaseDuration = 64;
var ritualFifthPhaseDuration = 64;
var ritualFirstPhaseDuration = 128;
var ritualSecondPhaseDuration = 128;
var ritualThirdPhaseDuration = 128;
var ritualFourthPhaseDuration = 128;
var ritualFifthPhaseDuration = 128;

var totalDuration = (
biosphereFirstPhaseDuration
Expand Down
5 changes: 3 additions & 2 deletions ritual.scd
Expand Up @@ -434,6 +434,7 @@ var murmuresLoopsAmpOutBus = Bus.control(s, 1);
\buf, ~bassVoiceShamanBuffer,
\panBus, bassVoiceShaman2PanBus,
\ampBus, bassVoiceShaman2AmpBus,
\ampBus2, bassVoiceShamanAmpBus,
\rate, 7.midiratio,
\amp, 0.05,
\loop, 1
Expand Down Expand Up @@ -498,7 +499,7 @@ var murmuresLoopsAmpOutBus = Bus.control(s, 1);
\legato, 1,
\instrument, Pif(Ptime() < duration, \play),
\buf, ~bassBuffer,
\amp, 0.5,
\amp, 0.3,
\pfunc, Pif(launchBassOndeRouge, Pfuncn(~launchBassOndeRouge, inf), 1)
),
]);
Expand Down Expand Up @@ -741,7 +742,7 @@ var murmuresLoopsAmpOutBus = Bus.control(s, 1);
~singleActionPattern.value(~launchFondRougeRitualPart2Clip)
])
]),
Pseq([Event.silent(bassVoiceShamanIn), ~bassVoiceShaman.value(secondPhaseDuration + 6 - bassVoiceShamanIn, totem: true)]),
Pseq([Event.silent(bassVoiceShamanIn), ~bassVoiceShaman.value(secondPhaseDuration + 4 - bassVoiceShamanIn, totem: true)]),
]);
};

Expand Down

0 comments on commit 91450e3

Please sign in to comment.