{"id":17694182,"url":"https://github.com/vmagnin/forsynth","last_synced_at":"2026-01-29T21:32:14.474Z","repository":{"id":53124423,"uuid":"340489838","full_name":"vmagnin/forsynth","owner":"vmagnin","description":"A Fortran synthesizer library to explore sound synthesis, sound effects, acoustics, electronic music, algorithmic music, etc. Humbly follow the steps of Stockhausen, Kraftwerk and the Daft Punk!","archived":false,"fork":false,"pushed_at":"2025-04-01T17:47:32.000Z","size":4326,"stargazers_count":25,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-10T03:39:41.281Z","etag":null,"topics":["fortran","fortran-package-manager","music","sound","synthesis","synthesizer"],"latest_commit_sha":null,"homepage":"https://vmagnin.github.io/forsynth/","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmagnin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-19T21:07:16.000Z","updated_at":"2025-04-01T17:46:51.000Z","dependencies_parsed_at":"2024-06-26T23:44:25.589Z","dependency_job_id":"9ed4dae2-5f9f-4337-93ff-efbcd9197f07","html_url":"https://github.com/vmagnin/forsynth","commit_stats":{"total_commits":71,"total_committers":2,"mean_commits":35.5,"dds":"0.014084507042253502","last_synced_commit":"dd2de104d485f6844e95ca7db54630254cd2b177"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/vmagnin/forsynth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmagnin%2Fforsynth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmagnin%2Fforsynth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmagnin%2Fforsynth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmagnin%2Fforsynth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmagnin","download_url":"https://codeload.github.com/vmagnin/forsynth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmagnin%2Fforsynth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28885563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran","fortran-package-manager","music","sound","synthesis","synthesizer"],"created_at":"2024-10-24T13:48:05.231Z","updated_at":"2026-01-29T21:32:14.456Z","avatar_url":"https://github.com/vmagnin.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](logo/logo_forsynth.svg)\n\nA small Fortran synthesizer to explore sound synthesis, sound effects, electronic music, algorithmic music, etc. But ForSynth can also be used for scientific data *sonification*, for acoustic simulations or for teaching programming in a fun way.\n\nHumbly follow the steps of Stockhausen, Kraftwerk and the Daft Punk (see the [ELECTRONIC_MUSIC_HISTORY.md](./ELECTRONIC_MUSIC_HISTORY.md) file).\n\n## Features\n\n* ForSynth is a semi-analog semi-digital 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 after the final mixing, when generating the output WAV file.\n* You can use as many stereo tracks as you need. The track 0 is used for the final mix and some algorithms also use it as an auxilliary track. Do you know The Beatles used a 8 tracks tape recorder the first time in August 1968 to record *Hey Jude*? The second song was *Dear Prudence*.\n* Basic music theory elements (scales, circle of fifths, chords...).\n* Various signals, Karplus-Strong algorithms (guitar and drums), bells.\n* Envelopes generators: ADSR, fade in, fade out, exponentially decreasing envelope.\n* Audio effects: delay, fuzz, tremolo, reverse, autopan, basic dynamic effects (compressor/expander/limiter).\n* Data sonification routines and command.\n* Morse code support.\n* Final mixing with the level and panoramic of each track.\n* The API is documented with FORD: https://vmagnin.github.io/forsynth/\n* Various examples.\n* You just need a modern Fortran compiler and a media player, whatever your OS.\n* GPL-3.0-or-later license.\n\nIf you are more interested by composing than sound synthesis, you may also be interested by its twin project [ForMIDI](https://github.com/vmagnin/formidi).\n\n\n## Compilation and execution\n\nYou can easily build the project using the Fortran Package Manager fpm (https://github.com/fortran-lang/fpm) at the root of the project directory:\n```\n$ fpm build\n```\n\nOr if you don't have fpm, you can use the `build.sh` script (the examples will be built inside the `build/` directory).\n\n## Installation\n\nYou can install the library in your system with:\n\n```bash\n$ fpm install\n```\n\nIn a Unix-like system, it will be typically installed in the `.local/lib` directory\nof your `home/`.\n\n\n### Running the examples\nThe examples can be found in the `example/` directory. For example, the `chords_and_melody.f90` example can be run with the command:\n\n```bash\n$ fpm run --example chords_and_melody\n```\n\nBut you can also use the optimization flags of your compiler, for example with GFortran:\n```shell\n$ fpm run --example chords_and_melody --flag \"-Ofast -static-libgfortran\"\n```\n\nA WAV file was generated in the root directory of the project:\n\n```bash\n$ file chords_and_melody.wav\nchords_and_melody.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz\n$ hexdump -C chords_and_melody.wav\n00000000  52 49 46 46 a4 ff 42 01  57 41 56 45 66 6d 74 20  |RIFF..B.WAVEfmt |\n00000010  10 00 00 00 01 00 02 00  44 ac 00 00 10 b1 02 00  |........D.......|\n00000020  04 00 10 00 64 61 74 61  80 ff 42 01 3d 0e 3d 0e  |....data..B.=.=.|\n00000030  56 03 56 03 d4 f5 d4 f5  9d 0e 9d 0e 91 f6 91 f6  |V.V.............|\n...\n```\n\nYou can listen to your WAV using any media player, for example the SoX play command (or the ALSA command `aplay`):\n\n```bash\n$ play chords_and_melody.wav\n\nchords_and_melody.wav:\n\n File Size: 21.2M     Bit Rate: 1.41M\n  Encoding: Signed PCM\n  Channels: 2 @ 16-bit\nSamplerate: 44100Hz\nReplaygain: off\n  Duration: 00:02:00.00\n\nIn:2.32% 00:00:02.79 [00:01:57.21] Out:123k  [!=====|=====!] Hd:0.0 Clip:0\n```\n\nYou can also use [Audacity](https://www.audacityteam.org/) or [Sonic Visualiser](https://sonicvisualiser.org/) to visualise your music, either as a waveform or a spectrogram.\n\n\n## Contributing\n\n* Post a message in the GitHub *Issues* tab to discuss the function you want to work on.\n* Follow the coding conventions of the project.\n* When ready, make a *Pull Request*.\n\n## Technical information\n\n### Endianness\n\nA 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.\n\n* https://fortran-lang.discourse.group/t/writing-a-binary-file-in-little-endian/719/4\n* https://en.wikipedia.org/wiki/Endianness\n\n### WAV / RIFF format\n\n* https://en.wikipedia.org/wiki/Resource_Interchange_File_Format\n* https://en.wikipedia.org/wiki/WAV\n* http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html\n\n### Sound synthesis\n\n* https://sites.google.com/site/learning4synthesizer/home\n* https://en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_synthesis\n\n### Miscellaneous\n\n* https://en.wikipedia.org/wiki/Morse_code\n* https://en.wikipedia.org/wiki/Sonification\n* [Risset's bell modelling](http://www.alainbonardi.net/songes/modelisation_eng.htm)\n\n## Bibliography\n### English\n\n* Jean-Claude Risset, [\"Computer music: why ?\"](https://www.posgrado.unam.mx/musica/lecturas/tecnologia/optativasRecomendadas/Risset_ComputerMusic%20why.pdf), 2003.\n* Jean-Claude Risset, [*An Introductory Catalogue Of Computer Synthesized Sounds*](https://archive.org/details/an-introductory-catalogue-of-computer-synthesized-sounds/mode/2up), Bell Telephone Laboratories Murray Hill, New Jersey, 1969.\n* Peter Kirn, [Jean-Claude Risset, who reimagined digital synthesis, has died](https://cdm.link/jean-claude-risset-reimagined-digital-sound-europe-abroad/), November 22, 2016.\n* Dave Benson, *[Music - A Mathematical Offering](https://homepages.abdn.ac.uk/d.j.benson/pages/html/music.pdf)*, 531 pages, 2008.\n* Jeffrey Hass, [*Introduction to Computer Music - An Electronic Textbook*](https://cmtext.indiana.edu/index.php), Jacobs School of Music, Indiana University, 2023.\n* David A. Jaffe and Julius O. Smith, “Extensions of the Karplus-Strong Plucked-String Algorithm.” *Computer Music Journal* 7, no. 2 (1983): 56. https://doi.org/10.2307/3680063.\n* Kevin Karplus and Alex Strong, “Digital Synthesis of Plucked-String and Drum Timbres.” *Computer Music Journal* 7, no. 2 (1983): 43–55. https://doi.org/10.2307/3680062.\n* Jarmo Lähdevaara, *Science of Electric Guitars and Guitar Electronics.* Helsinki, Finland: Books On Demand, 2012.\n* Diana Deutsch, \"The Paradox of Pitch Circularity\"’. *Acoustics Today* 6, no. 3 (July 2010): 8–14. https://doi.org/10.1121/1.3488670.\n* M.V. Mathews, [\"The Digital Computer as a Musical Instrument\"](http://www.jstor.org/stable/1712380), *Science* 142, no. 3592 (1963): 553–57.\n    * [\"The First Computer Musician\"](https://archive.nytimes.com/opinionator.blogs.nytimes.com/2011/06/08/the-first-computer-musician/), by R. Luke DuBois, NYT, June 8, 2011.\n* M.V. Mathews, F.R. Moore and J.-C. Risset, [\"Computers and Future Music\"](https://www.jstor.org/stable/1737597), *Science,* New Series, Vol. 183, No. 4122 (Jan. 25, 1974), pp. 263-268.\n* Mathews, Max V., [The Technology of Computer Music](https://www.cityfreqs.com.au/papers/The_Technology_of_Computer_Music.pdf). 4th print. Cambridge, Mass.: MIT Pr., 1979.\n* Miguel Carvalho, Vincent Debut and Jose Antunes, \"Physical Modelling Techniques for the Dynamical Characterization and Sound Synthesis of Historical Bells\", *Heritage Science* (2021) 9:157, https://doi.org/10.1186/s40494-021-00620-2.\n\n### French\n* Vincent Magnin, [\"Format WAV : créez des ondes sonores en C\"](https://connect.ed-diamond.com/GNU-Linux-Magazine/GLMF-190/Format-WAV-creez-des-ondes-sonores-en-C), *GNU/Linux Magazine* n°190, février 2016.\n* Vincent Magnin, [\"Format WAV : des sons de plus en plus complexes\"](https://connect.ed-diamond.com/GNU-Linux-Magazine/GLMF-190/Format-WAV-des-sons-de-plus-en-plus-complexes), *GNU/Linux Magazine* n°190, février 2016.\n* Some sounds created with the C version of the program: http://magnin.plil.net/spip.php?article131\n* Laurent de Wilde, [*Les fous du son - D'Edison à nos jours*](https://www.grasset.fr/livres/les-fous-du-son-9782246859277), Editions Grasset et Fasquelle, 560 pages, 2016, ISBN 9782246859277.\n* Laurent Fichet, [*Les théories scientifiques de la musique aux XIXe et XXe siècles*](https://www.vrin.fr/livre/9782711642847/les-theories-scientifiques-de-la-musique), Vrin, 1996, ISBN 978-2-7116-4284-7.\n* Guillaume Kosmicki , [*Musiques électroniques - Des avant-gardes aux dance floors*](https://lemotetlereste.com/musiques/musiqueselectroniquesnouvelleedition/), Editions Le mot et le reste, 2nd edition, 2016, 416 p., ISBN 9782360541928.\n* Olivier Pernot, [*ELECTRO 100 - Les albums essentiels des musiques électroniques*](https://lemotetlereste.com/musiques/electro100nouvelleedition/), Editions Le mot et le reste, 2016, 240 p., ISBN 978-2-36054-202-4.\n* Bibliothèque Tangente n°11, [*Mathématiques et musique - des destinées parallèles*](https://www.lalibrairie.com/livres/mathematiques-et-musique--des-destinees-paralleles--2022_0-9115242_9782848842462.html), Paris : Éditions POLE, septembre 2022, ISBN 9782848842462.\n* Blog [Devenir Ingeson](https://deveniringeson.com/public/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmagnin%2Fforsynth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmagnin%2Fforsynth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmagnin%2Fforsynth/lists"}