MIDI-OX User Forum (http://www.midiox.com/cgi-bin/yabb/YaBB.pl)
MIDI-OX >> Scripting Questions >> Note length methods
(Message started by: charlesrthompson on Mar 7th, 2009, 10:23pm)

Title: Note length methods
Post by charlesrthompson on Mar 7th, 2009, 10:23pm
I may very well have overlooked this in the forums... if so I apologize in advance.

I'm trying to determine  a best method for using OutputMidiMsg to trigger a note for a certain duration (for argument sake let's say 1 second instead of getting into bpm and note lengths) then generate a next note for 1 sec, etc.

So the smaller question is: How can I do something like this:

CFGA  with each note being 1 second

And the larger question is: Is it possible to do this as a duo?

C D C A G A C A Each note is 1 second
C - F - G - A - each note is 2 seconds

In some languages I might do this through a function call with some type of timing loop but not sure if there are better ways in WScript.

Title: Re: Note length methods
Post by msalmon on Nov 23rd, 2009, 10:44am
I would try the following

<loop or sink function>
  OutputMidiMsg (note on..)
  WSH.Shell(1000)
  OutputMidiMsg (note off..)
</loop>
I read somewhere that sysex uses buffers, but I don't think the other midi data is buffered so i think the above should work

Title: Re: Note length methods
Post by monkeyboi on Mar 13th, 2010, 6:25am
WScript.Sleep() is the function you're looking for. I'm pretty sure it will work because I use the sleep() function in VMM to set note lengths.

http://devguru.org/technologies/wsh/17382.asp



MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.