mbFlutter.scd 2.84 KB
Newer Older
Kenneth Flak's avatar
Kenneth Flak committed
1 2 3 4 5 6 7 8 9 10 11
(
~mbFlutterFx.do(_.free);
~mbFlutter.do(_.free);
~mbFlutterFx = List.new(0);
4.do{
    ~mbFlutterFx.add(
        FxChain.new(
            fadeInTime: 10,
            level: 6.dbamp,
            fadeOutTime: 10,
            out: ~masterBus,
Kenneth Flak's avatar
flutter  
Kenneth Flak committed
12
        );
Kenneth Flak's avatar
Kenneth Flak committed
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
    );
};
~mbFlutterFx[0].addPar(
    \comb, [\mix, 0.3, \delay, 0.2, \decay, 1, \amp, 1/3],
    \comb, [\mix, 0.3, \delay, 0.5, \decay, 1, \amp, 1/3],
    \comb, [\mix, 0.3, \delay, 0.7, \decay, 1, \amp, 1/3],
);
~mbFlutterFx[0].add(\eq, [
    \locut, 120,
    \hishelfdb, -6,
]);
//---------------------------------------------------------
~mbFlutterFx[1].add(\jpverb, [
    \revtime, 2,
    \mix, 0.1
]);
~mbFlutterFx[1].add(\eq, [
    \locut, 120,
    \hishelfdb, -6,
]);
//---------------------------------------------------------
~mbFlutterFx[2].add(\greyhole, [
    \delayTime, 0.3,
    \feedback, 0.6,
    \mix, 0.1
]);
~mbFlutterFx[2].add(\eq, [
    \locut, 500,
    \hishelfdb, -6,
]);
//---------------------------------------------------------
Kenneth Flak's avatar
Kenneth Flak committed
44

Kenneth Flak's avatar
Kenneth Flak committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
~mbFlutter = ~mb.collect{|id, idx|
    MBDeltaTrig.new(
        speedlim: 0.5,
        threshold: 0.05,
        minibeeID: id,
        minAmp: -12,
        maxAmp: -0,
        function: {|dt, minAmp, maxAmp|
            var currentFx;
            var buf = ~buf[\birdSong][0];
            // var buf = (~buf[\nuggets] ++ ~buf[\birdSong]).choose;
            var numFrames = buf.numFrames;
            var currentPos = numFrames.rand;
            var durFrom = rrand(0.1, 0.2);
            var durTo = rrand(0.1, 0.2);
            var step = durFrom * s.sampleRate;
            var count = 20;
            var len = dt.linlin(0.0, 1.0, step, step * count);
            // var pos = 8.collect({rrand(0, numFrames)});
            var pos = (currentPos, currentPos+step..currentPos+len).mod(numFrames);
            var time = pos[pos.size-1] - pos[0] / s.sampleRate;
Kenneth Flak's avatar
flutter  
Kenneth Flak committed
66

Kenneth Flak's avatar
Kenneth Flak committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
            Pbind(
                \instrument, \playbuf,
                \buf, buf,
                \dur, Pseg(durFrom, durTo, time),
                // \attack, 0,
                \attack, Pkey(\dur) * 0.5,
                \release, Pkey(\dur) * 1.5,
                \startPos, Pseq(pos),
                \legato, Pwhite(0.1, 0.4),
                \rate, Pexprand(0.5, 4.0),
                \db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
                \pan, Pseg(Pwhite(0.0, 1.0), Pwhite(0.0, 1.0), time),
                \out, Pfunc({
                    currentFx = ~mbFlutterFx.choose;
                    currentFx.in
                }),
                \group, Pfunc({
                    currentFx.group
                }),
            ).play;
        }
    );
}
90

Kenneth Flak's avatar
flutter  
Kenneth Flak committed
91
)
Kenneth Flak's avatar
Kenneth Flak committed
92

93 94 95
// (
//     ~mbFlutterFx.do(_.play);
//     ~mbFlutter.do(_.play);
96 97 98 99
//     // ~mbFlutter[0].play;
//     // ~mbFlutter[1].play;
//     // ~mbFlutter[2].play;
//     // ~mbFlutter[3].play;
100 101 102 103 104
// )
// (
//     ~mbFlutterFx.do(_.free);
//     ~mbFlutter.do(_.free);
// )
Kenneth Flak's avatar
flutter  
Kenneth Flak committed
105