Anders Gunnarsson wrote:
> Hello!
> 
> I have two questions regarding script writing.
> 
> 1. How can I check if a player is currently located on the cue point
> from a script? I other words how can I in a custom cue handler decide
> if I should set a cue point or start cue-playing?
> 
> 2. If I send multiple midi-messages in a row from a script like below,
> only a few seem to reach my Hercules RMX controller. In fact if two
> messages are sent after another one can almost be sure that the second
> won't affect the controller. If the second is put on a 20ms timer one
> can almost be sure that it does. Has this behavior been seen on other
> controllers as well, or can someone give it a try to verify what
> happens?
> 
> -----
>     for ( var led in leds) {
>        midi.sendShortMsg(0xB0,led,ledOff);
>     }
> -----

Yes, I've seen this on the Hercules Mk2 as well. I did some work on the
script for it involving a function to turn on/off all LEDs on init,
purely as an "I've just booted" type thing. With no delay between midi
messages for each LED only some would turn on/off so I ended up sticking
in a 10ms pause between messages:

    for (LED in HerculesMk2.leds) {
        HerculesMk2.setLed(LED,onOff);
        // Seems that if midi messages are sent too quickly, leds don't behave
        // as expected. A pause rectifies this.
        HerculesMk2.pauseScript(10);
    }

HerculesMk2.pauseScript = function(ms) {
    startDate = new Date();
    currentDate = null;

    while(currentDate-startDate < ms) currentDate = new Date();
};

This actually make for quite a nice "wave" of LEDs on/off for init eye
cancy but is obviously not what you want to have to do in other
circumstances.

This was discussed a bit in the "Odd happenings with Hercules MK2"
thread, but think it was left as:

>> The only conclusion I can draw is that if the device receives a load of
>> >> midi messages too quickly it can't cope/loses some.
> >
> > What OS are you on? We've seen this on Linux with the SCS.3d as
well: https://bugs.launchpad.net/mixxx/+bug/342952
> > So I think it's related to the MIDI subsystem rather than the device
itself.

Interesting. I'm on Ubuntu Studio 8.10 (Intrepid).

> >
> > We need someone who knows the ALSA API to take a look at this.
> >

I've not had time to be actively involved in Mixxx of late so have only
been giving the list a cursory glance every now and again, and anyhow,
I'm fine with JS/XML/MIDI etc. but debigging MIDI issues is out of my
sphere.

Cheers,

Jim.

> 
> //Anders
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Mixxx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
> 
> 

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to