«EWI Broadcast to Studio» by mkb.dirtyorg

on 09 Sep'20 17:13 in midi

The idea here is to blast everything from my EWI to every other channel on every other device in my studio. Don't use as-is; I'm getting timing problems

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
MIDIClient.init
MIDIClient.sources[8].uid
MIDIClient.destinations.postln

~channels = [
	[], // iac
	[1], // fs1r
	[], // rm1x
	[1,5,6,7,8,9,10,11,12,13,14,15,16], // cs1x
	[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], // k2000
	[1,2,3,4,5,6], // z1
	[], // monologue midi out
	[1], // monologue sound
	[] // EWI
];


MIDIIn.connectAll
(
MIDIdef.freeAll;
MIDIdef.noteOn(\broadcastNoteOn, {
	|velo, noteNum, chan, src|
	"noteOn ".post;
	[velo, noteNum, chan, src].postln;
	~channels.do({
		|channel, i|
		var midiout=MIDIOut.new(i);
		channel.do({|channelNum, i|
			midiout.noteOn(channelNum, noteNum, velo);
		});
	});

}, srcID: 1363844096);

MIDIdef.noteOff(\broadcastNoteOff, {
	|velo, noteNum, chan, src|
	"noteOff ".post;
	[velo, noteNum, chan, src].postln;
	~channels.do({
		|channel, i|
		var midiout=MIDIOut.new(i);
		channel.do({|channelNum, i|
			midiout.noteOff(channelNum, noteNum, velo);
		});
	});

}, srcID: 1363844096);

MIDIdef.cc(\broadcastCc, {
	|val, num, chan, src|
	"cc ".post;
	[val, num, chan, src].postln;
	~channels.do({
		|channel, i|
		var midiout=MIDIOut.new(i);
		channel.do({|channelNum, i|
			midiout.control(channelNum, num, val);
		});
	});

}, srcID: 1363844096);

MIDIdef.touch(\broadcastTouch, {
	|val, chan, src|
	"touch ".post;
	[val, chan, src].postln;
	~channels.do({
		|channel, i|
		var midiout=MIDIOut.new(i);
		channel.do({|channelNum, i|
			midiout.control(channelNum, num, val);
		});
	});

}, srcID: 1363844096);

MIDIdef.bend(\broadcastBend, {arg ...args; "bend ".post; args.postln; }, srcID: 1363844096);
 
)
raw 1632 chars (focus & ctrl+a+c to copy)
reception
comments