{"id":15540260,"url":"https://github.com/rm-hull/sound-flour","last_synced_at":"2025-06-18T14:34:15.621Z","repository":{"id":145431065,"uuid":"10883122","full_name":"rm-hull/sound-flour","owner":"rm-hull","description":"An experiment in collaborative broadcast streaming computer-generated music, in Clojure","archived":false,"fork":false,"pushed_at":"2018-10-06T11:36:55.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-03T12:17:40.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rm-hull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-23T11:24:21.000Z","updated_at":"2018-12-12T15:47:36.000Z","dependencies_parsed_at":"2023-06-03T18:15:32.332Z","dependency_job_id":null,"html_url":"https://github.com/rm-hull/sound-flour","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rm-hull/sound-flour","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fsound-flour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fsound-flour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fsound-flour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fsound-flour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rm-hull","download_url":"https://codeload.github.com/rm-hull/sound-flour/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rm-hull%2Fsound-flour/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260570563,"owners_count":23029720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-02T12:13:23.184Z","updated_at":"2025-06-18T14:34:10.589Z","avatar_url":"https://github.com/rm-hull.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sound-Flour \n[![Build Status](https://secure.travis-ci.org/rm-hull/sound-flour.svg)](http://travis-ci.org/rm-hull/sound-flour) \n[![Coverage Status](https://coveralls.io/repos/rm-hull/sound-flour/badge.svg?branch=master)](https://coveralls.io/r/rm-hull/sound-flour?branch=master) \n[![Dependencies Status](https://versions.deps.co/rm-hull/sound-flour/status.svg)](https://versions.deps.co/rm-hull/sound-flour)\n[![Maintenance](https://img.shields.io/maintenance/yes/2018.svg?maxAge=2592000)]()\n\n\u003e **NOTE:** This project is undergoing significant rework\n\nSound-flour is:\n\n* my 2013 [Lisp in Summer Projects](http://lispinsummerprojects.org/) submission,\n* written in clojure \u0026 clojurescript,\n* uses HTML5's web audio API,\n* an experiment in collaborative broadcast streaming computer-generated music,\n* hosted in heroku: http://sound-flour.destructuring-bind.org,\n* nothing more than an idea in my head (at the moment),\n* is randomly documented in this readme,\n* subject to change,\n* a tragic pun on http://pouet.net/nfo.php?which=57115 ...\n* ... but will probably end up more like https://www.youtube.com/watch?v=3zoTKXXNQIU\n\n# Background\n\nWatching https://www.youtube.com/watch?v=GtQdIYUtAHg and subsequently trying it\nblew me away somehow.\n\nThe fact that a simple C program fragment like:\n\n```c\n(t*(t\u003e\u003e5|t\u003e\u003e8))\u003e\u003e(t\u003e\u003e16)\n```\n\nor\n\n```c\n(t%(t/(t\u003e\u003e9|t\u003e\u003e13)))\n```\n\ncan produce an audio wave that, although arguably isn't music in the\nconventional sense, produces something that is rhythmic, fanciful and\ninterestingly rich, but somehow intensely annoying. Its not white\nnoise by any stretch, as you can discern repeating structure amongst\nthe chaos: nevertheless, it is addictive to hang on (and on) waiting\nfor a fleeting moment of melody to only to melt away almost before it\nit happened.\n\n## The Proposition\n\nSo it's easy to write a program to generate random sound, right? This pretty\nmuch nails it here: http://wurstcaptures.untergrund.net/music/, so maybe we\nshould pack up now and go home.\n\nWell... while that's pretty good, its a bit low-level, and you can only have\n_so_ much fun munging bits all day. We want something more... social... gamific...\nWe have a [clojure sandbox](https://github.com/Licenser/clj-sandbox),\nso lets allow gists (or listen in on tweets) to provide some clojure SEXPs to\ngenerate some interesting stream data.\n\nIn theory, we could generate something altogether a bit smoother maybe:\n\n```clojure\n(def buffer-len 8000)\n\n(def sample-rate 8000)\n\n(defn sine-wave [frequency amplitude]\n  (let [data (-\u003e\u003e\n                (range buffer-len)\n                (map #(* amplitude (Math/sin (/ (* 2 Math/PI % frequency) sample-rate))))\n                (into []))]\n    (fn [t] (data (mod t buffer-len)))))\n\n(sine-wave 440 0.5) ; 440 Hz = Middle C\n```\nWhich returns a function that driven with a sampling tick, returns a value in\nthe range ±1.0 that when streamed out, would approximate middle C.\n\nA sine wave on its own is pretty boring; it only _becomes_ interesting when it\ncan be composed with other functions,\nc.f. [Functional Composition by Chris Ford](http://www.youtube.com/watch?v=Mfsnlbd-4xQ),\nso perhaps we can build on top of this basic function, perhaps there should be multiple\nchannels that get mixed before being streamed, maybe there should be stereo output, ...\n\n## What this project actually is\n\nA web framework, in clojure, for processing gists (also in clojure) in which\na nominated function translates an ever increating time-quantum in some musically\ninteresting way, mixes it with other gists' functions, collects the resultant data\ninto a stream, encodes to a WAV before chunking and broadcasting to anyone who may be\nlistening. And, as time permits, to include some real-time visualization of broadcast\naudio data.\n\n## What will make it work?\n\nI see it working at three levels:\n\n* Framework + nothing = something not interesting\n\n* Framework + my gists = something possibly interesting\n\n* Framework + YOUR gists = something _really_ interesting\n\n## So why shouldn't I just use Overtone?\n\nYou probably should, and I may end up doing so too...\n\n## Examples\n\nTODO\n\n## Inspiration\n\nIn no particular order, ideas borrowed heavily from:\n\n* https://www.youtube.com/watch?v=Pgw_nVqSTLw\n* https://www.youtube.com/watch?v=GtQdIYUtAHg\n* https://www.youtube.com/watch?v=tCRPUv8V22o\n* http://www.youtube.com/watch?v=Mfsnlbd-4xQ\n* http://wurstcaptures.untergrund.net/music/\n* http://greweb.me/2012/08/zound-a-playframework-2-audio-streaming-experiment-using-iteratees/\n* http://devslovebacon.com/conferences/bacon-2013/talks/defining-music-recreational-programming-and-pure-data\n* http://js1k.com/2013-spring/demo/1558\n* https://www.youtube.com/watch?v=4qsWFFuYZYI\n\n## TODO\n\nEverything?\n\n## References\n\n* http://www.sonicspot.com/guide/wavefiles.html\n* https://ccrma.stanford.edu/courses/422/projects/WaveFormat/\n* http://chimera.labs.oreilly.com/books/1234000001552\n\n## License\n\n### The MIT License (MIT)\n\nCopyright (c) 2016 Richard Hull\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fsound-flour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frm-hull%2Fsound-flour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frm-hull%2Fsound-flour/lists"}