Skip to content

Commit

Permalink
renaming, latest deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ngwese committed Oct 12, 2021
1 parent 81b89b3 commit 9823fb6
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 161 deletions.
2 changes: 1 addition & 1 deletion dep/soundplaneclient
Submodule soundplaneclient updated 1 files
+1 −1 dep/soundplanelib
30 changes: 15 additions & 15 deletions mod/lib/Haze.sc → mod/lib/Assemblage.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Haze {
Assemblage {
var <server;

var <parentGroup;
Expand All @@ -19,7 +19,7 @@ Haze {
var <voices;
var <voiceStarted;

// Create and initialize a new Haze instance on the given server
// Create and initialize a new Assemblage instance on the given server
*new { arg server, group, out=0, voiceCount=8;
^super.new.init(server, group, out, voiceCount);
}
Expand All @@ -38,12 +38,12 @@ Haze {

voices = Array.new;

Post << "Haze.init: server = " << server << ", xg = " << parentGroup << ", out = " << outBus << "\n";
Post << "Assemblage.init: server = " << server << ", xg = " << parentGroup << ", out = " << outBus << "\n";

fork {
Post << "Haze.init: sending defs...\n";
Post << "Assemblage.init: sending defs...\n";

HazeDefs.definitions.do({ arg d;
AssemblageDefs.definitions.do({ arg d;
postln(" +" + d.name);
d.send(server);
});
Expand All @@ -53,7 +53,7 @@ Haze {
serverInitialized.test = true;
serverInitialized.signal;

Post << "Haze.init: server synced\n";
Post << "Assemblage.init: server synced\n";
};

// Control busses for global parameters which drive all voices (non per-note parameters)
Expand All @@ -72,13 +72,13 @@ Haze {
// wait for defs and default buffers to land
serverInitialized.wait;

Post << "Haze.init: setting default configuration...\n";
voiceType = \haze_three;
Post << "Assemblage.init: setting default configuration...\n";
voiceType = \assemblage_haze;

Post << "Haze.init: allocating voices...\n";
Post << "Assemblage.init: allocating voices...\n";
this.allocVoices(argVoiceCount);

Post << "Haze.init: done\n";
Post << "Assemblage.init: done\n";
};
}

Expand Down Expand Up @@ -108,7 +108,7 @@ Haze {
voices.do({arg v; v.free });
});

voices = n.collectAs({ HazeVoice.new(
voices = n.collectAs({ AssemblageVoice.new(
this.server,
this.voicesGroup,
voiceType: this.voiceType,
Expand Down Expand Up @@ -136,7 +136,7 @@ Haze {

}

HazeVoice {
AssemblageVoice {
var <voiceSynth;
var <voiceType;
var <voiceGroup;
Expand All @@ -160,7 +160,7 @@ HazeVoice {
init {
arg server, target, voiceType, out;

Post << "HazeVoice.init(" << server << ", " << target << ", " << out << ", "
Post << "AssemblageVoice.init(" << server << ", " << target << ", " << out << ", "
<< voiceType << ")\n";

// create a group to contain the synths for the voice
Expand All @@ -185,7 +185,7 @@ HazeVoice {
this.voiceType = voiceType;

// scale voice ouput by amp env (after filter) and write to main bus
shapeType = \haze_place; // TODO: fixed for now
shapeType = \assemblage_place; // TODO: fixed for now
shapeSynth = Synth.new(shapeType, [\out, out, \in, voiceBus], shapeGroup);
shapeSynth.map(\amp, shapeAmpBus);
shapeAmpBus.set(1);
Expand Down Expand Up @@ -253,7 +253,7 @@ HazeVoice {
/*
~processGroup = Crone.context.xg;
~f = Haze.new(s, ~processGroup, voiceCount: 2);
~f = Assemblage.new(s, ~processGroup, voiceCount: 2);
~f.voiceCount;
~f.free
Expand Down
84 changes: 84 additions & 0 deletions mod/lib/AssemblageDefs.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
AssemblageDefs {
classvar <voices;
classvar <shapers;

*initClass {

//
// Voices
//

voices = List.new;

voices.add(
SynthDef(\assemblage_sine, {
arg out=0, hz=300, amp=0.5, mod=0.5;
var sig = SinOsc.ar(hz, mul: 0.3);
Out.ar(out, sig * OnePole.kr(amp, 0.1));
})
);

voices.add(
SynthDef(\assemblage_haze, {
arg out=0, hz=300, amp=0.5, mod=0.5;
var sig, tone, toneA, toneB, ampFinal, noiseAmpMap, noiseAmp, noise, noiseFreqs, noiseRingTimes;

toneA = SinOsc.ar(hz, mul: 0.3);
toneB = PMOsc.ar(hz * 0.5, hz * (1.5 + PinkNoise.kr(0.007)), 3 * OnePole.kr(PinkNoise.kr(2), 0.8), mul: 0.05);
tone = XFade2.ar(toneA, toneB, Clip.kr((mod * 2) - 1.5, -1, 1));

amp = Clip.kr(amp);

//noiseAmpMap = Env.new(levels: [0, 0, 0.6, 1], times: [0.1, 0.4, 0.5], curve: [\lin, \cub, \wel]);
noiseAmpMap = Env.new(levels: [0, 0.6, 1], times: [0.6, 0.4], curve: [1, -2]);
noiseAmp = IEnvGen.kr(noiseAmpMap, amp);

noiseFreqs = [hz, hz * 0.5];
noiseRingTimes = [1.4, 1];
noise = Saw.ar((hz * 0.25) + PinkNoise.kr(8), 0.0005) + PinkNoise.ar(0.003);
noise = DynKlank.ar(`[noiseFreqs, nil, noiseRingTimes], noise);
//noise = DynKlank.ar(`[[hz], nil, [1]], PinkNoise.ar(0.007));

ampFinal = OnePole.kr(amp, 0.1);

sig = XFade2.ar(noise * ampFinal, tone * 0.6, (noiseAmp * 2) -1);
//sig = Mix.ar([sig, noise * Lag3.kr(ampFinal, 1)]);

Out.ar(out, sig);
})
);

//
// Shapers
//

shapers = List.new;

shapers.add(
SynthDef(\assemblage_place, {
arg out=0, in=0, amp=0.2;
// TODO: panning
var sig = In.ar(in) * amp;
Out.ar(out, sig!2);
})
);
}

*definitions {
^voices ++ shapers;
}

*collectNames { arg defs;
^defs.collectAs({arg d; d.name}, List);
}

*voiceNames {
^this.collectNames(voices);
}
}

/*
AssemblageDefs.definitions
AssemblageDefs.voiceNames
*/
4 changes: 2 additions & 2 deletions mod/lib/Engine_Haze.sc → mod/lib/Engine_Assemblage.sc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Engine_Haze : CroneEngine {
Engine_Assemblage : CroneEngine {
var <kernel;

*new { arg context, doneCallback;
^super.new(context, doneCallback);
}

alloc {
kernel = Haze.new(this.context.server, this.context.xg, this.context.out_b);
kernel = Assemblage.new(this.context.server, this.context.xg, this.context.out_b);

context.server.sync;

Expand Down
142 changes: 0 additions & 142 deletions mod/lib/HazeDefs.sc

This file was deleted.

2 changes: 1 addition & 1 deletion mod/haze.lua → mod/spn.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mu = require('musicutil')

engine.name = 'Haze'
engine.name = 'Assemblage'

touches = {}
dirty = false
Expand Down

0 comments on commit 9823fb6

Please sign in to comment.