What's new

Is disallow group is per note callback?

d.healey

Libre Wave
Something I've not come across before - just because the situation has never come up. But if I disallow all groups in the note callback when C0 is pressed, and then press another note the groups are all allowed again even though I haven't put allow_group anywhere.

So I'm guessing disallow_group and probably allow_group only apply to each callback when they are triggered, is that correct?
 
So I'm guessing disallow_group and probably allow_group only apply to each callback when they are triggered, is that correct?
It's correct.
If you try to use the C0 as some sort of Key switch which has to disallow the all groups while it is held down and you play other notes try next code:
Code:
on note
    while(%KEY_DOWN[24] = 1) {C0(#24) note held}
    disallow_group($ALL_GROUPS)
    wait(10)
    end while
end on

There is one more scenario if you want to not to hold down the C0 and use it as a real Toggling switch ( 1= ON an 0=OFF) i.e once you press C0 (ON), next C0 press (OFF) and so on.
Here it is:
Code:
on init
  declare $C0_flag
end on

on note
  if ($EVENT_NOTE=24)
    $C0_flag := 1-$C0_flag
  end if
  if ($C0_flag=1)
    disallow_group($ALL_GROUPS)
  end if
end on

Regards
____________________
www.audiogrocery.com
 
Top Bottom