Jump to content

AinTunez

Member
  • Posts

    4
  • Joined

  • Last visited

AinTunez's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Aha, the beatPos property is what I was looking for! I actually have a compensator for the NoteOffs in the full version, I just cut it down so you didn't have to dig through it for the relevant parts. Thanks much.
  2. Okay, here's my issue. I have this script (below) that calculates every half beat and adds "swing" to any notes falling there. The trouble is, the beat position isn't always accurate. I found a partial solution in this thread (viewtopic.php?t=128908), which seemed to work at first, but the values are all thrown off when a different track is selected. Help! What's the best way to find the current position so I can detect notes falling on half beats? PluginParameters = [{name: 'Swing %', minValue: 0, maxValue: 30, numberOfSteps: 60, defaultValue: 20},]; NeedsTimingInfo = true; var beat = 0; function HandleMIDI (e) { if (e instanceof NoteOn) { var delay = GetParameter('Swing %')/100; processNoteOn(e, delay); } else { e.send(); } } function processNoteOn(e, delay) { if (isSwingPosition() && delay > 0) { e.sendAfterBeats(delay); } else { e.send(); } } function isSwingPosition() { Trace('BEAT: ' + beat); return beat.toString().slice(-2) == '.5'; } function ProcessMIDI () { var info = GetTimingInfo(); var curr = Math.ceil(info.blockStartBeat * 24) / 24; if (info.playing && beat !== curr) beat = curr; }
  3. I was being dumb. Gonna post a new thread with the ACTUAL problem.
×
×
  • Create New...