Skip to content

Commit

Permalink
Adapt paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
smimram committed Dec 13, 2024
1 parent 498dc92 commit 2df4b7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions examples/song1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ let s =
let melody = Pattern.append melody [0.,4.,`Nop] in
let melody = Instrument.play (note ~detune:false ~r:0.3 saw) (Pattern.stream ~loop:true tempo melody) in
let melody = bind2 (Filter.first_order () `Low_pass) (B.add (cst 600.) (B.cmul 300. (sine () 10.))) melody in
let melody = B.mul melody (OSC.float "/1/fader2" 1.) in
let melody = bind3 (Filter.biquad () `Low_pass) (OSC.float "/1/fader3" ~min:0.1 ~max:20. 0.5) (OSC.float "/1/fader4" ~max:10000. 10000.) melody in
let melody = B.mul melody (OSC.float "/oscControl/fader2" 1.) in
let melody = bind3 (Filter.biquad () `Low_pass) (OSC.float "/oscControl/fader3" ~min:0.1 ~max:20. 0.5) (OSC.float "/oscControl/fader4" ~max:10000. 10000.) melody in
let melody = melody >>= Stereo.of_mono in
let melody = melody >>= Stereo.dephase () 0.01 in
let vs = 0.7 in
let synth1 = Pattern.repeat 16 [0., 0.25, `Chord ([65;69;72],vs); 0.25, 0.25, `Nop] in
let synth2 = Pattern.repeat 16 [0., 0.25, `Chord ([64;69;72],vs); 0.25, 0.25, `Nop] in
let synth = Pattern.append synth1 synth2 in
let synth = Instrument.play (note karplus_strong) (Pattern.stream ~loop:true tempo synth) in
(* (\* let disto = add (cst (-1.)) (cmul 2. (OSC.float "/1/fader4" 0.5)) in *\) *)
(* (\* let disto = add (cst (-1.)) (cmul 2. (OSC.float "/oscControl/fader4" 0.5)) in *\) *)
(* (\* let synth = bind2 disto synth (distortion ~dt) in *\) *)
let synth = B.mul (OSC.float "/1/fader1" 0.5) synth in
let synth = B.mul (OSC.float "/oscControl/fader1" 0.5) synth in
let synth = synth >>= flanger () ~wet:0.8 0.001 (Note.duration tempo 1.) in
let vb = 1.1 in
let bass = [0.,16.,`Nop;0.,3.,`Note (41, vb);4.,3.,`Note (38, vb);8.,3.,`Note (45, vb);12.,3.,`Note (45, vb)] in
Expand All @@ -53,7 +53,7 @@ let s =
(* (\* let s = s >>= slicer ~dt 0.01 in *\) *)
let s = s >>= Stereo.of_mono in
(* (\* let deph = let deph = Stereo.dephase ~dt 0.1 in fun d x -> deph ~delay:d x in *\) *)
(* (\* let s = bind2 (sub (cmul 0.1 (OSC.float "/1/fader5" 0.51)) (cst 0.05)) s deph in *\) *)
(* (\* let s = bind2 (sub (cmul 0.1 (OSC.float "/oscControl/fader5" 0.51)) (cst 0.05)) s deph in *\) *)
let s = Stereo.add s (bass >>= Stereo.of_mono >>= Stereo.dephase () (-0.02)) in
let s = Stereo.add s (snare >>= Stereo.of_mono >>= Stereo.dephase () (-0.01)) in
let s = Stereo.add s (kick >>= Stereo.of_mono) in
Expand Down
14 changes: 7 additions & 7 deletions examples/song2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ let s =
B.cmul 0.5 (B.add (square (freq *. 1.007)) (saw freq))
in
let synth = Instrument.play (Note.simple sound) (Pattern.stream ~loop:true tempo synth) in
let lp_q = OSC.float "/1/fader1" ~min:0.1 ~max:5. 1. in
let lp_freq = OSC.float ~mode:`Logarithmic "/1/fader2" ~max:10000. 1500. in
let lp_q = OSC.float "/oscControl/slider1" ~min:0.1 ~max:5. 1. in
let lp_freq = OSC.float ~mode:`Logarithmic "/oscControl/slider2" ~max:10000. 1500. in
(* let lp_freq = lp_freq >>= print ~every:22000 "freq" in *)
let slicer = Slicer.staccato () ~s:0.5 in
let slicer lp_q lp_freq = slicer ~lp_q ~lp_freq (Note.duration tempo 0.5) in
let synth = bind3 slicer lp_q lp_freq synth in
let synth = B.cmul 0.2 synth in
(* let synth = *)
(* let flanger = flanger ~dt 0.01 in *)
(* bind2 (fun wet -> flanger ~wet (1. /. Note.duration tempo 4.)) (OSC.float "/1/fader2" ~max:0.8 0.1) synth *)
(* bind2 (fun wet -> flanger ~wet (1. /. Note.duration tempo 4.)) (OSC.float "/oscControl/slider2" ~max:0.8 0.1) synth *)
(* in *)
(* let synth = bind3 (Filter.biquad ~dt `High_pass) (OSC.float "/1/fader3" ~min:0.01 ~max:5. 1.) (OSC.float ~mode:`Logarithmic "/1/fader4" ~max:10000. 1500.) synth in *)
(* let synth = bind3 (Filter.biquad ~dt `High_pass) (OSC.float "/oscControl/slider3" ~min:0.01 ~max:5. 1.) (OSC.float ~mode:`Logarithmic "/oscControl/slider4" ~max:10000. 1500.) synth in *)
(* let synth = synth >>= Distortion.convolver ~dt 0.4 in *)
let synth = synth >>= stereo in
(* let synth = let d = Note.duration tempo 0.5 in synth >>= Stereo.delay ~dt d ~feedback:0.1 ~ping_pong:d in *)
let synth = synth >>= Stereo.dephase () 0.01 in
let synth = Stereo.bmul (OSC.bool "/1/toggle1" true) synth in
let synth = Stereo.bmul (OSC.bool "/oscControl/toggle1" true) synth in
let bass = [72;71;69;67] in
let bass = List.map (fun n -> Pattern.repeat 4 [0.,2.,`Nop; 0.,0.5,`Note (n,1.); 0.5,0.5,`Note (n,1.)]) bass in
let bass = Pattern.concat bass in
Expand All @@ -42,11 +42,11 @@ let s =
(* let kick = Instrument.kick ~dt ~vol:1. tempo >>= stereo in *)
let pd = Instrument.play_drums ~snare:(fun ~on_die _ vol -> B.cmul vol (Note.Drum.snare ~on_die ~lp:2000. ())) in
let drums = pd (Pattern.midi_drums ~loop:true tempo (Pattern.load_drums "c1.drums")) >>= stereo in
let drums = Stereo.bmul (OSC.bool "/1/toggle2" true) drums in
let drums = Stereo.bmul (OSC.bool "/oscControl/toggle2" true) drums in
let s = Stereo.mix [synth;drums;bass] in
(* let s = s >>= Stereo.map (agc ~dt ()) (agc ~dt ()) in *)
Stereo.cmul 0.6 s

let () =
OSC.server 8000;
OSC.server 10000;
Output.play s

0 comments on commit 2df4b7c

Please sign in to comment.