Giter VIP home page Giter VIP logo

jsxm's Introduction

xm.js

Build Status

FastTracker 2 .XM player, written for fun.

Demo

There is an XM player and a visualizer which are separate components. The player API looks like this:

  • XMPlayer.init -> starts up audio context; it's available as XMPlayer.audioctx
  • XMPlayer.load(ArrayBuffer) -> returns true if loaded, otherwise barfs randomly
  • XMPlayer.play() -> starts playing
  • XMPlayer.pause() -> obvious
  • XMPlayer.stop() -> obvious; call this before loading a new one

Loading trackview.js is optional; without it, the player won't do any visualizations. Or, you can override the following to get callbacks:

  • XMView.pushEvent(e) -> push an audio event onto the queue. Called once per tick (about 50Hz, controlled by song). e contains fields:
    • t - audio timestamp
    • vu - Float32Array of RMS power (volume) for each channel
    • scopes - [Float32Array] of oscilloscope data, one array per channel; XMView.scope_width contains # of samples to produce here
    • songpos - position in the song (# patterns played)
    • pat - pattern number currently playing
    • row - row within pattern
  • XMView.pause() - pause visualization
  • XMView.stop() - stop/reset visualization

The code which defines what the buttons do and downloads songs and so forth is in shell.js.

The player is fairly feature-complete, but is missing a bunch of effects.

MIT license.

jsxm's People

Contributors

a1k0n avatar exponenta avatar hillerstorm avatar luckcolors avatar mweitzel avatar razorde avatar whizzter avatar

Watchers

 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.