Jump to content


Photo

ModLoop Tool


  • Please log in to reply
33 replies to this topic

#1 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 30 December 2017 - 20:12

Here is ModLoop tool, which enables a Renoise user to modify the selected sample loop properties dynamically.

 

Tested on Renoise 3.1.1

 

Download

 

v0.29 - mostly fixed loose mode getting stuck

             

Featuring:

 

- 2 modes of operation, loose and pitch

- midi mapping

 

renoise_screenshot.jpg

 

This is my first tool, so I'm open to any sort of feedback! This is also still very much a work in progress. Please report any bugs you find.

 

To do:

  - provide option to restore loop properties when selecting new samples/instruments

  - always jump or always move option for restore action

    - the beginning of random mode (random position, random... other things later)

  - glide option and speed for pitch mode

  - finer control over pitch mode (octaves, cents)
  - ???

Eventually:
  - retrieve the notes being played with the selected sample if possible...
    - representation in the GUI of the actual note(s)
    - fixing the pitch change with high speeds - I realize now the playback is jumping... the speed needs to be limited
    - figuring out how much of the sample buffer we need to check to find a zero crossing
    - leverage the unused FHK effects parameters by reading the sequence?

 

 

Ultimately, I was hoping to be able to add sample modulation set items so that loop start and loop end could be modulated with all of the existing options... right now being able to midi map the parameters sort of takes care of that, if you only intend to modulate the loop points of your currently selected sample in your composition ohmy.png


Edited by b0nafide, 08 January 2018 - 09:05.

  • danoise, Djeroek, afta8 and 5 others like this

#2 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 30 December 2017 - 20:22

Looking good, can we dl it somewhere to test-drive?



#3 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 30 December 2017 - 21:06

Of course! I thought I added it as an attachment... Download

 

(added the link above as well)


Edited by b0nafide, 30 December 2017 - 21:07.

  • Djeroek and Type-A like this

#4 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 30 December 2017 - 21:34

Of course! I thought I added it as an attachment... Download

 

(added the link above as well)

Cool,

 

opened up the tool on a multi-sampled instrument, adjusted the sliders in the gui and nothing happened (probably misuse on my part), deleted the instrument, closed down the gui and opened up the tool again on an empty instrument slot and got this; 

 

'C:\Users\pluge\AppData\Roaming\Renoise\V3.1.1\Scripts\Tools\ca.tonyscc.ModLoop.xrnx\' failed to execute in one of its menu entry functions.

 
Please contact the author (artaslove [bonafide@martica.org]) for assistance...
 
main.lua:246: attempt to index global 'selected_sample' (a nil value)
stack traceback:
  main.lua:246: in function 'init_tool'
  main.lua:433: in function <main.lua:432>

will play around some more.



#5 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 30 December 2017 - 21:38

Thank you I don't test if selected_sample is nil... I'll fix that soon. Also, the main loop only does something if the song is playing. I should have mentioned that. I guess that makes "Start" a little misleading...

 

I won't be back in front of my Renoise system for a few hours.


Edited by b0nafide, 30 December 2017 - 21:42.

  • Djeroek likes this

#6 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 30 December 2017 - 21:48

 the main loop only does something if the song is playing. I should have mentioned that.

Thanks! Thought it wasn't working, this is great!  B)  

 

Wish it would be possible to be able to use renoise's native render to sample in combination with this, of course the render to sample shortcut works and a sample is created, but without the creative mangling your tool creates when a pattern is running, just a static loop.

 



#7 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 30 December 2017 - 21:51

Awesome! More updates soon. If you want to play around without the song playing, just change

 

while rsong.transport.playing do

 

to

 

while true do

 

in main.lua ... I'll do it later, and take care of nil selected_sample ... and more :)

 

Now that I think about it, the reason I wanted the song to be playing is an artifact left over from trying to obtain the loop pitch from the last note in the sequence, which I ended up abandoning because it's pretty silly. If you want that behavior you can just set the pitch of the loop to the base note of the sample and trigger the sample with notes as usual...


Edited by b0nafide, 30 December 2017 - 22:18.


#8 assink

assink

    Member

  • Normal Members
  • PipPip
  • 25 posts
  • Gender:Not Telling

Posted 31 December 2017 - 01:21

Thats exactly what i am missing till now! together with something like that you can do some part of the mangling yourself, so let the loop become bigger and smaller the way I want it ;-)

But for the rest, its an awesome tool! I think i will definitely use it more! instead of this 5 minutes testing on my way out
 

Thanks! Thought it wasn't working, this is great!  cool.png  

 

Wish it would be possible to be able to use renoise's native render to sample in combination with this, of course the render to sample shortcut works and a sample is created, but without the creative mangling your tool creates when a pattern is running, just a static loop.

 



#9 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 31 December 2017 - 01:58

Great!! I've updated the tool so "start" and "stop" always make sense and it won't launch if there are no selected samples now.

 

I'll keep at it. Yes, having the option to only modify one of the loop points if the user wants some manual control also is a potential mode to throw in as well.

 

Edit: I've started the version history at v0.1


Edited by b0nafide, 31 December 2017 - 06:27.


#10 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 31 December 2017 - 03:06

Assink, I've added toggles for the start and end points in loose mode, so you can also manually change the loop points if you want smile.png

 

Thats exactly what i am missing till now! together with something like that you can do some part of the mangling yourself, so let the loop become bigger and smaller the way I want it ;-)

But for the rest, its an awesome tool! I think i will definitely use it more! instead of this 5 minutes testing on my way out
 


Edited by b0nafide, 31 December 2017 - 03:06.


#11 assink

assink

    Member

  • Normal Members
  • PipPip
  • 25 posts
  • Gender:Not Telling

Posted 31 December 2017 - 03:40

Ah. Nice! gonna check that out tomorrow :)
I kept it opened in my renoise, so i will see it when i wake up ;-)
 

Assink, I've added toggles for the start and end points in loose mode, so you can also manually change the loop points if you want smile.png



#12 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 31 December 2017 - 04:13

I'm glad you didn't check it out right away, there were bugs :/

 

...now it's much more sensible though, if you disable control of a loop point and move it somewhere and resume control, it resumes from where you moved the loop point.

 

Edit: bumped version to v0.12 for clarity

 

I'll be more cautious about future releases. I'm very happy that this tool is coming together, I've wanted to automate this process for ... years. I think my only other previous posts on this forum prior to 2017 were related to changing the sample loop positions with track effects in the sequence.


Edited by b0nafide, 31 December 2017 - 05:59.


#13 Supraom

Supraom

    New Member

  • Normal Members
  • Pip
  • 3 posts

Posted 31 December 2017 - 06:05

yesterday i just think about this



#14 assink

assink

    Member

  • Normal Members
  • PipPip
  • 25 posts
  • Gender:Not Telling

Posted 31 December 2017 - 12:58

Yes I've also been thinking about a feature like this for a Long long time already. Finally it's there! So many thanks for that!
I've tested it a bit more, and for so far it works nice!
Gonna keep an eye on this topic :)

I'm glad you didn't check it out right away, there were bugs :/

 

...now it's much more sensible though, if you disable control of a loop point and move it somewhere and resume control, it resumes from where you moved the loop point.

 

Edit: bumped version to v0.12 for clarity

 

I'll be more cautious about future releases. I'm very happy that this tool is coming together, I've wanted to automate this process for ... years. I think my only other previous posts on this forum prior to 2017 were related to changing the sample loop positions with track effects in the sequence.



#15 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 31 December 2017 - 18:29

Before I declare version 1.0 I'm going to have to fix all the problems of the parameters potentially being outside the sample properties. Right now there are no checks to see if a sample is smaller than the intended velocity or pitch for example. I put my idea out before working out all the potential issues.

 

There are some constants related to this, however they are in the tool's preferences.xml file. If you prefer much higher velocities you can set "maxvelocity" higher (look out for exceeding the sample playback speed though), or if you want more control over lower velocities you could set maxvelocity lower I guess. If you don't like high pitched sounds in loose mode during collisions you can set "minframes" higher (hopefully that value turns out to be smaller than your sample size). I believe renoise has to be closed in order for changes to the tool's preferences.xml file to work.

 

I'll likely include control of these values soon. It might be handy to use the selected pitch for minframes.

 

And about that selected pitch... the note displayed really only makes sense if you're playing the base note of the sample at the time. There is no determination made of the actual pitch involved due to playback speed... yet. :)


Edited by b0nafide, 31 December 2017 - 18:43.

  • Djeroek, hmā and assink like this

#16 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 02 January 2018 - 01:23

A few more changes today. Version 0.20 released with better control and the ability to gracefully return to pitch mode from loose mode. Comments, questions, bug reports welcome.


  • ghostwerk likes this

#17 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 04 January 2018 - 00:38

played around with the latest update, opened up a new songfile and got this;

 

'C:\Users\pluge\AppData\Roaming\Renoise\V3.1.1\Scripts\Tools\ca.tonyscc.ModLoop.xrnx\main.lua' failed in one of its notifiers.

The notifier will be disabled to prevent further errors.
 
Please contact the author (artaslove [bonafide@martica.org]) for assistance...
 
.\process_slicer.lua:111: std::logic_error: 'trying to access a nil object of type 'class RenoiseSong'. the object is not or no longer available.'
stack traceback:
  [C]: in function 'error'
  .\process_slicer.lua:111: in function <.\process_slicer.lua:98>


#18 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 04 January 2018 - 00:51

Thanks for testing Djeroek, I'll try to handle new songs opening up in the next release.

 

 

played around with the latest update, opened up a new songfile and got this;



#19 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

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

Posted 04 January 2018 - 05:34

Quick snippet if it helps for closing dialog on new song.

If you just want to reset some variables instead of closing the dialog just attach a relevant function instead of `closer(d)`
 
  --------------------------------------------    
  --close dialog function ON NEW SONG
  --------------------------------------------
  local function closer(d)
     
    if (d ~= nil) and (d.visible == true) then
      d:close()
    end
     
    -- remove other notifiers here if needed

    --reset global my_dialog to nil again if needed
    my_dialog = nil 

  end

  -- attach notifier to close dialog on load of new song, my_dialog gets passed to closer()
  renoise.tool().app_release_document_observable:add_notifier(closer,my_dialog) 
  -------------------------------------------------------------------------------

Edited by Ledger, 04 January 2018 - 05:50.

  • b0nafide likes this

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


#20 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 04 January 2018 - 23:09

Thanks for testing Djeroek

You're welcome :) ,

 

right now I'm slapping a recorder vst on the particular track I'm modlooping, tweaking the sliders while recording to create .wav files of crazy timestretching/granular-like effects. As stated above, I'd love to be able to use Renoises native render selection to sample in the pattern editor, but as far as I can see, Renoise resets the tool start to stop whenever you try to do this. Could there be a way to circumvent the reset? I see the the gui sliders and buttons can be midi mapped, but not sure how the midi mappings can be recorded inside the pattern editor so I can for example aim the tool to start at line 0. Currently playing around with an instr midi control meta device without any luck yet.

 

Also got this after closing the tool after midimapping the pitch slider to a controllers knob, and re-opening a new tool window;

 

'C:\Users\pluge\AppData\Roaming\Renoise\V3.1.1\Scripts\Tools\ca.tonyscc.ModLoop.xrnx\main.lua' failed in one of its notifiers.

The notifier will be disabled to prevent further errors.
 
Please contact the author (artaslove [bonafide@martica.org]) for assistance...
 
.\process_slicer.lua:111: std::logic_error: 'ViewBuilder: invalid value for slider: '112'. value must be [21 - 107].'
stack traceback:
  [C]: in function 'error'
  .\process_slicer.lua:111: in function <.\process_slicer.lua:98>


#21 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 05 January 2018 - 00:30

Thanks Djeroek I'll see if I can fix it soon. Behind the scene, I've returned to work (fixing computers) during the day so I'm spending less time with the code however I'm motivated to finish it up. 

 

Last night I managed to deal with the song switcharoo thanks to Ledger however I am having some trouble detecting when the GUI has been closed, for taking care of properly restoring the previous sample properties. I may have to resort to a button. It may take me some time yet before I do another version bump, this weekend at the latest I think.

 

I'll keep at it!

 

Yes, in theory a stream of midi data can modulate the loop points (when the code works). I assigned some knobs on the bcr2000 to it. Actually having control over the points in the composition or via a sample modulation set item is probably up to the renoise developers...


Edited by b0nafide, 05 January 2018 - 00:44.


#22 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

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

Posted 05 January 2018 - 00:57

Yes, as the [X] button on the tool scripts has no notifier, you have to take care of it somehow else. One way is to use a timer function like this:


line 2      - add the timer in the function that builds and displays your gui (could be added in main() if you build the gui there)
line 13    - when the dialog is detected as nil or not visible, you can do your cleanup code after.  (Maybe setting global my_dialog to nil again if it was the .visible test that was false)                             
line 18    - the timer removes itself
 
each time you re-build/ open the gui a new timer is added and process repeats.
 
note: here my_timer() is a global; function (no local keyword) so can be placed at end of file/ different .lua if wanted                
 
--add timer to fire once every 50ms
if not renoise.tool():has_timer(my_timer) then
  renoise.tool():add_timer(my_timer,50)
end


----------------
--timer function
----------------
function my_timer()
  
  --is GUI is closed?
  if(my_dialog == nil) or (my_dialog.visible == false) then
    
    --gui is closed so relevant code here
    
    --release `this function` "my_timer()"  from the tool timer  
    if renoise.tool():has_timer(my_timer) then
      renoise.tool():remove_timer(my_timer)
    end
  end
end



Edited by Ledger, 05 January 2018 - 07:58.

  • b0nafide and Raul (ulneiz) like this

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


#23 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

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

Posted 05 January 2018 - 01:21

I think this timer could be called "broom car timer" ^_^ . What I do is remove the notifiers and timers inside themselves, at the end of each function with notifier / timer. Each notifier or timer has to have its remove.
 
But I still think that programmers should be able to execute a function when closing with the X in the window. This would make it possible to do it centrally, all from a single function.

  • b0nafide likes this

:excl: Development of my tools: KangarooX120SamRenderPhraseTouch  |  GT16-Colors (old)

 

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

Spoiler

 

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

Spoiler

#24 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

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

Posted 05 January 2018 - 01:34

Something handy to be aware of too though, is that when you delete a renoise object (track/ dsp) in the song then notifiers will be removed automatically in the API .

(you still need to release timers manually) 

 

http://forum.renoise...-automatically/


Edited by Ledger, 05 January 2018 - 01:36.

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


#25 b0nafide

b0nafide

    Member

  • Normal Members
  • PipPip
  • 28 posts
  • Gender:Male
  • Location:Nelson

Posted 05 January 2018 - 07:32

Thank you Ledger Raul and Djeroek for checking it out and the very helpful suggestions. v0.24 is out now. More to come soon.


  • Ledger likes this