Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range values are not working with indexed event conditions #24

Open
mhthies opened this issue Jan 6, 2021 · 1 comment
Open

Range values are not working with indexed event conditions #24

mhthies opened this issue Jan 6, 2021 · 1 comment

Comments

@mhthies
Copy link

mhthies commented Jan 6, 2021

The following event binding configuration does not work:

    <binding input="midicontroller" conditions="controlnum=1>7 and midichannel=0" 
     output="set-loop-amplifier" 
     parameters="loopid=VAR_my_loopid+controlnum-1 and
                 amp=controlval/127.0*2.0"/>

It is not triggered when the relevant MIDI events are received (control change event with control=1 on MIDI channel 0) and results in the following warning in the log at freewheeling's start:

 binding: input 'midicontroller'
 UserVariable: WARNING: Can't convert range to scalar!
         -condition 'controlnum' == 0>7
         -condition 'midichannel' == 0
       -> output 'set-loop-amplifier'
         -set 'loopid' = 'VAR_my_loopid'[350]+'controlnum'-1
         -set 'amp' = 'controlval'/127.00*2.00

If I declare a new UserVariable for storing the value range and use that variable in the binding condition, the log warning disappears, but the event binding does still not work:

    <declare var="VAR_my_range" type="range" init="0>7" />
    <binding input="midicontroller" conditions="controlnum=VAR_my_range and midichannel=0" 
     output="set-loop-amplifier" 
     parameters="loopid=VAR_my_loopid+controlnum-1 and
                 amp=controlval/127.0*2.0"/>

Tested with freewheeling version 0.6.6 on JACK 0.125.0 on ArchLinux.

After quickly diving into freewheeling's source code, I assume that this behaviour is caused by the max_index parameter of the EventParameter object, which is used for creating a hash index table for the parameter.

@bill-auger
Copy link
Member

bill-auger commented Jan 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants