You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
MIDIClient.init;
|
|
MIDIClient.sources.do;
|
|
|
|
MIDIIn.connect(0);
|
|
|
|
MIDIIn.connectAll;
|
|
|
|
(
|
|
~sampleDir = PathName("~/snd/samples/808/").fullPath;
|
|
|
|
~samples = (
|
|
42: Buffer.read(s, ~sampleDir +/+ "Cls'dHihat.wav"),
|
|
46: Buffer.read(s, ~sampleDir +/+ "OpenHiHat.wav"),
|
|
49: Buffer.read(s, ~sampleDir +/+ "CYmbal.wav"),
|
|
56: Buffer.read(s, ~sampleDir +/+ "CowBell.wav"),
|
|
39: Buffer.read(s, ~sampleDir +/+ "handClaP.wav"),
|
|
37: Buffer.read(s, ~sampleDir +/+ "RimShot.wav"),
|
|
50: Buffer.read(s, ~sampleDir +/+ "HiTom.wav"),
|
|
47: Buffer.read(s, ~sampleDir +/+ "MidTom.wav"),
|
|
43: Buffer.read(s, ~sampleDir +/+ "LowTom.wav"),
|
|
38: Buffer.read(s, ~sampleDir +/+ "SnareDrum.wav"),
|
|
36: Buffer.read(s, ~sampleDir +/+ "BassDrum.wav"),
|
|
70: Buffer.read(s, ~sampleDir +/+ "MAracas.wav"),
|
|
75: Buffer.read(s, ~sampleDir +/+ "CLaves.wav"),
|
|
62: Buffer.read(s, ~sampleDir +/+ "HiConga.wav"),
|
|
63: Buffer.read(s, ~sampleDir +/+ "MidConga.wav"),
|
|
64: Buffer.read(s, ~sampleDir +/+ "LowConga.wav")
|
|
);
|
|
);
|
|
|
|
~playSample = { |note|
|
|
var buf = ~sample[note];
|
|
if (buf.notNil) {
|
|
Synth(\samplePlayer, [\buf, buf]);
|
|
};
|
|
};
|
|
|
|
MIDIdef.noteOn(\tr08Trigger, { |vel, note, chan, src|
|
|
~playSample.(note);
|
|
});
|
|
|
|
|
|
MIDIdef.cc[\cc_debug, { |val, num, chan, src|
|
|
[num, val].postln;
|
|
}); |