All Projects → nbrosowsky → Tonejs Instruments

nbrosowsky / Tonejs Instruments

Licence: other
A small instrument sample library with quick-loader for tone.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Tonejs Instruments

Webaudiofont
Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
Stars: ✭ 600 (+248.84%)
Mutual labels:  audio, music, music-player
Musicplayer
A minimal music player built on electron.
Stars: ✭ 145 (-15.7%)
Mutual labels:  audio, music, music-player
Daw
GridSound (0.33.0) wants to be an open source online digital audio workstation following the new WebAudio API 🎛🎹🎵✨
Stars: ✭ 804 (+367.44%)
Mutual labels:  audio, music, web-audio
Tone.js
A Web Audio framework for making interactive music in the browser.
Stars: ✭ 11,352 (+6500%)
Mutual labels:  samples, music, web-audio
React Cassette Player
Simple ReactJS HTML5 audio player component built with SVG icons from The Noun Project.
Stars: ✭ 93 (-45.93%)
Mutual labels:  audio, music, music-player
Wavesurfer.js
Navigable waveform built on Web Audio and Canvas
Stars: ✭ 5,905 (+3333.14%)
Mutual labels:  audio, music, web-audio
Pandoraplayer
🅿️ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.
Stars: ✭ 1,037 (+502.91%)
Mutual labels:  audio, music, music-player
Canaree Music Player
Complete music player published in the Play Store. Heavily relies on Dagger, kotlin coroutines and Clean architecture.
Stars: ✭ 371 (+115.7%)
Mutual labels:  audio, music, music-player
Beep.js
Beep is a JavaScript toolkit for building browser-based synthesizers.
Stars: ✭ 1,294 (+652.33%)
Mutual labels:  audio, music, web-audio
Audio player flutter
🎧 Apple Music / Tidal Audio Player for Flutter
Stars: ✭ 52 (-69.77%)
Mutual labels:  audio, music, music-player
Tauonmusicbox
The Linux desktop music player from the future! 🌆
Stars: ✭ 494 (+187.21%)
Mutual labels:  audio, music, music-player
Smusic
html5音乐列表播放器
Stars: ✭ 106 (-38.37%)
Mutual labels:  audio, music, music-player
Romplayer
AudioKit Sample Player (ROM Player) - EXS24, Sound Font, Wave Player
Stars: ✭ 445 (+158.72%)
Mutual labels:  samples, audio, music
Audio Visualizer Android
🎵 [Android Library] A light-weight and easy-to-use Audio Visualizer for Android.
Stars: ✭ 581 (+237.79%)
Mutual labels:  audio, music, music-player
Skplayer
🎵 A simple & beautiful HTML5 music player
Stars: ✭ 437 (+154.07%)
Mutual labels:  audio, music, music-player
Strawberry
🍓 Strawberry Music Player
Stars: ✭ 972 (+465.12%)
Mutual labels:  audio, music, music-player
Lms
Lightweight Music Server. Access your self-hosted music using a web interface.
Stars: ✭ 315 (+83.14%)
Mutual labels:  audio, music, music-player
Clubber
Application of music theory in audio reactive visualizations
Stars: ✭ 325 (+88.95%)
Mutual labels:  audio, music, web-audio
Vyplayindicator
PlayIndicator inspired by Apple's Music Player.
Stars: ✭ 47 (-72.67%)
Mutual labels:  audio, music, music-player
Tuna
An audio effects library for the Web Audio API.
Stars: ✭ 1,345 (+681.98%)
Mutual labels:  audio, music, web-audio

tonejs-instruments

I've been playing around with audio samples and Tone.js but was finding it tedious to keep writing code to load the same instrument samples. So I decided to put together a little code that makes it easier for me to load the instruments and a repository for all the samples I'm using.

This code produces a SampleLibrary object with all the info about the samples and a quick load function.

DEMO (all instruments)

**Note: this demo loads all the samples from all the instruments and may be slow loading. If your internet connection is slow, I suggest the demo below, which loads four randomly chosen instruments.

DEMO (four random instruments)

Basic Usage

You can load instrument samples by calling SampleLibrary.load() and passing an object with the settings. Only the "instrument" setting is necessary to load an instrument. By default, instruments are not automatically connected to the master out.

// passing a single instrument name loads one instrument and returns the tone.js object
var piano = SampleLibrary.load({
  instruments: "piano"
  });
  
 piano.toMaster();
 piano.triggerAttack("A3");

// passing an array of instrument names will load all the instruments listed returning a new object, 
// each property a tone.js object
var instruments = SampleLibrary.load({
  instruments: ["piano","harmonium","violin"]
  });

// waits for instrument sound files to load from /samples/
Tone.Buffer.on('load', function() {
     // play instrument sound
     instruments['piano'].toMaster();
     instruments['piano'].triggerAttack("A3");
     });

Optional arguments

File extension:

// By default, the file extension for the samples is set to .mp3 with .ogg as a fallback. 
// You can change this by setting the "ext" when you load:
var piano = SampleLibrary.load({
  instruments: "piano",
  ext: ".wav"
  });

// follows the Tone.js formatting for fallbacks
var piano = SampleLibrary.load({
  instruments: "piano",
  ext: ".[wav|mp3|ogg]"
  });

Reduce the number of samples loaded

// The number of samples per instrument varies quite a bit (a few have more than 60)
// To reduce the number loaded set "minify" to true
// If > 16 samples, it loads every second
// If > 32 samples, it loads every fourth
// If > 48 samples, it loads every sixth

var piano = SampleLibrary.load({
  instruments: "piano",
  minify: true
  });
  

About the samples

These instrument samples come from a variety of public domain sources (see the sample-source-info.txt for more information)

All the samples have been edited for consistency: trimming silence, on/off ramp, volume-matching, normalizing, noise removal, and some pitch-correction where necessary.

Included instruments:

  • bass-electric
  • bassoon
  • cello
  • clarinet
  • contrabass
  • flute
  • french-horn
  • guitar-acoustic
  • guitar-electric
  • harmonium
  • harp
  • organ
  • piano
  • saxophone
  • trombone
  • trumpet
  • tuba
  • violin
  • xylophone

To do:

  • Add drumkits
  • Add Synths

LICENSE

Code: MIT License (see LICENSE.md)

Samples: CC-by 3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].