Created
April 28, 2017 01:45
-
-
Save hatzka-nezumi/24ba99fb9b31a11f3730644a4cfb0b34 to your computer and use it in GitHub Desktop.
Logic humanizer plugin (for Scripter)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copyright 2017 ViKomprenas - Creative Commons Zero | |
var PluginParameters = [ | |
{ | |
name: "Velocity Range", | |
type: "lin", | |
defaultValue: 6, | |
minValue: 0, | |
maxValue: 127, | |
numberOfSteps: 127 | |
}, | |
{ | |
name: "Maximum Note Delay (ms)", | |
type: "lin", | |
defaultValue: 30, | |
minValue: 0, | |
maxValue: 1000, | |
numberOfSteps: 1000 | |
} | |
]; | |
function HandleMIDI(event) | |
{ | |
if (event instanceof NoteOn || event instanceof NoteOff) { | |
const velRange = GetParameter("Velocity Range"); | |
event.velocity += Math.round(Math.random() * velRange - (velRange / 2)); | |
if (event instanceof NoteOn) | |
event.sendAfterMilliseconds(Math.round(Math.random() * | |
GetParameter("Maximum Note Delay (ms)"))); | |
else | |
event.send(); | |
} else { | |
event.send(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment