GithubHelp home page GithubHelp logo

aslozada / forsynth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vmagnin/forsynth

2.0 0.0 0.0 90 KB

A small Fortran synthesizer to explore sound synthesis, sound effects, electronic music, algorithmic music, etc. Humbly follow the steps of Stockhausen, Kraftwerk and the Daft Punk!

License: GNU General Public License v3.0

Fortran 98.43% Shell 1.57%

forsynth's Introduction

Forsynth

A small Fortran synthesizer to explore sound synthesis, sound effects, electronic music, algorithmic music, etc. Humbly follow the steps of Stockhausen, Kraftwerk and the Daft Punk!

But Forsynth could also be used for data sonification: https://fortran-lang.discourse.group/t/anecdotal-fortran/704/8 or to teach programming in a fun way!

Features

  • By default, you have 8 stereo tracks. In fact 7 because the track 0 is used for the final mix. It takes 169 Mio in RAM for a two minutes duration. You can of course modify those parameters. Do you know The Beatles used 8 tracks the first time in August 1968 to record Hey Jude? The second song was Dear Prudence.
  • Forsynth is a semi-analog studio: time is discretized (44100 samples/s) but the amplitude is coded as a Fortran real and digitized as a 16 bits signed integer only when generating the output WAV file.
  • You need only a modern Fortran compiler and a media player, whatever your OS.
  • GNU GPLv3 license.

Compilation and execution

You can easily build and run the project using the Fortran Package Manager fpm (https://github.com/fortran-lang/fpm) at the root of the project directory:

$ fpm build
$ fpm run

Or you can also use the build.sh script if you don't have fpm installed.

A WAV file was generated in the same directory, for example demo1.wav:

$ file demo1.wav
demo1.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz

You can then listen to your WAV using any media player, for example the SoX play command (or the ALSA command aplay):

$ play demo1.wav

demo1.wav:

 File Size: 21.2M     Bit Rate: 1.41M
  Encoding: Signed PCM
  Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
  Duration: 00:02:00.00

In:2.32% 00:00:02.79 [00:01:57.21] Out:123k  [!=====|=====!] Hd:0.0 Clip:0

You can also use Audacity or Sonic Visualiser to visualise your music, either as a waveform or a spectrogram.

Contributing

Technical information

Endianness

A WAV comprises a header with metadata then the soundtracks in PCM (https://en.wikipedia.org/wiki/Pulse-code_modulation), written in little endian. This program asserts your machine is little endian. If you are big endian, please use the -fconvert=big-endian flag with gfortran, or -convert big_endian with ifort. Or contribute to the code to allow an automatic detection of endianness.

WAV / RIFF format

Sound synthesis

Bibliography

English

French

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.