Skip to content

RomainNicolaon/ALGOSUP_2022_Project_3_F

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project-3-Sound-Synthesizer

FSharpSyntheLibrary is a simple cross-platform(windows, mac) library multimedia. It is writtent in F# so you can use it in .NET core.

Authors

  • Eloi Priol
  • Elise Gautier
  • Robin Debry
  • Theo Trouvé
  • Romain Nicolaon
  • Thomas Planchard

Download

For the moment you can't download it because it's an alpha version but for the future you are will able to download it with 2 different nuggets. One advanced and one simple

Learn

To learn FSharpSynthe you can follow the tutorial

Code Example

You can run these examples in F# in Visual Studio. Make sure you build the project first. After that, simply copy and paste the code over in each of the following code examples. If you want to see the wave of each song. Download Audacity on this link : https://audacity.fr/ and put the file create by the code in Audacity to see the wave.

Create the 4 basic wave forms and save it in a file

  • Generate a .wav file containing a sawtooth wave or a sinus wave or a triangular wave or a square wave play in mono. Each wave last 1 second with a frequency of 523. and an amplitude of 0.8
open FSharpSynth.CreateWaveFile
open FSharpSynth.CreateWave


write "saw" sawtoothWave 1. 523. 0.8 
write "sine" sinusWave 1. 523. 0.8 
write "triangle" triangleWave 1. 523. 0.8 
write "square" squareWave 1. 523. 0.8 

Play an audio file

  • Play a audio file just by giving the path to the file
open FSharpSynthe.PlaySound

PlaySound "saw.wav"

Change amplitude with a fixe amount

  • Modify a wave amplitude with a fixe amount
open FSharpSynthe.Filter

amplitude (wave:list<float>) (amp:float)

Add echo to a song

  • Apply directly a echo to a song if you want to see what happen on the wave put your audio file on Audacity. You can change the delay , and the amplitude of your echo.
open FSharpSynth.Filter

createEcho (delay : float) (wave : list<float>) (amp : float)

Add Chords effect

  • Apply directly a chords effect with 2 waves different.
open FSharpSynth.Filter

chords  (wave: list<float>)  (wave2: list<float>)

Add overdriven effect

  • Aplly an overdriven effect to a wave. You can setup your overdriven.
open FSharpSynth.Filter

overdriven (wave: list<float>) (overdriven: float)

Add flanger effect

  • Apply a flanger effect to a wave
open FSharpSynth.Filter

flanger (wave: list<float>)

add reverb effect

  • Apply a reverb effect to a wave
open FSharpSynth.Filter

reverb (wave: list<float>)

add Amplitude Modulation with Low Frequency Oscillator

  • Apply an amplitude modulation to a wave of any form thanks to another wave of any form with a frequency between 1-20 Hertz.
open FSharpSynth.Filter

sinusWave (time:float) (wave:list<float) (ampLFO:float) (freqLFO:float)
TriangleWave (time:float) (wave:list<float) (ampLFO:float) (freqLFO:float)
sawtoothWave (time:float) (wave:list<float) (ampLFO:float) (freqLFO:float)
SquareWave (time:float) (wave:list<float) (ampLFO:float) (freqLFO:float)