diff --git a/Classes/BuboBoot.sc b/Classes/BuboBoot.sc index 6e306ff..d82c163 100644 --- a/Classes/BuboBoot.sc +++ b/Classes/BuboBoot.sc @@ -105,10 +105,10 @@ Boot { Event.addEventType(\buboEvent, { arg server; - if (BuboUtils.stringIsNumber(~sp), {}, { - ~sp = BuboUtils.cleanSampleName(~sp); - ~nb = BuboUtils.cleanSampleIndex(~nb); - if (~sp.notNil && ~nb.notNil, { + if (~sp.notNil, { + if (BuboUtils.stringIsNumber(~sp), {}, { + ~sp = BuboUtils.cleanSampleName(~sp); + ~nb = BuboUtils.cleanSampleIndex(~nb); if (~sp !== "", { ~buf = Bank(~sp)[~nb % Bank(~sp).paths.size]; if (Bank(~sp).metadata[~nb % Bank(~sp).size][\numChannels] == 1) { @@ -116,7 +116,7 @@ Boot { } { ~instrument = \splayer; }; - }) + }); }); }); ~type = \note; diff --git a/Classes/BuboEvents.sc b/Classes/BuboEvents.sc new file mode 100644 index 0000000..b9e8108 --- /dev/null +++ b/Classes/BuboEvents.sc @@ -0,0 +1,3 @@ +BuboEvents { + +} diff --git a/Classes/BuboUtils.sc b/Classes/BuboUtils.sc index 5f26f9c..018dd9f 100644 --- a/Classes/BuboUtils.sc +++ b/Classes/BuboUtils.sc @@ -25,7 +25,7 @@ BuboUtils { *stringIsNumber { arg string; - if (string == nil, { ^true }); + if (string == nil || string == "", { ^false }); string = string.asList.collect({arg char; char.ascii}); string = (48..57).includesAll(string); ^string diff --git a/Classes/Configuration/Startup.scd b/Classes/Configuration/Startup.scd index 51f56bf..49be4b5 100644 --- a/Classes/Configuration/Startup.scd +++ b/Classes/Configuration/Startup.scd @@ -1,6 +1,5 @@ // Setting up MIDI for hardware performances "Initialising MIDI...".postln; -MIDIClient.init; p = currentEnvironment; c = currentEnvironment.clock; diff --git a/Classes/Configuration/Synthdefs.scd b/Classes/Configuration/Synthdefs.scd index 88269da..2927902 100644 --- a/Classes/Configuration/Synthdefs.scd +++ b/Classes/Configuration/Synthdefs.scd @@ -271,26 +271,25 @@ d.list = { arg obj; obj.keys.do({arg i; i.postln}); }; d.tides = z; ); -( - z = SynthDef('pink', { - arg out; - var pink = PinkTrombone.ar( - noiseSource: BPF.ar(WhiteNoise.ar(), \noiseFilter.kr(2000)), - freq: \freq.kr(800), - tenseness: \tenseness.kr(0.4), - tongueIndex: \tongueIndex.kr(30), - tongueDiameter: \tongueDiameter.kr(3.5), - constrictionX: \constrictionX.kr(1.5), - constrictionY: \constrictionY.kr(2.5), - fricativeIntens: \fricativeIntens.kr(1.5) - ); - var env = Env.perc(\attack.kr(0.01), releaseTime: \release.kr(2.0)).kr(doneAction: 2); - var sound = pink * env; - OffsetOut.ar(out, Pan2.ar(sound, pos: \pan.kr(0.0))) - }).add; - d.pink = z; -); - +// ( +// z = SynthDef('pink', { +// arg out; +// var pink = PinkTrombone.ar( +// noiseSource: BPF.ar(WhiteNoise.ar(), \noiseFilter.kr(2000)), +// freq: \freq.kr(800), +// tenseness: \tenseness.kr(0.4), +// tongueIndex: \tongueIndex.kr(30), +// tongueDiameter: \tongueDiameter.kr(3.5), +// constrictionX: \constrictionX.kr(1.5), +// constrictionY: \constrictionY.kr(2.5), +// fricativeIntens: \fricativeIntens.kr(1.5) +// ); +// var env = Env.perc(\attack.kr(0.01), releaseTime: \release.kr(2.0)).kr(doneAction: 2); +// var sound = pink * env; +// OffsetOut.ar(out, Pan2.ar(sound, pos: \pan.kr(0.0))) +// }).add; +// d.pink = z; +// ); ( z = SynthDef('kick', { diff --git a/Classes/EventShortener.sc b/Classes/EventShortener.sc index d7473fa..ac63085 100644 --- a/Classes/EventShortener.sc +++ b/Classes/EventShortener.sc @@ -67,18 +67,16 @@ EventShortener { }); }); ]; + new_pattern = new_pattern ++ [ + sp: Pfunc { |e| e.str ? "" }, + nb: Pfunc { |e| e.num ? 0 } + ]; }, { new_pattern = new_pattern ++ [a, b]; }); }); }); - - if (pattern.includes('i') || pattern.includes('instrument') == false, { - new_pattern = new_pattern ++ [ - sp: Pfunc { |e| e.str ? "" }, - nb: Pfunc { |e| e.num ? 0 } - ]; - }); + new_pattern.postln; ^new_pattern } diff --git a/dev_sessions/chasing_bugs.scd b/dev_sessions/chasing_bugs.scd new file mode 100644 index 0000000..51cd9ac --- /dev/null +++ b/dev_sessions/chasing_bugs.scd @@ -0,0 +1,27 @@ +( +Boot(samplePath: "/Users/bubo/.config/livecoding/samples"); +) + +// TEST: [X] ça passe +( +~basic => [pat: "kick snare"]; +~basic.play; + +~hat => [pat: "hat:2 hat:4!3"]; +~hat.play; +) + +// TEST: [X] ça passe +( +~basic => [ + sp: "kick", + nb: [0, 2, 3].pseq(inf), +]; +~basic.play; +) + +( +~hat => [sp: "hat", dur: 1/2, nb: [0, 2, 3].pseq(inf)]; +~hat.play; +) +