Online Sequencer Forums

Full Version: Using Small Note Lengths to Represent Sound Samples?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, recently I was messing around with small instrument note lengths and i came up with an idea as using 8-Bit instruments as "Samples" (like what a WAV file consists of)


Heres just a quick example of what im trying to get at: 




Each note represents a sample and when played back at a fast speed it makes it seem like its being played back from a different file format
This only works with the 8-Bit Instruments since the length of the sound scales with the note length.

I know there isn't any practical uses for this but I just thought it would be cool to show and maybe someone more talented than me can do more complicated things using this method.
You can do this with percussion too!

Darn, I have to get in on this.
He left his "notes", good gracious.
"note length = (note frequency)/26.7(100bpm 1/16 note hz)*4(inspect grid value)"
In my own terms,
bpm/26.7/notefrequency
because as bpm increases length also has to increase.
I have done


CODE
Code:
// ==UserScript==
// @name         HZ?!
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to hz over the world!
// @author       Frank
// @match        https://onlinesequencer.net/
// @grant        none
// @run-at       context-menu
// ==/UserScript==

'use strict'
var typeToHZ = {};
for(var i = 0; i < window.piano.length; i++){
   var type = window.piano[i];
   typeToHZ[type] = 440 * Math.pow(2, (38 - i) / 12)
}
window.song.addNote = function(note, notOG){
   if (note.instrument == 2 && !notOG) {
       var length = window.bpm / 26.7 / typeToHZ[note.type];
       if (!length) return;
       for(var time = note.time; time < note.time + note.length; time += length){
           window.song.addNote(new window.Note(window.song, note.type, time, length, 2), true)
       }
   }
   else {
       var noteIndex = window.piano.indexOf(note.type);
       if(noteIndex != -1){
           this.notes.push(note);
           this.update(note);
           this.moveNote(note, undefined, note.instrument, undefined, note.time, undefined, note.type);
           this.updateLoopTime();
       }
   }
}