-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexample.scd
147 lines (113 loc) · 3.37 KB
/
example.scd
1
2
3
4
5
6
7
8
9
10
11
12
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Look at the pedal directory
PedalBoy.directory
//look at the node tree
s.plotTreeView(0.5, Window.new.front.alwaysOnTop_(true));
//IMPORTANT: put the entire pedalboy folder inside this path
//run this line to look at the path
Platform.userExtensionDir
// load a pedalboard preset
p = Pedalboard.load()
///MAKING PEDALBOARDS FROM SCRATCH
///WEAR HEADPHONES!!!!
(
s.waitForBoot({
//pedalboard object holds a list with pedal pointers
~pedalboard = Pedalboard.new(
server: s,
in_bus: 0,
out_bus: 0);
// our pedal objects
//input buffer
~input = PedalBoy.input_buffer();
~pedalboard.add(~input);
// saw synthesizer
~saw = PedalBoy.saw_synth();
~pedalboard.add(~saw);
//ringmod
~fshift = PedalBoy.freq_shift();
~pedalboard.add(~fshift);
// wah pedal. the ctrl knob is the "expression" pedal
~wah = PedalBoy.wah();
~pedalboard.add(~wah);
//vanilla envelope filter
~env_filter = PedalBoy.bitcrusher();
~pedalboard.add(~env_filter);
//vanilla compressor
~compressor = PedalBoy.vinyl_boy();
~pedalboard.add(~compressor);
//pitch shifter (better than the default ugen)
~pshift = PedalBoy.g_hex();
~pedalboard.add(~pshift);
~delay = PedalBoy.delay();
~pedalboard.add(~delay);
~freeverb = PedalBoy.freeverb();
~pedalboard.add(~freeverb);
~looper = GrainLooper.looper();
~pedalboard.add(~looper);
//assign midi notes to looper buttons
~looper.assign_loop_controls(
rec_butt_midinote: 38,
undo_butt_midinote: 50,
clear_butt_midinote: 60);
~panner = PedalBoy.panner();
~pedalboard.add(~panner);
});
)
// save current pedalboard configuration
~pedalboard.save
//load a previous pedalboard configuration. make sure to initialize server
~pedalboard = Pedalboard.load(s, 0, 0, nil)
//insert a pedal into our signal chain
~pedalboard.insert(1, PedalBoy.wah());
//access a pedal instance in our signal chain
~wah = ~pedalboard.at(1);
//modulate ANY knob in our gui using a Modulator
~mod = Modulator.noise(
parent: ~wah,
argument: \ctrl);
~pedalboard.insert(2, ~mod);
//remove a pedal from our pedalboard
~pedalboard.remove(1);
//easter egg: party mode
~pedalboard.go_crazy_aaaa_go_stupid(true)
//assign a knob to a ccNum
~pshift.assign_knob(1, \ctrl);
//assign bypass to a noteON
~pshift.assign_bypass(69);
//move pedal from index a to index b
~pedalboard.move_to(3, 1)
// if your midi isnt working, check this
MIDIClient.init;
MIDIIn.connectAll;
MIDIFunc.trace;
/// EXTRA: MAKING YOUR OWN PEDALS
//this is how you use the default constructor for your pedals
~myPedal = PedalBoy.from_synth_params(
server: s,
in: 0,
out: 0,
group: nil,
mappable_arg_dict: Dictionary.with(*[
//MAPPABLE ARGS ARE YOUR KNOBS
\gain -> MappableArg.gain(Bus.control(s, 1)),
//EXAMPLE: A simple volume control
\volume -> MappableArg.new(
symbol: \volume,
bounds: 0@1, //our limits for the knob,
default_value: 0.5, //our default value
warp: \lin, //lin or exp warp,
gui_object: \knob, //knob is the only one supported at the moment
bus: Bus.control(s, 1)) //provide it a control bus
]),
ugen_func: {
arg in = 0, out = 0, gain = 1, volume;
var sig;
sig = In.ar(in) * gain;
sig = sig * volume; //make sure you MappableArgs have the same name all around
ReplaceOut.ar(out, sig);
},
name: \mypedal,
addaction: \addAfter //always use addAfter, except for input/output buffers
);
//add your pedal to the board
~pedalboard.insert(1, ~myPedal);