From ba37ee4ed659fecf8437f3688784b5d55900d8cd Mon Sep 17 00:00:00 2001
From: PLN <pln@PLN-THINK-DEB>
Date: Fri, 9 Apr 2021 21:20:25 +0200
Subject: [PATCH] Chore: Sync

---
 live/hip/lofi/hellofi.tidal |  8 ++++----
 live/midi/beats.tidal       | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 start_and_midi.scd          | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tidal-worksheets            |  1 +
 4 files changed, 128 insertions(+), 4 deletions(-)
 create mode 100644 start_and_midi.scd
 create mode 120000 tidal-worksheets

diff --git a/live/hip/lofi/hellofi.tidal b/live/hip/lofi/hellofi.tidal
index 451768c..4e2fcde 100644
--- a/live/hip/lofi/hellofi.tidal
+++ b/live/hip/lofi/hellofi.tidal
@@ -24,11 +24,11 @@ d1 $ g -- Kick
   $ whenIn (mask "<f!7 [f t] t(2,4)!4 t(3,4) t(5,8) t(6,8) t>")
   $ whenOutFade
   $ whenPt2Begin (degradeBy "<1!3 [1!3 0.5] 0.5!3 [1!3 0]>")
-  $ whenPt2 (fast 2 . (<| "k . <[k ~ <k k*2> <k ~>] . k(<3!3 5>,8)>"))
+  $ whenPt2 (<| "k . <[k ~ <k k*2> <k ~>] . k(<3!3 5>,8)>")
   $ whenPt1 (<| "k [~|k*4] . ~ [<k <~ k>> <~ k>]")
   $ "jazz"
-  # attack 0.97
-  # gain 3
+  # attack 0.25
+  # gain 2
 d2 $ g -- Clap contretemps
   $ whenIn (mask "<f!7 t f!4 t!4>")
   $ whenOutFade
@@ -63,7 +63,7 @@ d4 $ g -- Bassline doublée
   $ arp "up"
   $ note (prog |+| "c2'maj*4")
   # "bassWarsaw"
-  # gain 0.75
+  # gain 0.85
   # room (slow 32 $ range 0 0.8 saw)
   # sz 0.5
 d5 $ g -- FMRhodes base
diff --git a/live/midi/beats.tidal b/live/midi/beats.tidal
index 528a922..7e48250 100644
--- a/live/midi/beats.tidal
+++ b/live/midi/beats.tidal
@@ -213,3 +213,51 @@ d2
   $ slice 4 "<0 0 3 <0 3>> 1*<1 1 2 <1 2>> 2*<1 2 2 4> 3"
   $ "breaks165" # cps (165/50/4)
   # gain (0.55 * "1 1 0.9 1")
+
+-- LoFi
+do
+setcps (60/60/4)
+let whenIntro    pat = someCyclesBy "<t!8 f!24>" pat
+let whenNotIntro pat = someCyclesBy "<f!8 t!24>" pat
+let whenBrk      pat = whenmod 16 10 pat
+let whenNotBrk   pat = someCyclesBy "<t!10 f!6>" pat
+let whenBrkLPF  = whenBrk (# lpf "<400 200 100 50 0 0>")
+d1
+  $ whenBrkLPF
+  $ whenNotBrk (# sz "<0.8 0.9 0.95 0.99>")
+  $ "k . k(3,8)" # "[jazz,reverbkick]"
+  # gain 1 # lpf 1000
+  # room 0.23
+  # legato 2 # cut 1
+d2
+  $ whenBrkLPF
+  $ whenmod 16 8 (fast 2)
+  $ whenmod 8 6 (mask "<f [f t]>")
+  $ superimpose (# hpf 500)
+  $ "~ s"
+  # "snare:20"
+  # gain 0.9
+d3
+  $ whenBrk (slow "<2 2 4 4 8 8 16 16>")
+  $ fast ("8" * "<[2 1!7] 1!3> <2 [2 1] [2 . 1 2] [2 4]>")
+  $ "drum:2"
+  # room 0.6
+  # gain 0.8
+d5
+  $ swing 2
+  $ whenBrk (# crush (slow 6 $ range 16 3.5 saw))
+  $ whenNotBrk (off "<e q> . <q h>" (|+ note 7))
+  $ struct "t*<[1 0] 2 4 [12 . 8]>"
+  $ note ("fs a" - 24)
+  # "bassWarsaw"
+  # gain 1
+d4 -- Toy bogdan
+  $ every' 16 15 (# "bogdan:4")
+  $ every' 16 9 ((# "~ ~ ~ bogdan:2") . (|* gain 0.8))
+  $ "~ ~ ~ bogdan:0"
+  # room 0.5
+  # legato 2
+  # hpf 200
+  # gain 1.1
+
+once $ "bogdan:4" # cut 42 # gain 0.9
diff --git a/start_and_midi.scd b/start_and_midi.scd
new file mode 100644
index 0000000..323f0b6
--- /dev/null
+++ b/start_and_midi.scd
@@ -0,0 +1,75 @@
+// Evaluate the block below to start the mapping MIDI -> OSC.
+var on, off, cc;
+var osc;
+
+osc = NetAddr.new("127.0.0.1", 6010);
+
+MIDIClient.init;
+MIDIIn.connectAll;
+
+// Initial: sends velocity on note's channel
+// on = MIDIFunc.noteOn({ |val, num, chan, src|
+// 	osc.sendMsg("/ctrl", num.asString, val/127);
+// });
+
+on = MIDIFunc.noteOn({ |val, num, chan, src|
+	// it will be passed the arguments val, num, chan, and src, corresponding to the message value (e.g. velocity, control value, etc.)
+	osc.sendMsg("/ctrl", "note", (num - 60));
+});
+
+off = MIDIFunc.noteOff({ |val, num, chan, src|
+	osc.sendMsg("/ctrl", "note", 0);
+});
+
+cc = MIDIFunc.cc({ |val, num, chan, src|
+	osc.sendMsg("/ctrl", num.asString, val/127);
+});
+
+if (~stopMidiToOsc != nil, {
+	~stopMidiToOsc.value;
+});
+
+~stopMidiToOsc = {
+	on.free;
+	off.free;
+	cc.free;
+};
+
+// Evaluate the line below to stop it.
+// ~stopMidiToOsc.value;
+
+
+/*
+This is an example startup file. You can load it from your startup file
+(to be found in Platform.userAppSupportDir +/+ "startup.scd")
+*/
+
+
+(
+// configure the sound server: here you could add hardware specific options
+// see http://doc.sccode.org/Classes/ServerOptions.html
+s.options.numBuffers = 1024 * 256; // increase this if you need to load more samples
+s.options.memSize = 8192 * 32; // increase this if you get "alloc failed" messages
+s.options.numWireBufs = 128; // increase if "exceeded number of wire buffer" messages
+s.options.maxNodes = 4096 * 32; // increase this if you are getting drop outs and the message "too many nodes"
+s.options.numOutputBusChannels = 2; // set this to your hardware output channel size, if necessary
+s.options.numInputBusChannels = 2; // set this to your hardware output channel size, if necessary
+// boot the server and start SuperDirt
+s.waitForBoot {
+	~dirt = SuperDirt(2, s); // two output channels, increase if you want to pan across more channels
+	~dirt.loadSoundFiles;   // load samples (path containing a wildcard can be passed in)
+	// for example: ~dirt.loadSoundFiles("/Users/myUserName/Dirt/samples/*");
+	// s.sync; // optionally: wait for samples to be read
+	~dirt.start(57120, 0 ! 12);   // start listening on port 57120, create two busses each sending audio to channel 0
+
+	// optional, needed for convenient access from sclang:
+	(
+		~d1 = ~dirt.orbits[0]; ~d2 = ~dirt.orbits[1]; ~d3 = ~dirt.orbits[2];
+		~d4 = ~dirt.orbits[3]; ~d5 = ~dirt.orbits[4]; ~d6 = ~dirt.orbits[5];
+		~d7 = ~dirt.orbits[6]; ~d8 = ~dirt.orbits[7]; ~d9 = ~dirt.orbits[8];
+		~d10 = ~dirt.orbits[9]; ~d11 = ~dirt.orbits[10]; ~d12 = ~dirt.orbits[11];
+	);
+};
+
+s.latency = 1; // increase this if you get "late" messages
+);
diff --git a/tidal-worksheets b/tidal-worksheets
new file mode 120000
index 0000000..d27f459
--- /dev/null
+++ b/tidal-worksheets
@@ -0,0 +1 @@
+study/tidal-worksheets
\ No newline at end of file
--
libgit2 0.27.0