"Wait Loop" executes on beat 2 not beat 1 of loop

samedi 27 février 2016

I'm confused by the "wait" function. The documentation is lacking with it but I gather that when
Code:

wait loop
is executed, it's supposed to wait until the start of the new loop and do whatever comes next. This is kind of working but my MIDI message is being sent on beat 2 of the bar instead of beat 1.

I'm sending midi out into a Teensy micro controller and wherever there isn't a wait call it executes whenever the action happens, but when wait loop is called it waits until the end of the bar, then executes on beat 2 which is really bizarre to me.

I'm building a Teensy foot controller with an RGB LED that does a different color per mode, which I'm doing by sending midi signals from mobius. The idea is to flash the next mode's color when waiting for the quantized sync to come around and start the function, so if I'm on RESET and click RECORD it sends the first MIDI signal, then when it actually goes into record it sends the second MIDI signal which it is doing technically just on beat 2...

It's driving me batty. Any thoughts?

Code:

!name Rec/Play/Overdub
!autoload
!sustain 500

if mode == reset
    MidiOut noteon 10 50 127
    Record
    wait loop
    MidiOut noteon 10 51 127   
else
        if mode == mute
                Reset
                Record
        else
                if mode == play
            if loop != empty
                Overdub
                MidiOut noteon 10 60 127
            else if
                Record
                MidiOut noteon 10 51 127
            endif
        else
            MidiOut noteon 10 70 127
                        if mode == overdub
                                Play
                MidiOut noteon 10 71 127
                        else       
                                if mode != reset   
                    wait loop
                                        Play
                    MidiOut noteon 10 71 127
                                endif
                        endif
                endif
        endif
endif
end


Label sustain
if sustainCount = 1
    Reset
    MidiOut noteon 10 80 127
endif
end



0 commentaires:

Enregistrer un commentaire

 

Lorem

Ipsum

Dolor