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

@fluid-music/utils

v0.8.3

Published

CLI Helpers for building fluid music recipes

Downloads

21

Readme

Fluid Music Utilities

This installs several CLI helper tools for creating fluid-music recipes.

Use npm install -g @fluid-music/utils to install:

  • afactory
  • transcribe-chords

afactory

Recursively searches a directory for audio files, and generates a fluid-music AudioFile technique for each audio file it finds. The output techniques will be written to a common.js formatted JavaScript file which exports a deeply nested JavaScript object reflecting the input directory structure.

Usage:

$ afactory ./search/dir [outfile='audio-files.js']

Example:

Assume your working directory contains the following files:

./drums/snare.wav
./drums/hi-hat/close.wav
./drums/hi-hat/open.wav

Step 1: Run afactory from the working directory:

$ afactory ./ audio.js

Step 2: afactory will create an audio.js file, which looks like this:

const { AudioFile } = require('fluid-music').techniques
module.exports = {
  "drums": {
    "snare.wav":   new AudioFile({ /* init options */ }),
    "hi-hat": {
      "close.wav": new AudioFile({ /* init options */ }),
      "open.wav":  new AudioFile({ /* init options */ }),
    },
  },
};

Step 3: You can now require('./audio.js'), to access the exported objects, using them to manually create fluid-music tLibrary objects.

transcribe-chords

A super quick way to transcribe midi chords in JSON using a midi keyboard.

$ npm install -g @fluid-music/utils
$ transcribe-chords chords.js
Usage: $ transcribe-chords out.js # (Currently writing to "chords.js")
connected: "Midi Through Port-0"
connected: "MPK Mini Mk II MIDI 1"

Now play some chords on any connected midi device to generate a file like the one below (use ctrl+c to stop recording).

const fluid = require('fluid-music')
const { MidiChord } = fluid.techniques

const chords = [
  new MidiChord({
    name: 'Gm',
    notes: [55, 58, 62],
  }),

  new MidiChord({
    name: 'Bbsus4',
    notes: [58, 60, 63, 65],
  }),

  new MidiChord({
    name: 'Cm',
    notes: [60, 63, 67],
  }),
]

module.exports = chords

You can create a tLibrary like this:

const fluid = require('fluid-music')
const chords = require('./midi-chords')

const tLibrary = fluid.tLibrary.fromArray(techniques)

// tLibrary will look like this:
{
  a: MidiChord({ name: 'Gm',     notes: [55, 58, 62] }),
  b: MidiChord({ name: 'Bbsus4', notes: [58, 60, 63, 65] })
  c: MidiChord({ name: 'Cm',     notes: [60, 63, 67] }),
}