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

tuneflow

v0.40.5

Published

Programmable, extensible music composition & arrangement

Downloads

101

Readme

TuneFlow Typescript SDK

English | 中文

TuneFlow Screenshots

Build Status Code Coverage npm Discord License

What is TuneFlow?

TuneFlow is a next-gen DAW that aims to boost music making productivity through the power of AI. Unlike traditional DAWs, TuneFlow has a plugin system designed to facilitate music production in almost all areas, including but not limited to song writing, arrangement, automation, mixing, transcription...... You can easily write your own algorithms or integrate your AI models directly into the song-making process. tuneflow is the Typescript SDK of TuneFlow plugins.

Installation

npm install tuneflow

Prefer another language?

Check out the SDKs in other languages:

  • Python: https://www.github.com/tuneflow/tuneflow-py
  • Other: Contributions welcome!

Getting started

The core idea of TuneFlow's plugin system is that you only care about the data model, NOT the implementation. A plugin's only goal is to modify the song to its need, and the DAW will get the modified result and apply the changes automatically. Below is an illustration:

Plugin Flow

A plugin bundle consists of 3 components: The bundle file, the plugin files, and the bundle export.

Bundle file (bundle.json)

The bundle file, which we usually name it bundle.json, contains the information of the plugins in this bundle. The information here will be shown to the users before they need to load the code of your plugin.

An example manifest file looks like this.

{
  "plugins": [
    ......,
    {
      "providerId": "my-provider-id",
      "providerDisplayName": "My Provider Name",
      "pluginId": "my-plugin-id",
      "pluginDisplayName": "My Plugin Name",
      "version": "1.0.0",
      "minRequiredDesktopVersion": "1.8.3",
      "options": {
        "allowReset": false
      }
    },
    ......
  ]
}

Plugin code

This is will be your actual code file. A barebone plugin, for example hello_world_plugin.ts, may look like this:

// hello_world_plugin.ts

import type { LabelText, ParamDescriptor, SliderWidgetConfig, Song } from 'tuneflow';
import { TuneflowPlugin, WidgetType } from 'tuneflow';

export class HelloWorld extends TuneflowPlugin {
  static providerId(): string {
    return 'my-provider-id';
  }

  static pluginId(): string {
    return 'my-plugin-id';
  }

  params(): { [paramName: string]: ParamDescriptor } {
    return {
      ......
    };
  }

  async init(song: Song, readApis: ReadAPIs): Promise<void> {
    ......
  }

  async run(song: Song, params: { [paramName: string]: any }): Promise<void> {
    ......
  }
}

First you'll need to overwrite the providerId() and pluginId() methods to match what you specified in the manifest file. When loading the plugins, TuneFlow looks for the two ids to match the bundle file with each plugin source code.

Bundle export

Finally, in order for TuneFlow to execute your code, you need to export all of your plugins in this bundle into one file, and use build tools to build it into a javascript file for distribution. Here we need to create an index file to export all of your plugins in this bundle. Here for example, we can create an index.ts file which looks like this:

// index.ts

export { HelloWorld } from './hello_world_plugin';
export { SomeOtherPlugin } from './some_other_plugin';
......

Writing a plugin

When writing a plugin, our main focus is in params, init and run.

params

This is where you specify the input parameters you want from the user or from the DAW. It will be processed by the DAW and generate your plugin's UI widgets.

init

Called by the DAW when the user loads the plugin but before actually running it. The DAW will provide the current song snapshot (song: Song) and some read-only APIs (readApis: ReadAPIs), and you will take these params to initialize your plugin.

For example, if you have a list of presets that applies to different time signatures, you can use init to read the current song's time signature and filter out those options that don't work for the song.

run

Called by the DAW when the user actually runs the plugin by hitting the Apply` button.

Here is where you implement your main logic. The method takes in the current song snapshot (song: Song), the params that are actually provided by the user or the DAW (params), and the read-only APIs (readApis: ReadAPIs).

Run your plugin

To run or debug your plugin, your can use tuneflow-devkit. For more information on plugin development, check out https://www.github.com/tuneflow/tuneflow-devkit

Examples

For a comprehensive of basic plugins that are used in TuneFlow's editor, check out https://www.github.com/tuneflow/tuneflow-plugin-basic

Resources

TuneFlow Website

Python SDK