Online Sequencer Forums

Full Version: Convert Any Sequence to .ogg!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Prototype:
Code:
var chunks = [];
var ac = window.audioSystem.audioContext;
var dest = ac.createMediaStreamDestination();
var mediaRecorder = new MediaRecorder(dest.stream);

//connect all the nodes
for (var i in window.audioSystem.gainNodes) {
   var gn = window.audioSystem.gainNodes[i];
    gn.connect(dest);
}

//start at song start
mediaRecorder.start();
window.song.play(0);

//stop at song end
function stop() {
    window.song.stop();
    mediaRecorder.stop();
}
setTimeout(stop, window.song.loopTime * 15000 / bpm);

mediaRecorder.ondataavailable = function(evt) {
   // push each chunk (blobs) in an array
   chunks.push(evt.data);
};
mediaRecorder.onstop = function(evt) {
   // Make blob out of our blobs, and open it.
   var blob = new Blob(chunks, {type: 'audio/ogg; codecs=opus'});
    document.write('<audio controls></audio>');
   document.querySelector("audio").src = URL.createObjectURL(blob);
};
Confirmed for Chrome above works. Jacob_ might want to add UI features to this though. Only works with .ogg, never mind what I said before.
Huh, neat.

But yeah it still needs to also catch the reverb & delay.
(01-04-2019, 12:59 PM)Kirbyderp Wrote: [ -> ]Huh, neat.

But yeah it still needs to also catch the reverb & delay.

Oof, it doesn't? For now it's Jacob_'s problem, but I may improve it if that is the case.
The individual channel nodes are connected to reverb/delay when those are active, so you'd have to consider that. https://onlinesequencer.net/app/audioSystem.js
Tried it out but I'm getting an error.

Uncaught ReferenceError: mediaRecorder is not defined
at <anonymous>:1:1
(05-09-2019, 12:32 AM)EtherBot Wrote: [ -> ]Tried it out but I'm getting an error.

Uncaught ReferenceError: mediaRecorder is not defined
   at <anonymous>:1:1

Thanks for telling me the error message! Otherwise I would have guessed you were on Edge, because that browser doesn't support the API I used. However, this error message shows you are either on a different browser (unlikely reason based on error message), you found a weird edge case (likely), or you didn't paste the code correctly (also likely). To further debug this, can you give me steps to replicate this behavior?
If this is finished, could you implement it into the site Jacob_?
(05-09-2019, 04:30 PM)Alex! Wrote: [ -> ]If this is finished, could you implement it into the site Jacob_?

Jacob_ has stated to me that this may be illegal (copyrighted soundfonts) and he doesn't want trouble. Sad
Fox used a thing where you could download the song from the browser using a url. This really helps, since on my phone ypu can't open sequences. If you know what the url is, that would be awesome.

The one bug with it is that with large songs () it distorts the crap out of it
(07-23-2019, 11:41 AM)Sir_Guy Wrote: [ -> ]Fox used a thing where you could download the song from the browser using a url. This really helps, since on my phone ypu can't open sequences. If you know what the url is, that would be awesome.

The one bug with it is that with large songs () it distorts the crap out of it
it's frank's website he made for Robo's sequence player. the url is https://midi-sled.glitch.me/ (you put the id of the sequence into the little box and then hit load)
Pages: 1 2