FYampaSynth 1.0.0
dotnet add package FYampaSynth --version 1.0.0
NuGet\Install-Package FYampaSynth -Version 1.0.0
<PackageReference Include="FYampaSynth" Version="1.0.0" />
paket add FYampaSynth --version 1.0.0
#r "nuget: FYampaSynth, 1.0.0"
// Install FYampaSynth as a Cake Addin #addin nuget:?package=FYampaSynth&version=1.0.0 // Install FYampaSynth as a Cake Tool #tool nuget:?package=FYampaSynth&version=1.0.0
Modular Synthesizer Programming in F#
Overview
FYampaSynth is a modular music synthesizer in F# that's inspired by Haskell's Yampa and YampaSynth. It is based on the concept of a "signal function", which maps an input signal to an output signal:
type SignalFunction<'a, 'b> = Signal<'a> -> Signal<'b>
Where a "signal" is (conceptually) a function from time to values of some type:
type Signal<'a> = Time -> 'a
Signal functions are first-class objects in Yampa, and can be composed using "arrow" combinators to synthesize music in software.
FYampaSynth uses NAudio to generate sound, and hence is Windows-only.
Examples
A simple sine wave can be generated as follows:
open FYampaSynth
open Arrow
use engine = new AudioEngine()
Synth.oscSine 440.0 // A above middle C
>>^ (*) 0.05 // reduce volume (sine waves are obnoxious!)
|> Synth
|> engine.AddInput
To make a slightly more interesting synthesizer, we can use a sawtooth wave instead and slowly oscillate its frequency:
Synth.oscSine 1.0 // low-frequency control value
>>> Synth.oscSawtooth 440.0
More pleasingly, we can emulate an old Moog synthesizer (via subtractive synthesis), like this:
(Synth.oscSawtooth 440.00
&&& Synth.oscSine 1.0) // note and oscillation
>>> Synth.moogVcf 880.0 0.5 // filter frequencies above 880 hz
Additional references
- Modular Synthesizer Programming in Haskell: Paper describing the original YampaSynth.
- The Yampa Implementation: Practical guide to implementing Yampa.
- Fire and Forget Audio Playback with NAudio
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0-windows7.0 is compatible. net6.0-windows was computed. net7.0-windows was computed. net8.0-windows was computed. |
-
net5.0-windows7.0
- FSharp.Core (>= 5.0.0)
- NAudio (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 345 | 5/2/2021 |