npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@freehand/tssynth

v0.2.1

Published

tssynth =======

Downloads

2

Readme

tssynth

I'm just publishing this as a package called @freehand/tssynth temporarily until gundy gets around to publishing the new version himself.

port from jssynth

Notes on TypeScript conversion:

This version of jssynth has been ported to TypeScript. The project now requires the following tools:

NodeJS environment: use Nodenv (not NVM) Build tool: Yarn (not NPM, easiest to install via npm install -g yarn) Test tool: Alsatian (run tests with yarn run unit-tests)

Dev setup steps:

  1. checkout this project and cd into it
  2. Make sure nodenv is installed
  3. npm install -g yarn # Installs yarn globally for current node version
  4. nodenv rehash # Tells nodenv to make the new yarn command available
  5. yarn # Installs all packages
  6. yarn unit-tests # Runs the unit tests
  7. yarn build # Builds the project
  8. yarn package # Generates a release package

IDE:

Recommend using Visual Studio Code with "TypeScript TSLint Plugin"

About:

JSSynth is a pure JavaScript library for dealing with sampled and synthesised digital audio.

It comprises a mixer component and an integration layer to output sampled audio via the web audio API, as supported in most modern browsers.

Here's an example of using the mixer to whet your appetite:

    var sample = new Sample(.....);
    var mixer = new Mixer({ numChannels: 8, volume: 64 });  /* initialise the mixer */
    var audioOut = new WebAudioDriver(mixer);               /* initialise web audio API w/ mixer */
    audioOut.start();                                       /* start audio mixing / playing */
  
    /*
     * at this time audio output has started, mixer.mix() is being called in the background
     * to fill the audio buffers (it's triggered by the web audio layer), and user code
     * is able to start triggering samples, eg.
     */
    
    mixer.triggerSample(0, sample, 440);                        /* play sample, channel 0 @ A440 */

Samples can be either function-based (ie. fully synthetic), or pre-canned sampled digital audio.
JSSynth is able to interpret and playback 8/16/24-bit, signed/unsigned, mono/stereo samples if required.

In order to allow accurate timing, JSSynth provides a "secondsPerMix" property, which sets how many seconds worth of audio data JSSynth will generate in each call to the Mixer.mix() method.

The WebAudioDriver interface allows user-code to register a pre-mix callback. This means that your code can be notified whenever another x seconds worth of audio data is about to be requested, and perform whatever updates to the audio state that you need to. This is very useful for creating applications like synthesised audio players.

After calling the pre-mix callback, WebAudioDriver will call Mixer.mix() to generate the next batch of samples for playback.

Please look at my other projects for an example of a pure JavaScript implementation of a .MOD/.S3M file player that has been built on top of the JSSynth API. This should help to give an idea of what might be possible.

Games, demos, interactive UI's, DSP related apps or prototypes, the sky is the limit.

... and that's all there is to it really.

If you use JSSynth or any of the related example code in any projects, please drop by and let me know.