Giter Club home page Giter Club logo

gig's Issues

Support contextual collections

We need to be able to nest intervals that process collections of elements. For example:

@Time = 4|4

:Scales = [
  2 -> Scale('C Lydian')
  2 -> Scale('G Ionian')
]

:Chords = [
  2 -> Chord('Cmaj7')
  2 -> Chord('Gmaj7')
]

!Play {
  :Scales
  :Chords
}

In the Set ({}), the :Scales and :Chords will overlap and will be played at the same time.

In the nested List ([]), each Chord or Scale will be played for 2 measures at a time using their own contextual/internal timers.

The simplest way I know to do this is to introduce a recursive "context" abstraction.

This will also require changes to bach, such that Sets can be defined without a duration value.

Rename project to either `gig` or `gigue`

I just renamed this module to bach-player, but I realized that this is annoying for development (always have to tab for the project name) and also makes it ambiguous what platform this player actually applies to (default is JS, but not everybody would know that).

I've concluded that it's better to give the project a more generic and abstract name than a straight forward one.

gig means a band performance, while gigue is a lively piece of Baroque music, which Bach wrote a lot of.

gig is unsurprisingly taken on NPM (we could just scope to an organization or something), but gigue is awkward to pronounce (like "jeeg")

Support seek to position

We first need to first support translating a time position in a track (e.g. 00:30) into the closest beat and measure cursors.

We then need to calculate the size of the interval at the beat and measure cursors. The size of the interval will be offset by the difference between the standard/default interval and the time remaining until the next interval.

More formally, if C is the timestamp found at the seeked position, E is the scheduled/expected invocation timestamp of the next interval, and R is the amount of time remaining (in ms) until the next interval, then:

R = E - C

[Refactor] Improve accuracy of timer

Right now the timer backing juke is not sufficient because it is prone to drift (it's based on setInterval, or rather a modified version of it that tries to remain accurate but doesn't really work).

The timer found in heartbeets may be more accurate than stateful-dynamic-interval because it is using the requestAnimationFrame feature of modern browsers.

We may also want to try worker-timers as well, since it spins up instances of setInterval and setTimeout in Web Worker scripts and can run in parallel, therefore improving the accuracy.

Support Rest element

We need to support Rest elements.

This actually might work already due to how the module is written, but at the very least this needs to be verified + tested.

Consume Bach @Audio header

Instead of accepting audio as an argument to the Track constructor, we should instead parse bach's @Audio header, automatically following the URL to the audio bytestream and loading it into memory.

This does not have to initially support streaming audio, although it does sound like a useful feature for the future.

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.