diff --git a/SoundGen/Fx.fs b/SoundGen/Fx.fs index bddbaea..aed3846 100644 --- a/SoundGen/Fx.fs +++ b/SoundGen/Fx.fs @@ -9,6 +9,9 @@ type Saturator = { Gain: float } let saturate (param: Saturator, x: float) = tanh (param.Gain * x) +let sineWaveShape x = + x + 2.8 * sin (2. * x) + // // let process(effects:Effect list, sound:float seq) = // let mutable output = sound diff --git a/SoundGen/Program.fs b/SoundGen/Program.fs index c046707..892aec9 100644 --- a/SoundGen/Program.fs +++ b/SoundGen/Program.fs @@ -1,8 +1,8 @@ - -open System.IO +open System.IO open SoundGen open PCMWave open Fx +open SoundGen.Fx open Synth let song = @@ -54,6 +54,9 @@ let writeToFile (ms: MemoryStream) = ms.WriteTo(fs) -song |> createWAV |> writeToFile - - +song +|> Seq.map (fun x -> + let x1 = sineWaveShape x + saturate ({ Gain = 1.0 }, x1)) +|> createWAV +|> writeToFile