Jump to content


Photo

New Tool (3.1) xRules

midi performance live coding

  • Please log in to reply
94 replies to this topic

#76 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 29 August 2016 - 16:29

I can insert MidiNotesToCC as FX plugin on the track or inside the plugin, not as a instrument

 

I think it's supposed to be an instrument. At least, this is how it shows up on my system. 

I downloaded the "complete" pizmidi_x64.zip bundle, using x64 builds for Windows, both plugin + Renoise - no sandboxing.


Tracking with Stuff. API wishlist | Soundcloud


#77 Akiz

Akiz

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1000 posts
  • Gender:Male

Posted 29 August 2016 - 19:07

Ive unpacked the whole bundle and rescaned plugins.
Still didnt see Notes2cc in synth plugins just in fx plugins. When i selected it Renoise told me (didnt before) something like: "this plugin seems to be synth, restart renoise"
dont know what is going on but after restarting renoise its here and its working. 
Thanks again
 


Edited by Akiz, 29 August 2016 - 20:11.


#78 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 19 posts
  • Gender:Male
  • Location:Hannover, Germany

Posted 19 September 2016 - 21:50

I am an absolute beginner to xRules and lua.
I want to convert incoming MIDI-CC #20 to NRPN to control the cutoff of my Prophet VS.
The attached script is recognizing incoming MIDI-CC #20 and sending a proper NRPN string. But unfortunately I can't figure out how to pass resp. map the incoming MIDI-CC #20 value_2 to the NRPN MIDI-CC #6 value_2.
Can anybody help me?
Thanks a lot in advance.

Attached Files



#79 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 20 September 2016 - 13:30

I want to convert incoming MIDI-CC #20 to NRPN to control the cutoff of my Prophet VS.

 

I can see you're splitting the CC message into multiple messages, to create an NRPN message. 

 

I took a quick look, because the built-in NRPN message should be *way* more comfortable to use. 

But it seems that (and this is probably what threw you off), there is a need to define the following 

bit_depth = 14

(this really shouldn't be necessary but also won't hurt. In this particular case, it seems to make the NRPN message work as intended). 

 

So the way I'd suggest it would be like this (3 steps)

 

1. Define a 'call_function' that configures xRules to output 14-bit NRPN messages

message_type = 'nrpn'
bit_depth = 14

Of course, you could use the 'set_message_type' via the graphical UI too - the snippet above is basically just killing two birds with one stone. 

 

If you need to change, scale values somehow, this can be done as simply as adding the following statements to the code snippet above:

values[1] = 200          -- Number: set to fixed value
values[2] = values[2]*2  -- Data: increase by x2

Splitting into the MSB/LSB parts are done automatically on output. In other words, the message is turned into this kind of message:

-- ### build NRPN message
--  0xBX,0x63,0xYY  (X = Channel, Y = NRPN Number MSB)
--  0xBX,0x62,0xYY  (X = Channel, Y = NRPN Number LSB)
--  0xBX,0x06,0xYY  (X = Channel, Y = Data Entry MSB)
--  0xBX,0x26,0xYY  (X = Channel, Y = Data Entry LSB)

-- TODO optionally, when 'terminate_nrpn' is specified...
--  0xBX,0x65,0x7F  (X = Channel)
--  0xBX,0x64,0x7F  (X = Channel)

2. Define which output port to use ('set_port_name'). 

3. Define the output method ('output_message' -> 'external_midi')

 

Also, check if NRPN is enabled and that the desired output port has been enabled in Preferences > MIDI


  • j(b++) likes this

Tracking with Stuff. API wishlist | Soundcloud


#80 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 19 posts
  • Gender:Male
  • Location:Hannover, Germany

Posted 20 September 2016 - 20:04

Thanks a lot for your helpful advice!
The script is working perfectly. :)

Edited by j(b++), 20 September 2016 - 20:14.


#81 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 19 posts
  • Gender:Male
  • Location:Hannover, Germany

Posted 22 September 2016 - 20:32

I am not quite sure, but I think, that there's a little issue left in my use case.

It arises as soon as I want to modulate two parameters in an interleaved manner.

The Prophet VS expects NRPN as:
Select Parameter LSB (98dec)
Select Parameter MSB (99dec)
Data Entry LSB (38dec)
Data Entry MSB (06dec)

Because the script is transmitting MSB first instead of LSB first, I think the intended modulation is going to be a little messed up.

Ist there a way to swap MSB and LSB in NRPN Messages?

#82 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 23 September 2016 - 12:48

Ist there a way to swap MSB and LSB in NRPN Messages?

 

Sure, I'll make this a global option. Need to put out a new version anyway  :)


Tracking with Stuff. API wishlist | Soundcloud


#83 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 23 September 2016 - 15:57

Done.

 

Install the new version, then go to xRules options > MIDI and expand the NRPN panel to set the MSB/LSB order. 


  • j(b++) likes this

Tracking with Stuff. API wishlist | Soundcloud


#84 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 19 posts
  • Gender:Male
  • Location:Hannover, Germany

Posted 25 September 2016 - 16:56

Working as expected :)

#85 LamptonWorm

LamptonWorm

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 143 posts
  • Gender:Male

Posted 07 October 2016 - 09:05

Hi,

 

Is it possible to configure a simple on/off switch with xRules (with feedback)? For example,

 

IF CC = 20 THEN my_toggle = NOT my_toggle

IF my_toggle = 0 THEN don't light up ELSE light up

 

This is just for lighting up the launchpad - I'd CTRL+M CC #20 and map to say the on/off for a track effect, mute etc.

 

Cheers,

LW.



#86 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 07 October 2016 - 10:45

Sure, add this lua snippet before outputting/routing the message (select 'call function') 

-- run once: initialize our variable
if (type(cc_toggle)=="nil") then
  cc_toggle = false
end

-- respond to press, ignore release
if (values[1] == 20) then
  if (values[2] == 127) then
    cc_toggle = not cc_toggle
  end
  values[2] = cc_toggle and 127 or 0
end

  • LamptonWorm likes this

Tracking with Stuff. API wishlist | Soundcloud


#87 LamptonWorm

LamptonWorm

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 143 posts
  • Gender:Male

Posted 07 October 2016 - 10:47

Brilliant - will try this later, thanks *again* :)

 

Cheers,

LW.



#88 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 16 January 2017 - 01:50

A new release of xRules is ready, v0.79

FIXED xLib: automation class could produce glitchy values [bug]
FIXED xRules: comparison (string, number) could break due to missing cLib reference in sandbox [bug]
FIXED popup dialog titles
CHANGED log window gone (uses the scripting console instead)
FEATURE click toolbar to view source and documentation

It also contains two new rulesets

 

One I made for Athaphian (convert aftertouch to midi-cc)

http://forum.renoise...er/#entry354918

 

And one for LamptonWorm (visual feedback on launchpad)

http://forum.renoise...-row-behaviour/

 

Both are included with xRules (click Add > Locate file on disk > "examples" to find them)


  • ffx and kopias like this

Tracking with Stuff. API wishlist | Soundcloud


#89 kytdkut

kytdkut

    Member

  • Normal Members
  • PipPip
  • 63 posts
  • Gender:Not Telling
  • Location:Buenos Aires

Posted 22 March 2017 - 23:17

Hey danoise thanks for this tool!

 

I did a ruleset to override some of renoise's default actions, kind of. A thing that bothered me about macros is that whenever I map certain macro to a knob, it would control that macro even if that instrument is not selected (this is expected), but if you map that knob to a vst parameter using the vst's mapping functionality (if any) it would only work when the instrument containing the vst is selected (also expected).

 

What I did with your tool is mapping the knobs of my controller to the selected instrument's macros :D this is a think I've been looking for a long time. Oh, and also mapping program changes to selected_instrument_index.

 

-----------------------------------------------------------
-- Ruleset definition for xRules
-- More info @ http://www.renoise.com/tools/xrules
-----------------------------------------------------------
return {
osc_enabled = false,
manage_voices = false,
description = "",
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "Input",
  ["actions"] = {
      {
          ["route_message"] = "Current Ruleset:➜ Notes",
      },
      {
          ["route_message"] = "Current Ruleset:➜ CC",
      },
      {
          ["route_message"] = "Current Ruleset:➜ Macros",
      },
      {
          ["route_message"] = "Current Ruleset:➜ Instr. Selection",
      },
  },
  ["conditions"] = {},
  ["match_any"] = true,
  ["midi_enabled"] = true,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ Notes",
  ["actions"] = {
      {
          ["output_message"] = "internal_raw",
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "note_on",
          },
      },
      {
          2,
      },
      {
          ["message_type"] = {
              ["equal_to"] = "note_off",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ CC",
  ["actions"] = {
      {
          ["output_message"] = "internal_raw",
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "controller_change",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ Macros",
  ["actions"] = {
      {
          ["call_function"] = "renoise.song().selected_instrument:macro(value_1 - 20).value = math.min(1.0, math.max(value_2/127, 0.0))",
      },
      {
          ["output_message"] = 1,
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "controller_change",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ Instr. Selection",
  ["actions"] = {
      {
          ["call_function"] = "renoise.song().selected_instrument_index = values[1]+1",
      },
      {
          ["output_message"] = "internal_auto",
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "program_change",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
}
}

(I don't know how to fold code snipets, sorry for the long post)


I will be slowly adding stuff to this ruleset. In the meantime I would like to know if someone uses this tool to add similar functionality to renoise.


Chau!


  • danoise likes this

#90 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 19 posts
  • Gender:Male
  • Location:Hannover, Germany

Posted 14 September 2018 - 08:52

I am trying to integrate paramter automatization of my Bass Station II in renoise.

Some parameters like Filter Cutoff is implemented as 14 bit MIDI CC. (CC #16 dec. is MSB, CC #48 dec. is LSB).

The BS II sends both CCs of a value pair at the same time (in respect to the MIDI input monitor time stamp), so that renoise doesn't record both of them.

Unfortunately the LSB is stored, so it's not useful.

I want to convert a MIDI CC pair somehow, so useful information could be stored.

 

As far as I understand xRules support 14bit MIDI. How would a rule be defined that reacts on

14bit MIDI CC input whereas

MIDI CC #16 is MSB

MIDI CC#48 is LSB

 

Is it possible to store the LSB a little bit later in the pattern editor than the MSB while recording live?



#91 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 14 September 2018 - 20:42

Is it possible to store the LSB a little bit later in the pattern editor than the MSB while recording live?

 

well, "delaying" a value would be tricky ... what to do when at a pattern boundary, for instance? 

 

Perhaps better and cleaner would be to use xRules to record your 14-bit parameter as graphical automation (envelope)?  

There is sufficient resolution in the envelopes to represent the value as a single point. 

 

The "Automapping" example demonstrates how to write automation from the selected parameter.

So, not 100% what you're looking for but perhaps close enough? 


Tracking with Stuff. API wishlist | Soundcloud


#92 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 19 posts
  • Gender:Male
  • Location:Hannover, Germany

Posted 18 September 2018 - 22:38

Automapping my 14bit MIDI parameter would definitely be close enough.

I've loaded the "Automapping" example in a ruleset but I am not able to record any MIDI parameter to a device parameter in the "track automation editor pane".

To keep it simple, I started with the Modwheel as MIDI input as already configured in the xRules example.

I've selected the "L Delay" parameter of an instance of the Renoise delay device, but can't figure out how to record it to the track automation. The Modwheel is recorded in the Pattern Editor as usual.

I could only manage to map (using the Renoise MIDI Mapping functionality) the Modwheel to the "L Delay" parameter and see respective hear that it takes effect.

But again, no recording in the "track automation editor pane" happens.


Edited by j(b++), 18 September 2018 - 22:40.


#93 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 19 September 2018 - 11:06

can't figure out how to record it to the track automation. The Modwheel is recorded in the Pattern Editor as usual.

 

Hmm, sounds like you're still recording using "standard" Renoise mappings. 

Have you selected the device in the xRules prefs and disabled the port in Renoise preferences? 

 

Edit: you should see the MIDI input indicators lighting up when it works:

xrules-activity-indicators.gif


  • j(b++) likes this

Tracking with Stuff. API wishlist | Soundcloud


#94 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 29 September 2018 - 17:58

Doing some tool maintenance today as xRules has a couple of longstanding bugs I wanted to fix. 

Any new rulesets that should be considered for inclusion? 


Tracking with Stuff. API wishlist | Soundcloud


#95 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6985 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 30 September 2018 - 11:13

New version of xRules, 0.8. Get it from the tool page 

 

This release closes a number of bugs:

(fixed) tool in subfolder (not default folder) causes error on ruleset creation (#69)
(fixed) instrument index set via UI does not work bug (#81)
(fixed) need 'bit_depth' to be set before NRPN messages work (#82)

The second bug (#81) was simply a typo, and affected not only instrument_index but also track_index. 

So now you should finally be able to control the target instrument + track from the xRules UI. 


Tracking with Stuff. API wishlist | Soundcloud






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