Skip to content

Commit

Permalink
stop grain
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioOcelotl committed Sep 12, 2023
1 parent e15064c commit ccf96bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/SoundEnvironment/Grain.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { map_range } = require('./maprange.js');

function Grain(aCtx){ // audiocontext y el archivo a cargar
function Grain(aCtx, type = 'grain'){ // audiocontext y el archivo a cargar

self = this;
// se pueden pasar sin ser objetos independientes? Recuerdo que para algo se necesitaban
Expand Down
7 changes: 3 additions & 4 deletions src/sptm-live/AudioEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,14 @@ const AudioEngine = function (audioContext) {
audioContext.decodeAudioData(ev.target.result).then(function (buffer2) {
buffer = buffer2;
console.log("loaded");
grain = new Grain(audioContext);
grain = new Grain(audioContext, 'grain');
grain.set(buffer, parseFloat(params[0]), parseFloat(params[1]), parseFloat(params[2]), parseFloat(params[3]), parseFloat(params[4]));
grain.start();

addElementToEngine(grain);
printState();
})
}
reader.readAsArrayBuffer(audioFile1.files[0]);
addElementToEngine(grain);
printState();
}
}
}
Expand Down

0 comments on commit ccf96bc

Please sign in to comment.