How to use with Tuna.js
Opened this issue · 2 comments
798714773 commented
How to use with Tuna.js
I need a demo
rhelsing commented
@danigb I would like to know how this would be possible too?
I've tried the following but it does not work:
var AudioContext = window.AudioContext || window.webkitAudioContext || false;
var ac = new AudioContext || new webkitAudioContext;
var ef = new tuna.Bitcrusher({
bits: 4, //1 to 16
normfreq: 0.1, //0 to 1
bufferSize: 4096 //256 to 16384
});
var input = ac.createGain();
var output = ac.createGain();
input.connect(ef);
ef.connect(output);
Soundfont.instrument(ac, '......').then(function (instrument) {
....
})
rhelsing commented
I'm a little further along but it seems to be playing the effected audio as well as the uneffected audio:
var AudioContext = window.AudioContext || window.webkitAudioContext || false;
var ac = new AudioContext || new webkitAudioContext;
var ef = new tuna.Bitcrusher({
bits: 4, //1 to 16
normfreq: 0.1, //0 to 1
bufferSize: 4096 //256 to 16384
});
Soundfont.instrument(ac, '......').then(function (instrument) {
instrument.connect(ef)
ef.connect(ac.destination)
})