Changeset 6700
- Timestamp:
- 06/30/09 09:17:25 (9 months ago)
- Location:
- trunk/liquidsoap/src/synth
- Files:
-
- 2 modified
-
synth.ml (modified) (1 diff)
-
synth_op.ml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/liquidsoap/src/synth/synth.ml
r6698 r6700 92 92 93 93 class square = object inherit simple (fun x -> let x = fst (modf x) in if x < 0.5 then 1. else -1.) end 94 95 class saw = 96 object 97 inherit simple 98 (fun x -> 99 let x = fst (modf x) in 100 if x < 0.5 then 101 4. *. x -. 1. 102 else 103 4. *. (1. -. x) -. 1. 104 ) 105 as super 106 107 method note_init n v = { (super#note_init n v) with simple_phase = 0.25 } 108 end -
trunk/liquidsoap/src/synth/synth_op.ml
r6696 r6700 81 81 let src = Lang.to_source (f "") in 82 82 new synth (new Synth.square :> Synth.synth) src 0) 83 84 let () = 85 Lang.add_operator "synth.saw" 86 [ "", Lang.source_t, None, None ] 87 ~category:Lang.SoundSynthesis 88 ~descr:"Saw synthesiser." 89 (fun p _ -> 90 let f v = List.assoc v p in 91 let src = Lang.to_source (f "") in 92 new synth (new Synth.saw :> Synth.synth) src 0)
