Forráskód Böngészése

Just another normal commit

LuigiBiasi-Athenagroup 6 hónapja
szülő
commit
fe860fe82c
3 módosított fájl, 33 hozzáadás és 13 törlés
  1. 1 1
      SC/3_effects_integration.scd
  2. 29 10
      SC/4_osc_communication.scd
  3. 3 2
      SC/5_midi_controller.scd

+ 1 - 1
SC/3_effects_integration.scd

@@ -3,7 +3,7 @@
 var nbVoices = 16;
 
 //PUT HERE THE PATH TO THE JUCE VST3 PLUGIN
-var vst3Path = "Users/thomas/Desktop/MOscilloscope.vst3";
+var vst3Path = "C:\\Users\\Luigi\\Desktop\\CMLSPrjFull\\Chill-Music-Low-Stress\\JUCE\\CMLSProject.vst3";
 
 
 // LFO Synth

+ 29 - 10
SC/4_osc_communication.scd

@@ -8,7 +8,7 @@ OSCdef.freeAll;
 // Variables to track current pen type and color
 ~currentPenType = "\pen";
 ~currentColor = (r: 0.0, g: 0.0, b: 1.0); // Default blue
-~currentPadValues = (x: 0.0, y: 0.0, pressure: 1.0, a: 1); //Default pad values
+~currentPadValues = (x: 0.0, y: 0.0, pressure: 1.0, a: 1.0); //Default pad values
 
 
 // Define OSC responder for iDraw touch data
@@ -75,7 +75,8 @@ OSCdef.freeAll;
 				\waveform, 2
             );
 
-			~ctl.set(9, y.linlin(-0.5, 0.5, 0, 1));
+			~ctl.set(8, y.linlin(-0.5, 0.5, 0, 1));
+			~ctl.set(9, 0.5);
 
             //["Pencil preset:", "Cutoff", x.linexp(-0.5, 0.5, 20, 18000), "LFO", x.linlin(-0.5, 0.5, 0, 15)].postln;
         },
@@ -95,9 +96,9 @@ OSCdef.freeAll;
             );
 
 
-			~ctl.set(10, y.linlin(-0.5, 0.5, 0, 1)); // Reverb dry/wet
-
-			~ctl.set(8, x.linlin(-0.5, 0.5, 0.001, 1.0)); // Delay amount
+			~ctl.set(9, y.linlin(-0.5, 0.5, 0, 0.5)); // Reverb dry/wet
+			~ctl.set(7, x.linlin(-0.5, 0.5, 0.001, 1.0)); // Delay amount
+			~ctl.set(9, 0.8);
 
 
             //["Crayon preset:", "LFO", x.linlin(-0.5, 0.5, 15, 1), "Filter", y.linexp(-0.5, 0.5, 20, 18000)].postln;
@@ -124,7 +125,29 @@ OSCdef.freeAll;
         // Water color - Effect preset 4 (placeholder)
 		"/waterColor", {
             // Apply Preset 4 effects (TBD in documentation)
-            ["Water color preset (TBD)"].postln;
+			if(a >= 0 && a < 0.20){
+					~ctl.set(0, x.linlin(-0.5, 0.5, -60, 20));
+					~ctl.set(1, y.linlin(-0.5, 0.5, -60, 20));
+					["Set:", y.linlin(-0.5, 0.5, -60, 20)].postln;
+			};
+			if( a >= 0.20 && a < 0.40) {
+					~ctl.set(2, x.linlin(-0.5, 0.5, 1, 15));
+					~ctl.set(3, y.linlin(-0.5, 0.5, 0, 1));
+			};
+			if(a >= 0.40 && a < 0.60) {
+					~ctl.set(4, x.linlin(-0.5, 0.5, 0, 1));
+					~ctl.set(5, y.linlin(-0.5, 0.5, 0, 1));
+			};
+			if(a >= 0.60 && a < 0.80) {
+					~ctl.set(6, x.linlin(-0.5, 0.5, 0, 1));
+					~ctl.set(7, y.linlin(-0.5, 0.5, 0, 1));
+			};
+			if(a >= 0.80 && a < 1){
+					~ctl.set(8, x.linlin(-0.5, 0.5, 0, 1));
+					~ctl.set(9, y.linlin(-0.5, 0.5, 0, 1));
+			};
+			["waterColor preset:", a].postln;
+
         }
     );
 };
@@ -204,7 +227,6 @@ OSCdef(\pencilOSC, { |msg, time, addr, port|
 
 	if (penType == 1.0) {
 		~currentPenType = msg[0].asString;
-		~initializePreset1.value;
 		["Current pen type:", ~currentPenType].postln;
 	}
 
@@ -216,7 +238,6 @@ OSCdef(\crayonOSC, { |msg, time, addr, port|
 
 	if (penType == 1.0) {
 		~currentPenType = msg[0].asString;
-		~initializePreset2.value;
 		["Current pen type:", ~currentPenType].postln;
 	}
 
@@ -228,7 +249,6 @@ OSCdef(\fountainPenOSC, { |msg, time, addr, port|
 
 	if (penType == 1.0) {
 		~currentPenType = msg[0].asString;
-		~initializePreset3.value;
 		["Current pen type:", ~currentPenType].postln;
 	}
 
@@ -240,7 +260,6 @@ OSCdef(\waterColorOSC, { |msg, time, addr, port|
 
 	if (penType == 1.0) {
 		~currentPenType = msg[0].asString;
-		~initializePreset4.value;
 		["Current pen type:", ~currentPenType].postln;
 	}
 

+ 3 - 2
SC/5_midi_controller.scd

@@ -7,7 +7,8 @@ MIDIClient.init;
 MIDIIn.connectAll;
 
 
-// Note On: add num to activeNotes and set synth gate to 1
+// Note On: add num to activeNotes and set synth gate to 1[
+
 MIDIdef.noteOn(\noteOn, { |vel, num, chan, src|
     var freq = num.midicps;
 	var index;
@@ -21,7 +22,7 @@ MIDIdef.noteOn(\noteOn, { |vel, num, chan, src|
         if (index.notNil) {
 			~synths[index].set(\gate, 1);
 			~synths[index].set(\freq, freq);
-			~synths[index].set(\amp, vel/127);
+			~synths[index].set(\amp, vel/255);
             ~activeNotes[index] = num; // Map note to synth index
 			~filterEnv.set(\gate, 1);  // Triggers the filter envelope
         } {