feat: sinewaveshaper

This commit is contained in:
HiveBeats
2022-10-31 09:58:49 +04:00
parent c09dc75f76
commit df6a6da423
2 changed files with 11 additions and 5 deletions

View File

@@ -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

View File

@@ -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