felixroos / sfumato

soundfont synth for the web, with sf2 file support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sfumato

The blurring or softening of sharp outlines in painting by subtle and gradual blending of one tone into another.

This library is able to play soundfonts (sf2 files) with the Web Audio API.

Status

It's still a work in progress! Roadmap will follow soon

Installation

npm i sfumato --save

Import

import { loadSoundfont, startPresetNote } from 'sfumato';

API

  • loadSoundfount(url) loads a soundfont from a url. returns Soundfont2
  • startPresetNote(ctx, preset, midi, time) plays a note, returns stopHandle
    • ctx the audio context to use
    • preset the preset to use (use one of Soundfont2.presets)
    • midi midi number to play
    • time audio context time to start playing (defaults to currentTime)
  • stopHandle(time) stops the note at the given time

Links

About

soundfont synth for the web, with sf2 file support


Languages

Language:TypeScript 97.2%Language:JavaScript 2.8%