Synaesthesia
Randomly generated music in the browser
Install / Use
/learn @wheelibin/SynaesthesiaREADME
Live demo: https://wheelibin.github.io/synaesthesia/
Intro
This is a little experiment with creating randomly generated music in the browser. It uses the amazing Tone.js (a wrapper around the Web Audio API).
All the sounds are generated using various Synth instruments from Tone.js, there are no samples.
How it works
The "song" is generated like so:
- A key is chosen (root note and scale, e.g. A Minor)
- A chord progression is generated for the key
- A bassline is generated for the chord progression
- A simple higher octave part is generated for the chord progression
- Drums patterns for kick, snare, hihat, shaker, openhat are chosen to create percussion
- A random BPM is chosen within a certain range
- A random swing amount is chosen
All the elements are randomly chosen from various arrays, collections of instruments, and patterns.
The random number generator is seeded to allow recreation of the same randomly selected song.
Have a play
Live demo available here: https://wheelibin.github.io/synaesthesia/
Getting started
npm install
npm start
Credits
- This project is built on the amazing Tone.js library.
- Lots of input and music theory assistance from McHarper
- Javascript random number seed mechanism from https://github.com/davidbau/seedrandom
License
MIT License
Copyright (c) 2018 wheelibin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Related Skills
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.4kCommit, push, and open a PR
