--- /dev/null
+MidiHandler {
+ var <name, <midiNames;
+ var <midiout, <idin;
+ var <>reveal = false;
+
+ noCallback {|handlerName...args|
+ if (reveal) {
+ "%.%(%)".format(this.name, handlerName, args).postln;
+ };
+ }
+
+ midiInit {
+ var dest;
+ dest = MIDIClient.destinations.detect({ |item|
+ item.device == midiNames[0];
+ });
+ if (dest == nil) {
+ Error("Cannot connect to "++name).throw;
+ };
+ midiout = MIDIOut.newByName(dest.device, dest.name).latency_(0);
+ idin = MIDIClient.sources.detect{|i| i.device == midiNames[0]}.uid;
+ }
+}
\ No newline at end of file
-MidiMix {
+MidiMix101 : MidiHandler {
classvar ledValues, ledControls;
classvar controlNotes;
- const <version = "0.1";
- var <name;
var <channel = 5;
- var <midiout, <idin;
- var <>reveal = false;
// channel selector
var <>chanrot;
// modes
];
}
- *new {|name=\Mix101|
- ^super.newCopyArgs(name).prInit;
+ *new {|name='DJ-Tech MIX-101', midiNames=#["Mix-101", "Mix-101 MIDI 1", "Mix-101 MIDI 1"]|
+ ^super.newCopyArgs(name, midiNames).midiInit.controlInit;
}
- noCallback {|handlerName...args|
- if (reveal) {
- "%.%(%)".format(this.name, handlerName, args).postln;
- };
- }
-
- prInit {
- var dest = MIDIClient.destinations.detect({ |item|
- item.device == "Mix-101"
- });
- if (dest == nil) {
- Error("Cannot connect to DJ-Tech MIX-101").throw;
- };
- midiout = MIDIOut.newByName(dest.device, dest.name).latency_(0);
- idin = MIDIClient.sources.detect{|i| i.device == "Mix-101"}.uid;
-
+ controlInit {
// MIDI out channel selector (back of the device)
// velocity is the channel
MIDIdef.noteOn(\chanrot++name, {|...args|
MIDIdef.cc(\bcr2000defaultTurn, { |...args|
controler.turn(*args);
- }, (1..110), controler.channel);
+ }, (1..110), controler.channel, 2883584);
"Ԃиџуту готов к использованию 😊".postln;
-(
-MIDIdef.cc(\testcc, {|...args|
- (["cc"] ++ args).postln;
-});
-MIDIdef.noteOn(\testnoteon, {|...args|
- (["note on"] ++ args).postln;
-});
-MIDIdef.noteOff(\testnoteoff, {|...args|
- (["note off"] ++ args).postln;
-});
-MIDIdef.touch(\testtouch, {|...args|
- (["touch"] ++ args).postln;
-});
-MIDIdef.polytouch(\testpolytouch, {|...args|
- (["polytouch"] ++ args).postln;
-});
-MIDIdef.bend(\testbend, {|...args|
- (["bend"] ++ args).postln;
-});
-MIDIdef.sysex(\testsysex, {|...args|
- (["sysex"] ++ args).postln;
-});
-)
-
-MKtl.find;
-
(
~mix = MidiMix();
~se = Sampler();
)
(
-~amp = 0.5;
+~amp = 1;
~density = 10;
~len = 0.1;
~rate = 1;
~se.plotter.specs = \bipolar.asSpec;
~se.soundView.setData(~data, 1024, samplerate: ~se.buf.sampleRate);
-~se.soundView.data
+~se.soundView.data.
(\freq: 220).play;
};
~push.padDown = { |zi, row, col, vel|
var freq;
+ vel = vel * 5;
~push.padLight(row, col, 2, 1, false, 0);
freq = Scale.major.degreeToFreq(col, 0.midicps, row+1);
~notes[freq.cpsmidi.asInteger] = Synth(~se.synthdefName, ~se.makeSynthArgs++[\freq, freq, \amp, vel]);
};
~push.padPressure = { |zi, row, col, vel|
var freq;
+ vel = vel * 5;
//~push.padLight(row, col, 0, 0, false, 1);
freq = Scale.major.degreeToFreq(col, 0.midicps, row+1);
if (vel > ~amps[freq.cpsmidi.asInteger], {
var maxRatio = 1.5;
("initial "++vel).postln;
if ((vel/amp) > maxRatio, { vel = amp * maxRatio; });
- ~notes[freq.cpsmidi.asInteger].set(\amp, vel);
+ ~notes[freq.cpsmidi.asInteger].set(\amp, vel*5);
("new "++vel).postln;
});
});
SSampler(\reel).load([Quarks.folder ++ "/SuperSampler/Testcode/Sounds/Reel Palindruome_44.1kHz_int16.aiff"]);
}
)
+