--- /dev/null
+MidiMix {
+ const <version = "0.1";
+ const <name = \Mix101;
+ classvar ledValues;
+ classvar instance = nil;
+ var <midiout, <idin;
+ var <>caro;
+ var <>joro, <>viro, <>wipu, <>wire;
+ var <>sepu, <>sere;
+ var <>sewo, <>luwo, <>fewo, <>viwo;
+ var <>sypu, <>syre;
+
+ *new {
+ if (instance == nil) {
+ ledValues = IdentityDictionary[
+ \on -> 127,
+ \light -> 127,
+ true -> 127,
+ \off -> 0,
+ \dark -> 0,
+ false -> 0
+ ];
+ instance = super.new.prInit;
+ };
+ ^instance
+ }
+
+ 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;
+
+ // MIDI out channel selector (back of the device)
+ // velocity is the channel
+ MIDIdef.noteOn(\caro+name, {|...args|
+ caro.value(*args);
+ }, 14, srcID: idin);
+
+ // == Jog wheel
+ // Start rotating
+ MIDIdef.noteOn(\wipu+name, {|...args|
+ wipu.value(*args);
+ }, 21, srcID: idin);
+ // Stop rotating
+ MIDIdef.noteOff(\wire+name, {|...args|
+ wire.value(*args);
+ }, 21, srcID: idin);
+ // Rotating in sampler/loop/fx mode
+ MIDIdef.cc(\joro+name, {|...args|
+ joro.value(*args);
+ }, 19, srcID: idin);
+ // Rotating in cue/vinyl mode
+ MIDIdef.cc(\viro+name, {|...args|
+ viro.value(*args);
+ }, 21, srcID: idin);
+
+ // == sync/select buttons
+ // select button pushed
+ MIDIdef.noteOn(\sepu+name, {|...args|
+ sepu.value(*args);
+ }, 5, srcID: idin);
+ // select button released
+ MIDIdef.noteOff(\sere+name, {|...args|
+ sere.value(*args);
+ }, 5, srcID: idin);
+ // sync button pushed
+ MIDIdef.noteOn(\sypu+name, {|...args|
+ sypu.value(*args);
+ }, 6, srcID: idin);
+ // sync button released
+ MIDIdef.noteOff(\syre+name, {|...args|
+ syre.value(*args);
+ }, 6, srcID: idin);
+ // sampler mode activated
+ MIDIdef.noteOn(\sewo+name, {|...args|
+ sewo.value(*args);
+ }, 17, srcID: idin);
+ // loop mode activated
+ MIDIdef.noteOn(\luwo+name, {|...args|
+ luwo.value(*args);
+ }, 18, srcID: idin);
+ // fx mode activated
+ MIDIdef.noteOn(\fewo+name, {|...args|
+ fewo.value(*args);
+ }, 19, srcID: idin);
+ // cue/vinyl mode activated
+ MIDIdef.noteOn(\viwo+name, {|...args|
+ viwo.value(*args);
+ }, 20, srcID: idin);
+ }
+
+ // == LED control
+ // pfl a
+ leda {|value=true|
+ value = ledValues[value] ? value;
+ (0..15).do {|i|
+ [i, value].postln;
+ midiout.noteOn(i, 1, value);
+ };
+ }
+}
\ No newline at end of file
(
~push = ~pushFactory.value;
-~se = Sampler.new(\qaxi);
+~se = Sampler(\qaxi);
~pe = ~pedalFactory.value;
)
-Pxrand
+
+~se.avgSize = 1;
+~se.sampDiv = 50;
+
+~se.plotter.domainSpecs_([0, 1, \lin, 0, 0, "se"].asSpec;).refresh;
+a = ~se.plotter.value;
+b = a[..a.size-5].collect {|item, index|
+ item+a[index+1]+a[index+6];
+};
+~se.plotter.value=b;
+a = a.resamp1(500);
+
(
~se.buf.loadToFloatArray(action: { |array|
{
});
)
-~se.soundView.setData(~data, 1024, samplerate: ~se.buf.sampleRate);
+~se.plotter.specs = \bipolar.asSpec;
+~se.soundView.setData(~data, 1024, samplerate: ~se.buf.sampleRate);
~se.soundView.data
(\freq: 220).play;
~se.makeSynthEvent
~se.makeSynthArgs
+
+
(
~notes = Array.newClear(128);
~amps = Array.newClear(128);
~pe.suDown = { |zi|
- ~se.startRec(true);
+ ~se.startRec(false);
};
~pe.suUp = { |zi|
~se.stopRec;
)).quant_(4).stop;
)
-{SinOsc.ar(440, mul: 0.2)}.play
\ No newline at end of file
+{SinOsc.ar(440, mul: 0.2)}.play
+
+(
+s.waitForBoot{
+ SSampler(\reel).load([Quarks.folder ++ "/SuperSampler/Testcode/Sounds/Reel Palindruome_44.1kHz_int16.aiff"]);
+}
+)