Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neoki07/sf2-synth-audio-worklet
An Audio Worklet-based SoundFont2 synthesizer for the browser
https://github.com/neoki07/sf2-synth-audio-worklet
audio-worklet javascript library npm-package soundfont2 synthesizer
Last synced: 13 days ago
JSON representation
An Audio Worklet-based SoundFont2 synthesizer for the browser
- Host: GitHub
- URL: https://github.com/neoki07/sf2-synth-audio-worklet
- Owner: neoki07
- License: mit
- Created: 2023-01-21T12:50:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-16T06:09:27.000Z (5 months ago)
- Last Synced: 2024-09-18T07:36:17.229Z (about 2 months ago)
- Topics: audio-worklet, javascript, library, npm-package, soundfont2, synthesizer
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/sf2-synth-audio-worklet
- Size: 34.8 MB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# sf2-synth-audio-worklet
[![license](https://img.shields.io/npm/l/sf2-synth-audio-worklet.svg)](https://github.com/neoki07/sf2-synth-audio-worklet/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/sf2-synth-audio-worklet.svg)](https://www.npmjs.com/package/sf2-synth-audio-worklet)
[![npm downloads](https://img.shields.io/npm/dm/sf2-synth-audio-worklet)](https://www.npmjs.com/package/sf2-synth-audio-worklet)
[![ci](https://github.com/neoki07/sf2-synth-audio-worklet/actions/workflows/ci.yml/badge.svg)](https://github.com/neoki07/sf2-synth-audio-worklet/actions/workflows/ci.yml)An Audio Worklet-based SoundFont2 synthesizer for the browser.
## Installation
```bash
npm install sf2-synth-audio-worklet
```## Getting Started
This code sets up a simple SoundFont2 player in React using the library.
```tsx
import { useState } from 'react'
import {
createSoundFont2SynthNode,
type SoundFont2SynthNode,
} from 'sf2-synth-audio-worklet'function App() {
const [node, setNode] = useState()const setup = async () => {
const audioContext = new AudioContext()
const sf2Url = 'path/to/soundfont2' // Replace with the SoundFont2 file path
const node = await createSoundFont2SynthNode(audioContext, sf2Url)
node.connect(audioContext.destination)
setNode(node)
}const noteOn = () => node?.noteOn(0, 60, 100, 0)
const noteOff = () => node?.noteOff(0, 60, 0)return (
Setup
Sound
)
}
```## License
MIT