Comments (5)
Hi Matt!,
thanks for the issue and the PR. I like your proposal, except for a little thing: I don't think is practical to give the destination each time you play an instrument. Instead of move options out of instrument
to play
I would keep instrument options and add play options as override of that. So you can:
var inst = soundfont.instrument('guitar_harmonics', { gain: 0.5, destination: ac.destination });
inst.play('c2', 1, 0.5); // use defaults
inst.play('c2', 1, 0.5, { gain: 0.2, destination: my_dest }); // override defaults
What do you think? Do you mind to change your PR to adapt those changes?
from soundfont-player.
No, that sounds like a much better (and less api breaking) change. I've update the PR and squashed the changes to take a defaultOptions
on instrument
and then an override options
parameter on play
.
from soundfont-player.
Great, thanks!!
from soundfont-player.
Nice PR! Thanks a lot.
from soundfont-player.
The changes are published on npm as 0.8.0
from soundfont-player.
Related Issues (20)
- Notes are always 10-20 cents sharp
- event listener added on each event callback
- Memory leak in sample-player (includes fix/PR)
- Thank you for a great library!
- How to improve sound quality? HOT 1
- Chords with duration in 2 measure bars
- Issue with tempo 30 seconds after start of play
- Play MIDI files HOT 9
- The "release" part of the envelope doesn't have any effect HOT 1
- When specifying only-load-these-notes option, the sharps don't work
- Loading instruments via `require` or other compile-time means HOT 2
- Uncaught (in promise) Error: Invalid MIDI.js Soundfont format at midiJsToJson HOT 1
- Module not working with observablehq.com HOT 1
- Muddy Sound
- Problems when attempting to play a custom soundfont HOT 1
- Increase the volume HOT 1
- Sound doesn't play on an iOS mobile device HOT 2
- How to stop all sounds
- player.schedule problematic when midi array has over 400 items HOT 1
- Start events fired as soon as notes are scheduled HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soundfont-player.