Menu

#9 Empty variable names on the lhs of a rule

1.0
closed
nobody
None
2015-06-02
2015-05-31
No

According to the documentation in default.omm, variable names on the left-hand side of a rule can be omitted if they aren't used anywhere. So if I'm not mistaken then the following should work:

/1/xy1 ff, val,  : controlchange( 1, 1, 127*val );
/1/xy1 ff, , val : controlchange( 1, 2, 127*val );

But it yields:

$ osc2midi -v -m test.omm 
Using map file test.omm
pair created: /1/xy1 ff, a, x2 : controlchange( 1, 1, 127.00*a )
pair created: /1/xy1 ff, x1, x2 : controlchange( 1, 2, y3 )

The first pair looks all right, but note the unbound variable y3 in the second pair. There's clearly something wrong there. (I've attached this example as test.omm below.)

In contrast, using the dummy variable _ instead of an empty variable:

/1/xy1 ff, val, _ : controlchange( 1, 1, 127*val );
/1/xy1 ff, _, val : controlchange( 1, 2, 127*val );

This gives the intended result:

$ osc2midi -v -m test.omm 
Using map file test.omm
pair created: /1/xy1 ff, a, x2 : controlchange( 1, 1, 127.00*a )
pair created: /1/xy1 ff, x1, b : controlchange( 1, 2, 127.00*b )
1 Attachments

Discussion

  • ssj71

    ssj71 - 2015-06-01

    resolved in commit 246a612

     
  • ssj71

    ssj71 - 2015-06-01
    • status: open --> closed
     
  • Albert Graef

    Albert Graef - 2015-06-02

    Works great, thanks!

     

Log in to post a comment.