move experiments from template
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Sat, 13 Jan 2024 12:30:01 +0000 (13:30 +0100)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Sat, 13 Jan 2024 12:30:01 +0000 (13:30 +0100)
library/template.scd
temp.scd

index ea84008..8de4563 100644 (file)
@@ -61,7 +61,7 @@ SynthDef(\fagi, { arg
   var sig = 0;
   var panDelay = 0.005;
   var modFreqMul = SinOsc.kr(modFreq, 0, modAmp, 1);
-  var curFreq = EnvGen.ar(Env([freqStart, freq, freqEnd], [0.01, release], \exp, 1), gate);
+  var curFreq = EnvGen.ar(Env([freqStart, freqStart, freq, freqEnd], [0, 0.01, release], \exp, 1), gate);
   sig = sig + Pulse.ar(curFreq * modFreqMul);
   //sig = (sig*11.2).fold(-1, 1);
   sig = RLPF.ar(sig, cut, rez);
@@ -72,61 +72,29 @@ SynthDef(\fagi, { arg
 }).add;
 )
 
-// pdefs
+// tempo
 
-(
-Pdef(\baseight, Pmono(\qoba, *[
-  trig: 1,
-  accent: 0.5,
-  freq: Pexprand(40, 80),
-  tone: 0.5,
-  decay: 0.9,
-  attackfm: 0.3,
-  selffm: 0.75,
-  dur: 1,
-  db: 60,
-  out: ~mainBus,
-])).quant_(4).play;
-)
+TempoClock.tempo = 1.5;
 
-(
-Pdef(\fagi1, Pbind(*[
-  group: ~fagiGroup,
-  out: ~mainBus,
-  instrument: \fagi,
-  db: 40,
-  pan: 0,
-  trig: 1,
-  dur: Pseq([3, 3, 4, 2, 2, 1, 1].split(2)/4, inf),
-  legato: 0.2,
-  release: TempoClock.tempo.reciprocal/2,
-  octave: Prand((3..4), inf),
-  note: Pseq([0, 5, 0, 7, 2, 7, 6], inf),
-  freqStart: Pkey(\freq)/Prand([2, 4], inf),
-  freqEnd: Pkey(\freq)/Prand([1/2, 1/4, 2, 4], inf),
-])).quant_(4);
-)
+// pdefs
 
 (
-Pdef(\fagi2, Pbind(*[
+Pdef(\fagi, Pbind(*[
   group: ~fagiGroup,
   out: ~mainBus,
   instrument: \fagi,
   db: 40,
   pan: 0,
   trig: 1,
-  dur: Pseq([3, 3, 4, 2, 2, 1, 1].split(2)/4, inf),
-  legato: 0.2,
-  release: TempoClock.tempo.reciprocal/2,
-  octave: Prand((5..7), inf),
-  note: Pseq([0, 5, 0, 7, 2, 7, 6], inf),
-  freqStart: Pkey(\freq)/Prand([2, 4], inf),
-  freqEnd: Pkey(\freq)/Prand([1/2, 1/4, 2, 4], inf),
+  dur: 1,
+  legato: 0.7,
+  release: TempoClock.tempo.reciprocal / 2,
+  octave: 5,
+  note: 0,
+  freqStart: Pkey(\freq) / 1,
+  freqEnd: Pkey(\freq) / 1,
 ])).quant_(4);
 )
 
-TempoClock.tempo = 1.5;
-Pdef(\fagi1).play;
-Pdef(\fagi2).play;
-Pdef(\fagi1).stop;
-Pdef(\fagi2).stop;
\ No newline at end of file
+Pdef(\fagi).play;
+Pdef(\fagi).stop;
\ No newline at end of file
index 515d92a..4c1abb5 100644 (file)
--- a/temp.scd
+++ b/temp.scd
@@ -124,4 +124,94 @@ Pdef(\temp, Pbind(*[
 
 z = Pbind(\degree, Pdefn(\x, \), \dur, 0.25).play;
 Pdefn(\x, Pseq((0..5), inf)).condition_({ |val, i| i.postln % 6 == 0 });
-Pdefn(\x, Pseq((7..0), inf)).condition_({ |val, i| i.postln % 8 == 0 });
\ No newline at end of file
+Pdefn(\x, Pseq((7..0), inf)).condition_({ |val, i| i.postln % 8 == 0 });
+
+/// different start / mid / end pitch
+
+// synthdefs
+
+(
+SynthDef(\fagi, { arg
+  out=0,
+  amp=1,
+  relAmp=1, // for controlling volume of a set of synths
+  pan=0,
+  t_trig=1,
+  gate=1,
+  freq=440,
+  freqStart=440,
+  freqEnd=440,doneAction=2, cut=800, rez=0.8,
+  modFreq=3, modAmp=0.01, release=1.0
+  ;
+  var sig = 0;
+  var panDelay = 0.005;
+  var modFreqMul = SinOsc.kr(modFreq, 0, modAmp, 1);
+  var curFreq = EnvGen.ar(Env([freqStart, freq, freqEnd], [0.01, release], \exp, 1), gate);
+  sig = sig + Pulse.ar(curFreq * modFreqMul);
+  //sig = (sig*11.2).fold(-1, 1);
+  sig = RLPF.ar(sig, cut, rez);
+  sig = sig * EnvGen.ar(Env.asr(releaseTime: release), gate, doneAction: doneAction);
+  sig = Pan2.ar(sig, pan);
+  sig = [DelayN.ar(sig[0], panDelay, (panDelay*pan).clip(0, 1)), DelayN.ar(sig[1], panDelay, (panDelay.neg*pan).clip(0, 1))];
+  Out.ar(out, sig * amp * relAmp);
+}).add;
+)
+
+// pdefs
+
+(
+Pdef(\baseight, Pmono(\qoba, *[
+  trig: 1,
+  accent: 0.5,
+  freq: Pexprand(40, 80),
+  tone: 0.5,
+  decay: 0.9,
+  attackfm: 0.3,
+  selffm: 0.75,
+  dur: 1,
+  db: 60,
+  out: ~mainBus,
+])).quant_(4).play;
+)
+
+(
+Pdef(\fagi1, Pbind(*[
+  group: ~fagiGroup,
+  out: ~mainBus,
+  instrument: \fagi,
+  db: 40,
+  pan: 0,
+  trig: 1,
+  dur: Pseq([3, 3, 4, 2, 2, 1, 1].split(2)/4, inf),
+  legato: 0.2,
+  release: TempoClock.tempo.reciprocal/2,
+  octave: Prand((3..4), inf),
+  note: Pseq([0, 5, 0, 7, 2, 7, 6], inf),
+  freqStart: Pkey(\freq)/Prand([2, 4], inf),
+  freqEnd: Pkey(\freq)/Prand([1/2, 1/4, 2, 4], inf),
+])).quant_(4);
+)
+
+(
+Pdef(\fagi2, Pbind(*[
+  group: ~fagiGroup,
+  out: ~mainBus,
+  instrument: \fagi,
+  db: 40,
+  pan: 0,
+  trig: 1,
+  dur: Pseq([3, 3, 4, 2, 2, 1, 1].split(2)/4, inf),
+  legato: 0.2,
+  release: TempoClock.tempo.reciprocal/2,
+  octave: Prand((5..7), inf),
+  note: Pseq([0, 5, 0, 7, 2, 7, 6], inf),
+  freqStart: Pkey(\freq)/Prand([2, 4], inf),
+  freqEnd: Pkey(\freq)/Prand([1/2, 1/4, 2, 4], inf),
+])).quant_(4);
+)
+
+TempoClock.tempo = 1.5;
+Pdef(\fagi1).play;
+Pdef(\fagi2).play;
+Pdef(\fagi1).stop;
+Pdef(\fagi2).stop;
\ No newline at end of file