Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

How to use with Tuna.js #77

Open
798714773 opened this issue Jul 5, 2020 · 2 comments
Open

How to use with Tuna.js #77

798714773 opened this issue Jul 5, 2020 · 2 comments

Comments

@798714773
Copy link

How to use with Tuna.js
I need a demo

@rhelsing
Copy link

rhelsing commented Feb 7, 2021

@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
Copy link

rhelsing commented Feb 7, 2021

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)
})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants