New Tool (3.1) xRules

expanded_mode_lua.png?raw=1

What is xRules?
xRules lets you rewrite and transform incoming MIDI/OSC messages on-the-fly, using a visual programming interface. Outgoing messages can be routed into Renoise, or passed on to external devices.

Why xRules?
The motivation for creating this tool was to create an environment in which it was easy to define some custom behavior and exchange this with other users (or multiple Renoise installations). Everything xRules does is described as a simple lua table, which you can save, export, import and copy/paste as you like.
Also, the tool represents the culmination of my efforts to streamline code from my library projects, xLib and vLib as well as Duplex. As a result, it has a pretty snazzy user interface and powerful MIDI handling (including NRPN, 14bit message support)

How to use it?
Check the documentation and source code (on github)

Download and examples
https://www.renoise.com/tools/xrules

Looks interesting!

Tried to download however and got:

Page not found

The requested page ā€œ/sites/default/files/tools/com.renoise.xRules.v0.5.API5_.xrnxā€ could not be found.

@ledger: Works here. Try again? (might have been a small server hiccup).

Oh, and I just noticed that, when the tool starts from a fresh install itā€™s actually in a disabled state. You can see this, as the logo is crossed out. Once you add a few rules, it should enable itself (you can actually control this from the options dialog)

Also, donā€™t miss out on the small ā€˜squareā€™ button in the right side (toggle expanded/compact UI)
compact_mode.png?raw=1

Wil turn into this (default, empty ruleset)
expanded_mode.png?raw=1

I really should make it so that, when the tool is freshly installed it will auto-expand once some rules arrive.

Another thing worth pointing out (because itā€™s not obvious):
Conditions can be either AND / OR - you can toggle this by clicking the labels:

condition_or_and_toggle.gif?raw=1

So we can have any combination of IF ā€¦ ANDā€¦ OR ā€¦ THEN, but no ā€œELSEā€ :slight_smile:

Simply WOW! :blink: :w00t:

looks deep, too l33t for me B) ,

could this tool be used to record the note-event output of a midi generating plugin into the pattern editor?

Or perhaps send an midi-arpeggiator vst output to multiple instruments at the same time?

could this tool be used to record the note-event output of a midi generating plugin into the pattern editor?

Or perhaps send an midi-arpeggiator vst output to multiple instruments at the same time?

Hm, any lua tool only can pick up messages if they arrive from the ā€˜outsideā€™ = external MIDI. So, to capture such stuff youā€™d need to set up a loop-back device. There is a miniscule amount of latency involved, would be interesting to see if this was in fact useful (I know some people have experimented with this).

But yeah, then everything xRules does would be possible, also with arpeggiators and stuff.

I would like to suggest a simple note counter that you can check and reset.

Also, is it possible the xRules processes already recorded and replayed notes just like a midi fx? That would be awesomeā€¦ :drummer:

Also, this tool IMO is no excuse for the Renoise team not to implement a proper midi routing, like a feedback port, multiple routings by channel etc. danoise cannot workaround all missing features in Renoise basically :stuck_out_tongue:

Also, this tool IMO is no excuse for the Renoise team not to implement a proper midi routing, like a feedback port, multiple routings by channel etc. danoise cannot workaround all missing features in Renoise basically :stuck_out_tongue:

Counterargument: Iā€™d prefer to see see such features maintained as add-ons and extensions so that a ) the core of Renoise is easier to maintain, and B ) these additional features can get improvements and bug-fixes independent of official releases of Renoise itself.

That said, there may be performance improvements or additional behavior made available if a feature is implemented in native code as part of Renoise. But unless thereā€™s a compelling reason to roll a tool into the core it might work out better being an add-on.

@ledger: Works here. Try again? (might have been a small server hiccup).

Yep, got it now thanks

Neurogami, I would agree with you, if the LUA api really was capable of precisely and efficiently doing such things like live note mangling.

There was a screenshot on imgur of the Renoise source in a devtoolsā€¦ Donā€™t know url anymore. It didnā€™t seem to take advantage of a sophisticated class structure (like base dsp, inherited dsp etc), but seemed to have a quite flat structure. So maybe thatā€™s the reason, why the team doesnā€™t seem to be tremendously motivated to make Renoise a perfect DAW? Maybe they should rethink the base concept first? Also must be a pain to do this for three OSā€¦

Neurogami, I would agree with you, if the LUA api really was capable of precisely and efficiently doing such things like live note mangling.

Yeah, thatā€™s the catch.

There was a screenshot on imgur of the Renoise source in a devtoolsā€¦ Donā€™t know url anymore. It didnā€™t seem to take advantage of a sophisticated class structure (like base dsp, inherited dsp etc), but seemed to have a quite flat structure. So maybe thatā€™s the reason, why the team doesnā€™t seem to be tremendously motivated to make Renoise a perfect DAW? Maybe they should rethink the base concept first? Also must be a pain to do this for three OSā€¦

Itā€™s amazing how a code-base can get complex and gnarly, even when you KNOW that code-bases tend to get complex and gnarly and you try to stay organized.

Sometimes a datastruct decision that made perfect sense at the time comes to bite you in the ass later.

The tool fails to load on Renoise startup.
Linux Mint 17.3 Xfce

It seems the listed input rules are way more specific than the output rules, excluding call_function. For example CC10 on chan15 with a value greater than 64 has a pretty limited output unless a specific lua function is coded. A more comprehensive/commonly sought list of outputs would be desirable- maybe sort of like lua ā€œpresetsā€, similar to how the pattern effect commands are selectable from the edit gui, not just entered via text. Also a handy way to copy and paste input and output conditions would be nice. In its current state the tool is great for 5 midi transformations, not great for entering/programming 125. Awesome tool though!

It seems the listed input rules are way more specific than the output rules

Having such a visual interface is mostly about being able to create a rule without having to consult a user manual each time.So, if I understand you right then really, all the tool would need was the existence of a custom input function, similar to the output function. Then we would truly have ā€œbest of both worldsā€. More than anything else, I want this tool to be_useful._

Speaking of useful: 125 transformations - wait, what? I guess youā€™re talking about some very specific purpose here. Would that be solved with an input / output function? Andā€¦ mmmā€¦ I guess those functions would need to share share variables among each other?

The tool fails to load on Renoise startup.
Linux Mint 17.3 Xfce

Iā€™ve been without a linux machine for a while now. You just gave me a reason to install Mint :slight_smile:

I would like to suggest a simple note counter that you can check and reset.

A note counter could be done simply by having a function which contain a counter (a variable). So, for each incoming note you could increase the pitch, etc.

But thereā€™s a missing element (still waiting to get implemented), because you would easily end up with hanging notes - as the incoming note(offs) would not be the same pitch as the outgoing ones. So, to work around this xRules needs to have a voice manager, something which could automatically keep track of incoming notes, and - if they are triggering a voice - keep track of when the original note gets released. Even if you can pull this off in xRules now, itā€™s obviously a task better handled by the tool itself.

Actually, the whole project started last summer as I was talking to a friend (drummer) who wanted to create a performance with a big element of ā€œchanceā€. Basically he could be playing an edrum kit and, for every note/strike, a different sound (random or otherwise) could get triggered. And while you can do this with Renoise and maybe commands, keyzone cycle and whatnot, itā€™s not that simple if you need to output to MIDI hardware. And even if xRules can do this now, itā€™s a question of whether the receiving end - whatever hardware that might be - will eventually choke on all those notes. I brainstormed a bit with Neurogami during the development, and he had experienced similar problems processing notes from a Kinect device.

So, thereā€™s clearly some important stuff still on the TODO list, but I also wanted to release it and get a discussion going.

Also, is it possible the xRules processes already recorded and replayed notes just like a midi fx? That would be awesomeā€¦

Well, xStreamdoes this. Similar approach, they even share much of the same codebaseā€¦

Having such a visual interface is mostly about being able to create a rule without having to consult a user manual each time.So, if I understand you right then really, all the tool would need was the existence of a custom input function, similar to the output function. Then we would truly have ā€œbest of both worldsā€. More than anything else, I want this tool to be_useful._

Speaking of useful: 125 transformations - wait, what? I guess youā€™re talking about some very specific purpose here. Would that be solved with an input / output function? Andā€¦ mmmā€¦ I guess those functions would need to share share variables among each other?

I actually meant sort of the opposite. I think the output should have a broader palette of output presets. Custom is great and endless really, but perhaps some functions may get used over and over again. Manual entry vs selecting a stored preset and tweaking.

And i meant 125 rulesā€¦oopsā€¦, not transformations. If I have 4 conditions with a 3 action output and I want to apply it to another CC for instance, then thats another 7 steps to copy it. If I have to do that for 16 rules, it becomes very tedious. Copying condition groups and output action groups is essential. Again, manual entry vs copy/paste and tweak.

And i meant 125 rulesā€¦oopsā€¦, not transformations. If I have 4 conditions with a 3 action output and I want to apply it to another CC for instance, then thats another 7 steps to copy it. If I have to do that for 16 rules, it becomes very tedious. Copying condition groups and output action groups is essential. Again, manual entry vs copy/paste and tweak.

Sure, if you are doing something which is functionally similar many times over. But, you can always copy the file itself, itā€™s just a basic lua table.

Perhaps you could take some time to explain the actual setup you are thinking of?

Also, I have considered to implement a ā€œsend deviceā€ which could route messages to a different rule (or even ruleset). Pretty sure this would be the most flexible approach.

Sure, if you are doing something which is functionally similar many times over. But, you can always copy the file itself, itā€™s just a basic lua table.

Perhaps you could take some time to explain the actual setup you are thinking of?

Also, I have considered to implement a ā€œsend deviceā€ which could route messages to a different rule (or even ruleset). Pretty sure this would be the most flexible approach.

The simple-ish explanation:

Iā€™ve made a Renoise template that makes the Arturia Beatstep Pro a 16 channel sampler/sequencer/groovebox. The sequence runs within the BSP. The editing of the samples is done via the BSP control mode, which effectively turns all buttons and knobs of the BSP into midi controls on a given channel- therefore 16 channels are available. So for instance the sequence of Drum Pad 1 is editabe via MIDI channel1 of the control mode; drum pad 2 is editable on midi channel2, etc. Sample select, vol, pitch, pan, lpf cutoff, lpf res, send 1, 2,3, lfo amount/shape/rate to send 1,2,or 3 are all of the editable parameters. The only real midi ā€œtrickā€ is that the sample select has to run an incoming CC to the piz midi transpose(mapped via doofer) before hitting the sampler intsrument. (It had to work this way due to the BSP design) So transforming a relative CC to a note transpose for each specific channel x16 is the goal. This is simply one example that Iā€™m currently working on.The template is pretty much done, but if I could create one using only ā€œnativeā€ Renoise devices and not the piz plugs, that would be preferred. Most param edits are fine with midi mapping, but some work better with a midi transformer.

It is exactly functionally similar many times over, because each drum pad has a corresponding midi channel that adjusts certain parameters. I never thought of copying the file itself, and that is the best solution I think. An internal clipboard wouldnt be a bad addition either- if it is possible?

The send device sounds awesome! It would be like a doofer or macro of xrules! Thanks again for the great work

Is it possible to map a cc (knob) to notes using this tool? Id like to control the scenes in Glitch 2 with a knob rather than keysā€¦could be funā€¦