Randomizing MIDI Notes
-
@Christoph-Hart got it going!... Is there a way to change the note position instead of transposing them?
-
Yeah, sure, just adjust the timestamp.
-
@Christoph-Hart
So I did... (and I may be way off with this)if(note.isNoteOn()) note.setTimestamp(Math.randInt(3, 6));
but it just stretched them all from the start point.
-
note.setTimestamp(note.getTimestamp() + Math.randInt(3, 6));
But unless you have super powers, you won't hear the timing differences of 0.00015 seconds :)
-
@Christoph-Hart said in Randomizing MIDI Notes:
note.setTimestamp(note.getTimestamp() + Math.randInt(3, 6));
But unless you have super powers, you won't hear the timing differences of 0.00015 seconds :)
Haha... Thank you, I got it rolling now! With a more realistic timing difference.
-
@Christoph-Hart
Is it possible to kind of add a more predictable randomization to the notes?
like set the transpose to go up or down 12st (nothing in between) or shift the notes forward or back a certain amount? Or an I asking for to much lol?Ive been trying to figure out how the seconds (EX.(-200000.50000, 0.50000)) work and how I could use that to accomplish my goal.
-
Up or down 12st:
Message.setTransposeAmount(Math.random() > 0.5 ? 12 : -12);
The timestamp unit is sample rate, so you need to use
Engine.getMillisecondsForSamples()
to get the second amount (there are also other conversion functions in theEngine
object that you can use to get tempo based values. -
This post is deleted! -
This post is deleted! -
This post is deleted! -
This post is deleted!