Jump to content


Photo

midi mapping a knob to a specific thing


  • Please log in to reply
4 replies to this topic

#1 esaruoho

esaruoho

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2679 posts
  • Gender:Male
  • Location:Kontula, Helsinki, Finland
  • Interests://Varying Interests//

Posted 12 January 2018 - 23:40

Hi, I'm attempting to figure out how to modify this:

 renoise.song().patterns[currPatt].tracks[currTrak].lines[currLine].effect_columns[1].number_value = math.max(0, math.min(255, columns[thing] + chg)) 

into receiving midi 0-127 knob data, and so that the incoming midi slider data 0-127 is made to work between 0-255.


Edited by esaruoho, 14 January 2018 - 11:30.

http://lackluster.org | on Bandcamp | on YouTube | on Facebook | on Spotify | on iTunes | on TiDAL | on Soundcloud | 

http://twitter.com/esaruoho | http://esaruoho.tumblr.com | GitHubesaruoho@gmail.com | 

| macOS 10.13 High Sierra | MacBook Pro 2.8 GHz Intel Core i7 / 16 Gb 1600 MHz DDR 3 |

| http://renoise.com/tools/paketti | BTC: 1BoZ9rvb8wT7dFNyVPwSX7DLj3stNo7844 | http://paypal.me/esaruoho |

| Latent Impulse Tracker/Scream Tracker 3/Schism Tracker <-> Renoise fanatic |

More API functions, please! ;) http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/page-3#entry240266

#2 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1581 posts
  • Gender:Male
  • Location:Spain

Posted 14 January 2018 - 01:38

Hi, I'm attempting to figure out how to modify this:

 renoise.song().patterns[currPatt].tracks[currTrak].lines[currLine].effect_columns[1].number_value = math.max(0, math.min(255, columns[thing] + chg)) 
else end
if thing == 5 then --effect amount column
 renoise.song().patterns[currPatt].tracks[currTrak].lines[currLine].effect_columns[1].amount_value = math.max(0, math.min(255, columns[thing] + chg)) 

into receiving instead of math.max, midi 0-127 knob data, and so that the 255 is mapped to 0-127.

uhh.

 

I do not understand this. I mean, I do not know what you want to do here.

:excl: Development of my tools: Piano Roll EditorKangarooX120SamRenderPhraseTouch

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#3 esaruoho

esaruoho

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2679 posts
  • Gender:Male
  • Location:Kontula, Helsinki, Finland
  • Interests://Varying Interests//

Posted 14 January 2018 - 11:29

 

I do not understand this. I mean, I do not know what you want to do here.

 

 

Hi. So, I've got keyboard shortcuts that allow for controlling of Effect Column content, which is really nice. But now I am attempting to go from a simple script that does +1/-1/+10/-10 (depending on the amount specific when calling the function via shortcuts or buttons) to "use a slider on this". So I'm hoping to make it so that I have, say, a couple of midicontroller sliders, and those output, to Renoise, data 0..127 and that is mapped to the effect column space 0-FF (in the case of amount_column). so i'm wondering how to use this math so that a slider can be, functionally, mapped to this method of writing.

 

this is what the shortcut looks like:
 

function effectamount(amount,effectname)
-- massive thanks to pandabot for the optimization tricks!
local s=renoise.song()
local counter=nil
for i=s.selection_in_pattern.start_line,s.selection_in_pattern.end_line 
do 
s:pattern(s.selected_pattern_index):track(s.selected_track_index):line(i):effect_column(1).number_string=effectname
counter=s:pattern(s.selected_pattern_index):track(s.selected_track_index):line(i):effect_column(1).amount_value+amount 
if counter > 255 then counter=255 end
if counter < 1 then counter=0 end
s:pattern(s.selected_pattern_index):track(s.selected_track_index):line(i):effect_column(1).amount_value=counter 
  end
end

Edited by esaruoho, 14 January 2018 - 12:28.

http://lackluster.org | on Bandcamp | on YouTube | on Facebook | on Spotify | on iTunes | on TiDAL | on Soundcloud | 

http://twitter.com/esaruoho | http://esaruoho.tumblr.com | GitHubesaruoho@gmail.com | 

| macOS 10.13 High Sierra | MacBook Pro 2.8 GHz Intel Core i7 / 16 Gb 1600 MHz DDR 3 |

| http://renoise.com/tools/paketti | BTC: 1BoZ9rvb8wT7dFNyVPwSX7DLj3stNo7844 | http://paypal.me/esaruoho |

| Latent Impulse Tracker/Scream Tracker 3/Schism Tracker <-> Renoise fanatic |

More API functions, please! ;) http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/page-3#entry240266

#4 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 January 2018 - 11:58

A slider (viewbuilder) can have a custom range. So you could configure your slider to accept the MIDI input range (0-127) and then scale the result before applying it to the parameter.

 

But - be aware that you'll need to instantiate your own MIDI port connections if you want to roam freely around and control parameters.

(I know, it's not part of the code you posted - but wanted to point this out in any case. The MIDI mapping dialog in Renoise (CTRL+M) binds to a single, specific parameter)...

 

 

 

Hi. So, I've got keyboard shortcuts that allow for controlling of Effect Column content, which is really nice. But now I am attempting to go from a simple script that does +1/-1/+10/-10 (depending on the amount specific when calling the function via shortcuts or buttons) to "use a slider on this". So I'm hoping to make it so that I have, say, a couple of midicontroller sliders, and those output, to Renoise, data 0..127 and that is mapped to the effect column space 0-FF (in the case of amount_column). so i'm wondering how to use this math so that a slider can be, functionally, mapped to this method of writing.

 

this is what the shortcut looks like:
 

function effectamount(amount,effectname)
-- massive thanks to pandabot for the optimization tricks!
local counter=nil
for i=renoise.song().selection_in_pattern.start_line,renoise.song().selection_in_pattern.end_line 
do 
renoise.song():pattern(renoise.song().selected_pattern_index):track(renoise.song().selected_track_index):line(i):effect_column(1).number_string=effectname
counter=renoise.song():pattern(renoise.song().selected_pattern_index):track(renoise.song().selected_track_index):line(i):effect_column(1).amount_value+amount 
if counter > 255 then counter=255 end
if counter < 1 then counter=0 end
renoise.song():pattern(renoise.song().selected_pattern_index):track(renoise.song().selected_track_index):line(i):effect_column(1).amount_value=counter 
  end
end

 

PS : I'm waiting for Raul to point out that you really should avoid all those renoise.song() statements  ^_^


Tracking with Stuff. API wishlist | Soundcloud


#5 esaruoho

esaruoho

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2679 posts
  • Gender:Male
  • Location:Kontula, Helsinki, Finland
  • Interests://Varying Interests//

Posted 14 January 2018 - 12:29

A slider (viewbuilder) can have a custom range. So you could configure your slider to accept the MIDI input range (0-127) and then scale the result before applying it to the parameter.

 

But - be aware that you'll need to instantiate your own MIDI port connections if you want to roam freely around and control parameters.

(I know, it's not part of the code you posted - but wanted to point this out in any case. The MIDI mapping dialog in Renoise (CTRL+M) binds to a single, specific parameter)...

 

Well, thankfully I'm not using the LUI GUA viewbuilder at all for now, just direct CMD-M -bindable midimapping and keymapping, for now. I do have some eventual plans, once I figure out how to use for-loops to build GUI Viewbuilder buttons - as making them all by hand was really slow 5 years ago - considering i hardly knew what i was doing then - even now..

 

Anyway, I would be using external midi controller sliders to send 0..127 and am just trying to see how much I'd have to change to be able to directly write to selection_in_effect_column (even tho I'd mostly be in note_column) and, if no selection, then "current_row_effect_column".


PS : I'm waiting for Raul to point out that you really should avoid all those renoise.song() statements  ^_^

Who me? You must've quoted me with a previous, older edit ;) check now


http://lackluster.org | on Bandcamp | on YouTube | on Facebook | on Spotify | on iTunes | on TiDAL | on Soundcloud | 

http://twitter.com/esaruoho | http://esaruoho.tumblr.com | GitHubesaruoho@gmail.com | 

| macOS 10.13 High Sierra | MacBook Pro 2.8 GHz Intel Core i7 / 16 Gb 1600 MHz DDR 3 |

| http://renoise.com/tools/paketti | BTC: 1BoZ9rvb8wT7dFNyVPwSX7DLj3stNo7844 | http://paypal.me/esaruoho |

| Latent Impulse Tracker/Scream Tracker 3/Schism Tracker <-> Renoise fanatic |

More API functions, please! ;) http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/page-3#entry240266