multigrain/main.scd

70 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-04-02 06:51:06 +00:00
// Execute this before booting the server
(
2022-04-02 06:51:06 +00:00
Server.default.options.inDevice_("Scarlett 2i2 USB");
2023-04-02 06:10:23 +00:00
//Server.default.options.outDevice_("Scarlett 2i2 USB");
)
Server.killAll;
2022-04-02 06:51:06 +00:00
2023-04-09 02:12:36 +00:00
("./synths.scd").loadRelative;
("./control.scd").loadRelative;
("./effects.scd").loadRelative;
2022-04-02 06:51:06 +00:00
Granulator.init(s);
(
// set up four position buffers with synths
~modes = [
2023-04-09 01:46:05 +00:00
[ "saw", \pos_saw ],
[ "reverse", \pos_reverse ],
[ "sine", \pos_sine ],
[ "step", \pos_step ],
[ "random", \pos_random ]
];
2022-04-02 06:51:06 +00:00
~granulators = Array.new(4);
~posb = Array.new(4);
~possynths = Array.new(4);
(0..3).do({
var pb = Bus.control(s, 1), ps;
~posb.add(pb);
ps = Synth(\pos_saw, [ \out, pb ]);
~possynths.add(ps);
});
(0..3).do({ |i|
var pb = ~posb.at(i);
~granulators.add(Granulator.new(~buflen, ~recordb, ~outb, pb, ~triggerb, ~pitchb));
});
)
(
~setmode = {
arg track, mode;
var synth = ~modes[mode][1];
~possynths[track].get(\speed, { | speed |
~possynths[track].free;
~possynths[track] = Synth(synth, [\out, ~posb[track], \speed, speed]);
});
}
)
2023-04-07 06:16:05 +00:00
~granulators[0].gain(1);
2023-04-07 06:16:05 +00:00
("./interface.scd").loadRelative;
2022-04-02 06:51:06 +00:00
2022-04-02 06:51:06 +00:00
2022-04-18 22:29:26 +00:00
2022-04-09 07:38:18 +00:00