Online Sequencer Make music online
  • Sequences
  • Members
  • Chat
  • Forum
  • Wiki

Existing user? Sign In Create account
Login at Online Sequencer Forums

Online Sequencer Forums › Online Sequencer › Suggestions
« Previous 1 … 38 39 40 41 42 … 48 Next »

Continuous Notes Tool

Thread tools
Continuous Notes Tool
Frank Offline
Grey Hat Script Kiddie who can Compose Music
388 Posts:
 
#1
09-08-2018, 05:01 PM
For those with beefy computers, inspired by https://onlinesequencer.net/forum/showth...p?tid=2904, written in TamperMonkey,
CONTINUOUS NOTES! (Sort of)
Code:
// ==UserScript==
// @name         Continuous sound!
// @namespace    http://tampermonkey.net/
// @version      1.0
// @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.)"));
   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;
       for(j = timeStart; j < timeEnd - length; j += length){
           song.addNote(new Note(song, note.type, j, length, note.instrument));
       }
       song.addNote(new Note(song, note.type, j, timeEnd - j, note.instrument));
       song.removeNote(note);
   }
   SequencerView.repaint()
})();
This replaces all unlocked notes selected (all unlocked notes if no notes are selected) with a bunch of smaller notes with a length you specify.
Run it by using the context menu after downloading TamperMonkey (from https://tampermonkey.net/, stable).
Guide image: [Image: ZDQrzpY]


Kim Wrote:##878337 + https://js-game.glitch.me + Doesnt take peopel serious if their has badly speling gramer puntuatin
Reply
guest Offline
Member
454 Posts:
   
#2
09-08-2018, 05:50 PM
This isn't doing anything for me


my soundcloud
Reply
guest Offline
Member
454 Posts:
   
#3
09-08-2018, 05:52 PM
It works on the console, but not Tampermonkey


my soundcloud
Reply
Frank Offline
Grey Hat Script Kiddie who can Compose Music
388 Posts:
 
#4
09-08-2018, 07:19 PM
(09-08-2018, 05:52 PM)Guest Wrote: It works on the console, but not Tampermonkey

Describe your problem. Be specific.


Kim Wrote:##878337 + https://js-game.glitch.me + Doesnt take peopel serious if their has badly speling gramer puntuatin
Reply
guest Offline
Member
454 Posts:
   
#5
09-08-2018, 07:22 PM
When I load the new script, it doesn't do anything


my soundcloud
Reply
Frank Offline
Grey Hat Script Kiddie who can Compose Music
388 Posts:
 
#6
09-08-2018, 07:37 PM
(09-08-2018, 07:22 PM)Guest Wrote: When I load the new script, it doesn't do anything

Did you right click to pull up the context menu? What do you mean by "load"?


Kim Wrote:##878337 + https://js-game.glitch.me + Doesnt take peopel serious if their has badly speling gramer puntuatin
Reply
Ben Offline
Extra Olive Oil
252 Posts:
 
#7
09-09-2018, 09:59 AM
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


Reply
Frank Offline
Grey Hat Script Kiddie who can Compose Music
388 Posts:
 
#8
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
Reply
Ben Offline
Extra Olive Oil
252 Posts:
 
#9
09-09-2018, 06:22 PM
Hey Frank, thanks so much, this is really cool, I hope people will use this in creative ways in the future.


Reply



Users browsing this thread:   1 Guest(s)


  •  Return to Top
  •  Contact Us
  •   Home
  •  Lite mode
© Rush Crafted with ❤ by iAndrew
Powered By MyBB, © 2002-2025 MyBB Group.
Linear Mode
Threaded Mode
View a Printable Version
Subscribe to this thread
Add Poll to this thread
Send thread to a friend