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

Bugfix, left-factoring of mapping rules. #17

Merged
merged 2 commits into from
Jun 30, 2015
Merged

Conversation

agraef
Copy link
Contributor

@agraef agraef commented Jun 30, 2015

Commit 308b45b fixes a rather awful bug which probably got unveiled by commit 0d895bc, causing osc_map fields to remain uninitialized. I'd say that this is critical enough to warrant a new point release.

As a bonus, commit ee3ec6b lets you leave out the left-hand side osc message of a rule if it's the same as for the previous rule. This saves a lot of typing in cases where a single osc message maps to an entire collection of different midi messages. E.g.,

/multi/{i} ff, touch,x,y : controlchange( channel, touch, x*127);
/multi/{i} ff, touch,x,y : controlchange( channel, touch+10, y*127);

may now be written as:

/multi/{i} ff, touch,x,y : controlchange( channel, touch, x*127);
                         : controlchange( channel, touch+10, y*127);

(The whitespace at the beginning of the second line is purely cosmetic, of course.)

I'd say that this is rather convenient. The only downside is that an osc message path may not start with a colon any more, but I consider this rather unlikely anyway. What do you think?

This allows to abbreviate a collection of rules where the same OSC message is
mapped to different MIDI messages. E.g.,

    /multi/{i} ff, touch,x,y : controlchange( channel, touch, x*127);
    /multi/{i} ff, touch,x,y : controlchange( channel, touch+10, y*127);

may now be written as:

    /multi/{i} ff, touch,x,y : controlchange( channel, touch, x*127);
    : controlchange( channel, touch+10, y*127);

Note that the latter simply gets expanded to the former. There's no change in
semantics (except that an OSC message path can't start with a colon any
longer, but that's rather unlikely anyway).
@ssj71
Copy link
Owner

ssj71 commented Jun 30, 2015

looks good. I'd thought about implementing left factoring but hadn't really come up with a good way to do it. Thanks!

ssj71 added a commit that referenced this pull request Jun 30, 2015
Bugfix, left-factoring of mapping rules.
@ssj71 ssj71 merged commit d95a240 into ssj71:master Jun 30, 2015
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

Successfully merging this pull request may close these issues.

2 participants