-
Notifications
You must be signed in to change notification settings - Fork 3
/
Patch-playToMixer.sc
56 lines (49 loc) · 1.34 KB
/
Patch-playToMixer.sc
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
+ Patch {
playToMixer { arg m, atTime = nil, callback;
var bundle = MixedBundle.new,
timeOfRequest = Main.elapsedTime;
this.group = m.synthgroup;
// generate synthdef to check numChannels
this.loadDefFileToBundle(bundle, m.server);
if(synthDef.numChannels > m.inChannels) {
"Playing a %-channel patch on a %-input mixer. Output may be incorrect."
.format(synthDef.numChannels, m.inChannels).warn;
};
this.prPlayToBundle(atTime,
SharedBus(this.rate, m.inbus.index, synthDef.numChannels, m.server),
timeOfRequest, bundle);
callback !? { bundle.addFunction(callback) };
bundle.sendAtTime(this.server, atTime, timeOfRequest);
}
}
+ AbstractPlayer {
prPlayToBundle { arg atTime, bus, timeOfRequest, bundle;
if(status !== \readyForPlay,{ this.prepareToBundle(group, bundle, false, bus) });
this.makePatchOut(group,false,bus,bundle);
this.spawnToBundle(bundle);
}
}
+ Nil {
draggedIntoMixerGUI { |gui|
gui.mixer = nil;
}
asMixerChannelGUI { |board|
^MixerChannelGUI(nil, board)
}
}
// needed to allow collections as mixer arguments in MixingBoard-new
+ Collection {
asMixerChannelGUI { |board|
^this.collect({ |mixer| MixerChannelGUI(mixer, board) })
}
}
+ MixerChannel {
draggedIntoMixerGUI { |gui|
gui.mixer = this;
}
}
+ String {
draggedIntoMixerGUI { |gui|
this.interpret.draggedIntoMixerGUI(gui)
}
}