Giter Club home page Giter Club logo

harmonic-motion-symphony's Introduction

harmonic-motion-symphony

A JavaScript and Canvas app, that combines simple pendulum physics with Sound.

It simulates the pendulum motion using a modified SHM (Simple Harmonic Motion) model, that includes weight and dumping in the equation.

Each time the Pendulum crosses the middle point (aka the x coordinate of the origin) a note is played. This creates interesting possibilities for music generation.

The goal of the project was to be as minimal as possible, hence the use of pure JavaScript with no dependencies, the Web Audio Api, and HTML5 Canvas.

In order to keep the code clean, I separated into es6-modules, which unfortunately means that I needed to add a build step, using rollup and swc.

In order to run the app, download or clone the project, run the commands:

npm install
npm run build

, and then, open up index.html with a web browser of your choice. (The audio might have some glitches when a note finishes on the FireFox browser)

Inspiration Credits: Lucid Rhythms - "Space Pendulum" When I watched that video I knew I HAD to implement it.

TODO

  • Create a functional prototype
  • Implement a game menu
    • NEW GAME
    • RESUME
    • RESET
    • SETTINGS
  • Add user interactivity
    • Select a pendulum
    • Change properties of the pendulum
    • Add pendulums
    • Remove pendulums
    • Drag a pendulum while the simulation is running
  • Implement the AudioSource class: - host multiple oscillators, - add ADSR envelop - add detuning
  • Update the classes docs
  • Implement a glow halo effect for the pendulum weight, when it plays a note

harmonic-motion-symphony's People

Contributors

ioannischtz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.