From 74f0a7208eb149cdf161d5059d5938695d129e39 Mon Sep 17 00:00:00 2001 From: Eugene Petkevich Date: Mon, 9 May 2022 16:17:28 +0300 Subject: [PATCH] Make bind instead of event / explore scales and tunings --- sampler.scd | 14 +++++----- test.scd | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/sampler.scd b/sampler.scd index e8e7ea5..ae5b7d2 100644 --- a/sampler.scd +++ b/sampler.scd @@ -44,13 +44,13 @@ [\out, 0, \buf, zi.buf, \startPos, zi.startPos, \duration, zi.duration], addAction: \addToHead); }, - \makeSynthEvent -> { |zi| - "makeSynthEvent called".postln; - ( - instrument: \samplerPlay, - buf: zi.buf, - startPos: zi.startPos, - duration: zi.duration, + \makeSynthBind -> { |zi| + "makeSynthBind called".postln; + Pbind( + \instrument, \samplerPlay, + \buf, zi.buf, + \startPos, zi.startPos, + \duration, zi.duration, ); }, \makeSynthArgs -> { |zi| diff --git a/test.scd b/test.scd index 322efd9..4e2a277 100644 --- a/test.scd +++ b/test.scd @@ -215,4 +215,80 @@ try { Exception.new().throw; ret = 1; } { ret = 2 }; ~caller.func -~se.maxDur \ No newline at end of file +~se.maxDur + +//=========================== scale experiments + +( +//(note: 9, octave: 5).play; +~se2.startRec; +) +~se2.stopRec; + +~se2.shiftPos(0.05); +~se2.duration = ~se.duration - 0.05; +~se2.playSample; +Scale +Tuning.directory +(0..12).collect(_ * (3 ** (1/13))) +~tun = Tuning.new((0..12).collect(_ * (12*(3 ** (1/13)).log2)), 3, "tritave"); +~scale = Scale.chromatic(~tun); + +( +Pdef(\sampe, ~se.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 5, + \note, Pseq([[0, -7]]++(9!8), inf), + \dur, 3, + \db, -10, +)).quant_(9).stop; +) +( +Pdef(\sampo, ~se.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 5, + \note, Pxrand([2, 5, 8, 11], inf), + \dur, 1, + \db, -20, + \timingOffset, 1/3, +)).quant_(9).stop; +) +( +Pdef(\sampi, ~se.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 7, + \note, Pxrand((1,3..12), inf), + \dur, 1, + \db, -30, + \timingOffset, 1/6, +)).quant_(9).stop; +) + +TempoClock.tempo = 2; +( +Pdef(\teste, Pbind( + \dur, 1 +)).stop; +) +~se2 = ~samplerFactory.value; +( +Pdef(\samia, ~se.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 5, + \note, Pseq((0..12)++(11..1) +.t [0, 7], inf), + \dur, 4, + \db, -1, + \timingOffset, 0, +)).quant_(4).stop; +) +[1, 2] +.t [0, 3] +( +Pdef(\samei, ~se2.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 5, + \note, Pseq((0..12)++(11..1) +.t [0, 3], inf), + \dur, 3, + \db, -15, + \timingOffset, 0, +)).quant_(4).stop; +) \ No newline at end of file -- 2.17.1