Jump to content


Photo

New Tool (3.1) xRules

midi performance live coding

  • Please log in to reply
88 replies to this topic

#1 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 29 February 2016 - 14:39

expanded_mode_lua.png
 
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


Edited by danoise, 10 May 2016 - 22:04.

  • jiku, Djeroek, TheBellows and 9 others like this

Tracking with Stuff. API wishlist | Soundcloud


#2 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3333 posts
  • Gender:Male

Posted 29 February 2016 - 14:47

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.

 

 

 


--> Lua For Beginners <--
--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#3 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 29 February 2016 - 14:57

@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

 

Wil turn into this (default, empty ruleset)

expanded_mode.png

 

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


Tracking with Stuff. API wishlist | Soundcloud


#4 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 29 February 2016 - 15:17

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

 

So we can have any combination of IF ... AND... OR ... THEN, but no "ELSE" :-)


Tracking with Stuff. API wishlist | Soundcloud


#5 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2801 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 29 February 2016 - 16:03

Simply WOW!  :blink:  :w00t:



#6 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6660 posts
  • Gender:Male
  • Location:Borneo

Posted 29 February 2016 - 17:50

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? 



#7 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 29 February 2016 - 18:32

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. 

Tracking with Stuff. API wishlist | Soundcloud


#8 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2801 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 29 February 2016 - 18:40

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 :P


Edited by ffx, 29 February 2016 - 18:48.


#9 Neurogami

Neurogami

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 534 posts
  • Gender:Male
  • Location:Scottsdale AZ
  • Interests:Art, music, technology

Posted 29 February 2016 - 19:18

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 :P

 
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.

Edited by Neurogami, 29 February 2016 - 19:44.


#10 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3333 posts
  • Gender:Male

Posted 29 February 2016 - 19:26

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

 

Yep, got it now thanks


--> Lua For Beginners <--
--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#11 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2801 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 29 February 2016 - 19:28

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 likes this

#12 Neurogami

Neurogami

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 534 posts
  • Gender:Male
  • Location:Scottsdale AZ
  • Interests:Art, music, technology

Posted 29 February 2016 - 19:43

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.

#13 fladd

fladd

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1177 posts
  • Gender:Male
  • Location:The Netherlands

Posted 29 February 2016 - 22:39

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

ozZQNtn.png



#14 mattnasty

mattnasty

    Advanced Member

  • Normal Members
  • PipPipPip
  • 108 posts
  • Gender:Male
  • Location:Bay Area California
  • Interests:surfing, culture, decisions, time-travel, djing, reading

Posted 01 March 2016 - 21:50

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!



#15 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 01 March 2016 - 22:44

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 :-)


  • fladd likes this

Tracking with Stuff. API wishlist | Soundcloud


#16 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 01 March 2016 - 23:31

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, xStream does this. Similar approach, they even share much of the same codebase...
 


Tracking with Stuff. API wishlist | Soundcloud


#17 mattnasty

mattnasty

    Advanced Member

  • Normal Members
  • PipPipPip
  • 108 posts
  • Gender:Male
  • Location:Bay Area California
  • Interests:surfing, culture, decisions, time-travel, djing, reading

Posted 02 March 2016 - 03:14

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.



#18 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 02 March 2016 - 15:28

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. 


Tracking with Stuff. API wishlist | Soundcloud


#19 mattnasty

mattnasty

    Advanced Member

  • Normal Members
  • PipPipPip
  • 108 posts
  • Gender:Male
  • Location:Bay Area California
  • Interests:surfing, culture, decisions, time-travel, djing, reading

Posted 03 March 2016 - 06:46

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



#20 slippycurb

slippycurb

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 515 posts
  • Gender:Male
  • Location:Ireland Co Galway
  • Interests:My interests change from day to day, but i always like eggs.

Posted 03 March 2016 - 16:24

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..


Edited by slippycurb, 03 March 2016 - 16:24.

"No one would have believed, in the last years of the nineteenth century, that this world was being watched keenly and closely by intelligences greater than man's and yet as mortal as his own;"


SuckOnThisElectronicEgg


https://www.facebook...ristiansvslions

#21 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 03 March 2016 - 18:37

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..

 

Sure, here is how I would do it 

 

cc_to_note.png

 

First, check if message is actually a control change. You can make this more specific - which channel, MIDI port etc.

Next, convert message into a "note_on", and apply second MIDI byte (CC value) to the first one (note pitch)

Finally, output message. 

return {
    {
      actions = {
          {
              call_function = "message_type = \"note_on\"\nvalue1 = value2",
          },
          {
              output_message = 1,
          },
      },
      conditions = {
          {
              message_type = {
                  equal_to = "controller_change",
              },
          },
      },
    }
}
Copy the text above and select xRules > Add > Paste from clipboard

Tracking with Stuff. API wishlist | Soundcloud


#22 slippycurb

slippycurb

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 515 posts
  • Gender:Male
  • Location:Ireland Co Galway
  • Interests:My interests change from day to day, but i always like eggs.

Posted 03 March 2016 - 21:56

now isn't that neat :-) Thank you, I added a condition for channel and cc number (106 in my case) and bobs your uncle. I have also mapped cc106 to this motorized love egg I am sitting on.

 

-----------------------------------------------------------
-- Ruleset definition for xRules
-- Visit http://www.renoise.com/tools/xrules for more info
-----------------------------------------------------------
return {
osc_enabled = false,
manage_voices = false,
description = "",{
  actions = {
      {
          call_function = "message_type = \"note_on\"\nvalue1 = value2",
      },
      {
          output_message = 1,
      },
  },
  conditions = {
      {
          message_type = {
              equal_to = "controller_change",
          },
      },
      {
          channel = {
              equal_to = 1,
          },
      },
      {
          value1 = {
              equal_to = 106,
          },
      },
  },
}
}


Edited by slippycurb, 03 March 2016 - 21:57.

  • danoise likes this
"No one would have believed, in the last years of the nineteenth century, that this world was being watched keenly and closely by intelligences greater than man's and yet as mortal as his own;"


SuckOnThisElectronicEgg


https://www.facebook...ristiansvslions

#23 mattnasty

mattnasty

    Advanced Member

  • Normal Members
  • PipPipPip
  • 108 posts
  • Gender:Male
  • Location:Bay Area California
  • Interests:surfing, culture, decisions, time-travel, djing, reading

Posted 08 March 2016 - 02:00

I'm having an issue selecting the  value of a condition. The drop down list appears, but then whatever is selected instantly reverts to the first possible selection. It used to not do this. I guess I'll reinstall the tool and see if it works normally. Weird. Im on Win7 if that matters.

 

Is there any intention to implement transport controls/MMC or sysex?

 

How would one filter  incoming notes via LUA? CCs get passed through, given x condition of course.



#24 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6106 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 08 March 2016 - 11:04

Hm, I don't know if re-installing the tool helped you, but from my perspective there might still be some problem, somewhere. 

So, I would be interested to hear if you experience this problem again...

 

Is there any intention to implement transport controls/MMC or sysex?

 
Absolutely, and I want to add a few extra conditions that should be especially useful with sysex
* WHEN on_new_document 
* WHEN on_tool_initialize
* WHEN on_song_initialize [+ song name]
 
So you could set up the tool in a particular way whenever the tool initializes, or if you load a particular song. 

And of course, sysex would not support the full spectrum of conditions & actions. Only "equal to/not equal to", and "set" would be available.  

 

As for MMC, strictly speaking they are also a special kind of sysex message, and I consider implementing them in a way similar to Duplex.

Basically, check if MMC before forwarding to Renoise. If true, simulate the effect by taking control of the transport. 

This needs to be done because "raw" MMC messages are not picked up when sending them via the internal MIDI. 

 

How would one filter  incoming notes via LUA? CCs get passed through, given x condition of course.

 

Just like any other property "when note-on and note is between C-4 and C-5" ? 


Tracking with Stuff. API wishlist | Soundcloud


#25 iseeclouds

iseeclouds

    Member

  • Normal Members
  • PipPip
  • 51 posts
  • Gender:Not Telling
  • Location:Belgium

Posted 09 March 2016 - 00:33

I'm probably just overlooking something. But can't get the rules to work when I'm making MIDI mappings.

naamloos1-e1457479852648.jpg







Also tagged with one or more of these keywords: midi, performance, live coding