GithubHelp home page GithubHelp logo

pnomolos / gamelan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jvoorhis/gamelan

0.0 0.0 0.0 25 KB

Gamelan is a good-enough soft real-time event scheduler, written in Ruby, especially for music applications.

License: MIT License

Ruby 100.00%

gamelan's Introduction

Gamelan

Gamelan is a good-enough soft real-time event scheduler especially for music applications. It exposes a simple API for executing Ruby code at a required time. Uses include sending MIDI or OSC messages to external applications or hardware.

Gamelan also makes life easier by supporting logical time. Logical time is reflected in the scheduler’s phase. The unit in logical time is the beat, and the Scheduler’s phase will increment by 1.0 with every beat.

Logical time varies with real time according to the tempo, which is specified in bpm. For example, the Scheduler’s phase will increment by 2.0 for every second that elapses when using the default tempo of 120bpm. Applications are free to alter the tempo at any time, including from within tasks.

Notes

The author admits that Ruby is not at all friendly to realtime applications. No guarantees are made about the scheduler’s performance. It will not drift (it will always stay in sync with the system clock), but jitter is inevitable. This is minimized by using a hybrid spinlock implementation to wait between dispatches, and by using a reasonably efficient priority queue to store Tasks.

The design is an elaboration of Topher Cyll’s Timer implementation from his book, Practical Ruby Projects, and the Priority Queue implementation comes from Brian Amberg.

gamelan's People

Contributors

pnomolos 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.