09-09-2018, 12:09 PM
(09-09-2018, 09:59 AM)Benjobanjo7 Wrote: this is great! Do you think it would be possible to make a "Cancer Piano" option with this? It is basically the same pseudo -sustain, but some notes are randomly left out
examples
##475383
this amazing one by Flonk (in which the notes no longer show up because in his, the notes are on a tiny grid)
# #541748
this ok on by me (I used the 1/16 grid and did it all by hand)
it would be cool to be able to automatically make this effect
Version 1.1 now has cancer!
Code:
// ==UserScript==
// @name Continuous sound!
// @namespace http://tampermonkey.net/
// @version 1.1
// @description CONTINUOUS
// @author Frank
// @match https://onlinesequencer.net
// @grant none
// @run-at context-menu
// ==/UserScript==
(function() {
'use strict';
var notes = selectedNotes.length ? selectedNotes : song.notes;
var length = parseFloat(prompt("Length of subdivisions? (Inclusive, 16 = 1 Measure.)"));
var cancer = parseFloat(prompt("Cancer resistance? (1 = no effect, .5 = half destroyed)"))
switch (true){
case isNaN(cancer):
cancer = -1;
break;
case cancer > 1:
cancer = 1;
break;
case cancer < 0:
cancer = 0;
}
notes = notes.filter(x => x.length >= length && !instrumentLock[x.instrument]);
for (var i = 0; i < notes.length; i++){
var note = notes[i];
var timeStart = note.time;
var timeEnd = timeStart + note.length;
var j;
if (cancer == 1 || cancer == -1){
for (j = timeStart; j < timeEnd - length; j += length){
song.addNote(new Note(song, note.type, j, length, note.instrument));
}
}
else {
for (j = timeStart; j < timeEnd - length; j += length){
Math.random() < cancer ? song.addNote(new Note(song, note.type, j, length, note.instrument)) : null;
}
}
Math.random() < cancer ? song.addNote(new Note(song, note.type, j, timeEnd - j, note.instrument)) : null;
song.removeNote(note);
}
SequencerView.repaint()
})();
Example:
##919110
Kim Wrote:##878337 + https://js-game.glitch.me + Doesnt take peopel serious if their has badly speling gramer puntuatin