Jump to content


Photo

New Tool (3.0): CDP lua tool


  • Please log in to reply
426 replies to this topic

#26 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 28 April 2014 - 19:02

I get the error whenever I just loaded Renoise, start op the tool without any sample present. Once I've had the error notice, loading up a sample doesn't fix it. The tool still doesn't start up, I get the other notice, see a few posts above.

When I start up Renoise, load a sample, than boot up your tool, everything works as expected. Maybe it is a windows thing?

Btw updated most of the presets with the docs descriptions and fixed a few mistakes, but there are bound to be more errors because of wrong range setting. Hopefully will iron these out soon, also with the cycle() function;

Spoiler


Maybe instead of having to scroll through the docs text it is possible for the tool gui to auto-adjust so all text fits in view? If to much work, no worries :-) .

edit;

at second thought, that might be too much text for some of the descriptions, maybe a button/toggle to show all text, similar to the question mark button inside the 'Track dsp' panel is a better idea?

Edited by Djeroek, 28 April 2014 - 19:12.


#27 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 28 April 2014 - 22:13

I get the error whenever I just loaded Renoise, start op the tool without any sample present. Once I've had the error notice, loading up a sample doesn't fix it. The tool still doesn't start up, I get the other notice, see a few posts above.

When I start up Renoise, load a sample, than boot up your tool, everything works as expected. Maybe it is a windows thing?


Really strange, I can't replicate this at all. What output do you get if you run this command in the terminal when there is no sample selected:
print(renoise.song().selected_sample)

Also can you try changing line 125 in main.lua to:

dofile ("definitions.lua")

Does that make any difference?

at second thought, that might be too much text for some of the descriptions, maybe a button/toggle to show all text, similar to the question mark button inside the 'Track dsp' panel is a better idea?


Originally thought of doing this as a pop up window launched by a button next to the pop-up list, but then I thought it was too many clicks and it would be handy to be able to see a description straight away. I can get it to resize based on the text so not a problem to do that either. There is also the option to load the url from the docs that come with CDP so a button could launch the detailed doc and a brief description in the tool.... choices, choices!

Also will add the updated definitions to the next version, post any updated ones on here and I'll keep it in sync, I won't be adding any new definitions myself while I work on the code. Thanks to you I have plenty of definitions here to try out... Cheers Posted Image

#28 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 28 April 2014 - 23:17

What output do you get if you run this command in the terminal when there is no sample selected:

print(renoise.song().selected_sample)


I get:

>>> print(renoise.song().selected_sample)
userdata: 0x13E123E0 (Sample object)

Also can you try changing line 125 in main.lua to:

dofile ("definitions.lua")

Does that make any difference?


Nope, gives;

'C:\Users\plugexpert\AppData\Roaming\Renoise\V3.0.0\Scripts\Tools\com.afta8.CdpInterface.xrnx\' failed to execute in one of its menu entry functions.

Please contact the author (afta8 | fathand@gmail.com ) for assistance...

std::logic_error: 'can not access properties of a sample buffer with no sample data.'
stack traceback:
[C]: ?
[C]: in function '__index'
[string "do..."]:36: in function <[string "do..."]:35>
main.lua:47: in function 'srate'
.\definitions.lua:44: in main chunk
[C]: in function 'require'
main.lua:125: in function 'show_dialog'
main.lua:389: in function <main.lua:386>


When I do the correct start-up procedure, loading the script after importing a sample first, I can make it produce this error notice every time I choose the 'Modify Revecho - Stadium Echo' preset:

'C:\Users\plugexpert\AppData\Roaming\Renoise\V3.0.0\Scripts\Tools\com.afta8.CdpInterface.xrnx\main.lua' failed in one of its notifiers.

Please contact the author (afta8 | fathand@gmail.com ) for assistance...

main.lua:209: attempt to index local 'arg' (a nil value)
stack traceback:
main.lua:209: in function 'build_arg_params_row'
main.lua:286: in function 'build_args_column'
main.lua:317: in function <main.lua:312>


Clicking away this bug, the gui remains open and when selecting a process that previously worked, it throws up another bug;

'C:\Users\plugexpert\AppData\Roaming\Renoise\V3.0.0\Scripts\Tools\com.afta8.CdpInterface.xrnx\main.lua' failed in one of its notifiers.

Please contact the author (afta8 | fathand@gmail.com ) for assistance...

std::logic_error: 'ViewBuilder: trying to remove a view which was not added to the calling parent view.'
stack traceback:
[C]: in function 'remove_child'
main.lua:313: in function <main.lua:312>


Maybe the bugs are related, not sure what I'm doing wrong in the definitions file for stadium echo?

edit;

this is my latest definition content;

Spoiler

Edited by Djeroek, 28 April 2014 - 23:33.


#29 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 00:45

I get:

>>> print(renoise.song().selected_sample)
userdata: 0x13E123E0 (Sample object)


Really? with no sample selected I get 'nil' - I depend on getting that result to set the tool up properly so thats probably the cause. The rest of the errors might be related to this as well. I'm going to borrow a windows laptop from work tomorrow so I'll test it out on that, see if I can get it working properly.




#30 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 01:08

I can make it produce this error notice every time I choose the 'Modify Revecho - Stadium Echo' preset:


There is an error in the definition for this one. You have a jump from arg2 to arg4 and this breaks it, if you number them consecutively it should work.

#31 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 29 April 2014 - 01:21

Really? with no sample selected I get 'nil' - I depend on getting that result to set the tool up properly so thats probably the cause. The rest of the errors might be related to this as well. I'm going to borrow a windows laptop from work tomorrow so I'll test it out on that, see if I can get it working properly.


sorry, my default new song apparently had an empty sample selected, removing the sample, and running again in terminal gives nil indeed!

There is an error in the definition for this one. You have a jump from arg2 to arg4 and this breaks it, if you number them consecutively it should work.


Thanks, will fix.

edit;

new definitions;

Spoiler

Edited by Djeroek, 29 April 2014 - 01:45.


#32 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 08:32

sorry, my default new song apparently had an empty sample selected, removing the sample, and running again in terminal gives nil indeed!


Gotcha! That empty sample was causing the bug... Should be fixed now, see attached.
Also updated definitions to include your last set up to 'tremolo tremolo'

I've also changed the way definitions are loaded in this so restart Renoise before running this for the first time.

Cheers!



#33 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 29 April 2014 - 09:22

Gotcha! That empty sample was causing the bug... Should be fixed now, see attached.


yep, that did it :)


Am trying to do the multi-channel reverb at the moment, but can't stop it from crashing the CDP process. I think because I need to specify a mode in your script definition, while this particular process doesn't have a mode!

Is there a way you can have a cmds line in your script without the mode portion?

Btw this is the reverb definition that doesn't work here;

dsp["Reverb - Multi-Channel reverb "] = { 
  cmds = { exe = "reverb", mode = "", tip = " REVERB implements the now classic Schroeder/Moorer model, consisting of six comb filters in parallel, followed by four allpass filters in series. The comb filters generate the dense reverberation, and the allpass filters (with much shorter delay times) apply further smearing of the echoes to minimize the spectral colouration of the comb filters. A further allpass is applied to each output channel, each with a different randomly-chosen delay time. Each comb filter contains a simple low-pass filter to simulate high-frequency absorption - this also affects the overall reverberation time. A preset set of early reflections as defined by Moorer is incorporated; this can be replaced by a user-defined set either hand-written or created using ROOMRESP. The delay times for the filters are preset to suit a 'medium room' model, as suggested by Moorer. In most situations the user will not want to change these; however the option is provided to change these times by means of a simple text file." },
  arg1 = { name = "N", switch = "-c", min = 0, max = 16, def = 2, tip = "create outfile with N channels (Range: 1 <= N < 16; Default = 2)" },
  arg2 = { name = "N", switch = "-H", min = 0, max = 44100, tip = "Apply Highcut filter to infile with cutoff frequency NHz(6dB per octave)" },
  arg3 = { name = "N", switch = "-L", min = 0, max = 44100, tip = "apply Lowcut filter to infile with cutoff frequency NHz (12dB per octave)" },
  arg4 = { name = "N", switch = "-p", min = 0, max = 1000, tip = "set reverb predelay to N msecs (shifts early reflections)" },
  arg5 = { name = "egain", min = 0,0, max = 1,0, tip = "set level of early reflections (Range: 0.0 to 1.0)" },
  arg6 = { name = "mix", mix = 0,0, max = 1,0, tip = "balance of direct and reverb signal (Range: 1.0 [weighted towards direct signal] to 0.0 [weighted towards reverb signal])" },
  arg7 = { name = "rvbtime", min = 0, max = 20, tip = "reverb decay time (to -60dB) in seconds" },
  arg8 = { name = "absorb", min = 0,0, max = 1,0, tip = "degree of hf damping to suggest roomsize (Range: 0.0 to 1.0)" },
  arg9 = { name = "lpfreq", min = 0, max = 44100, tip = "lowpass filter cutoff frequency in Hz applied at input to reverb" },
  arg10 = { name = "trailertime", min = 0, max = 20, tip = "time in seconds added to outfile for reverb tail" },  
    
}

If I leave out mode from the cmds line, I get a bug notice, but maybe there is another reason why reverb.exe crashes?


edit;

btw I'm not sure if its worth updating the definition file using cycle() for bunch of stuff, I think it is only calculated on tool launch (not updated when you load another sample or switch definition presets) and can take quite some time calculating when booting the script on larger samples. Just did a bunch of edits replacing fixed cyclecnt max values with cycle() and had to click away 'the script is taking to long..blah blah' notice during boot :) , reverted the definition file back to before.

+

Feature request;

Would it be possible to only have the tool work on the selection in the sample editor instead of always the complete sample?

Thanks :yeah:

Edited by Djeroek, 29 April 2014 - 10:08.


#34 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 12:18

Is there a way you can have a cmds line in your script without the mode portion?


You need to leave mode in there for now, but I can make it optional, will look at this later


btw I'm not sure if its worth updating the definition file using cycle() for bunch of stuff, I think it is only calculated on tool launch (not updated when you load another sample or switch definition presets) and can take quite some time calculating when booting the script on larger samples. Just did a bunch of edits replacing fixed cyclecnt max values with cycle() and had to click away 'the script is taking to long..blah blah' notice during boot Posted Image , reverted the definition file back to before.


Yeah it rescans every time you launch the GUI, it shouldn't need to rescan if you change preset as the cycle count remains the same. If you change the sample then yes you will need to relaunch the tool (for now). I can probably optimise it to work faster. There is also a 'cyclecnt' function that comes with CDP which will most likely be a lot faster but it only outputs to the terminal and I haven't yet found a way to parse the output back to a Renoise tool... will need to figure this out eventually when I get onto the PVOC and other analysis stuff.

Would it be possible to only have the tool work on the selection in the sample editor instead of always the complete sample?


Yes, I am working on a way for mono commands to operate on stereo samples, when I've done this the same code will also let you do sample selections.



  • Djeroek likes this

#35 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 29 April 2014 - 14:13

Yes, I am working on a way for mono commands to operate on stereo samples, when I've done this the same code will also let you do sample selections.


Nice :drummer:


Definitions update;

Spoiler


Notice a bunch of non-working presets in the bottom of the list, not sure if I haven't found the right settings for these particular processes yet, or am sending the arguments wrong values, not sure why nothing is returned as output?

#36 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 14:53

Cool, added these to latest update, also optimised the cycles() function so it should work faster, try it out and let me know if its any better than the last one, however we will have to live with this for large samples until I figure out how to use the CDP function.

Notice a bunch of non-working presets in the bottom of the list, not sure if I haven't found the right settings for these particular processes yet, or am sending the arguments wrong values, not sure why nothing is returned as output?


I'll look at these later this evening, sooo many functions now, its great, thanks Posted Image

Edited by afta8, 29 April 2014 - 14:54.

  • Djeroek and xrxs like this

#37 ost jurgur

ost jurgur

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 137 posts
  • Gender:Male
  • Interests:do and hear music,read ,

Posted 29 April 2014 - 18:06

Cool, added these to latest update, also optimised the cycles() function so it should work faster, try it out and let me know if its any better than the last one, however we will have to live with this for large samples until I figure out how to use the CDP function.


I'll look at these later this evening, sooo many functions now, its great, thanks Posted Image



would it work with linux?? :panic: great works :drummer:

#38 xrxs

xrxs

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 179 posts

Posted 29 April 2014 - 18:35

Guys you rock :yeah:/>
Gonna test definitions to reveal some range bugs etc
Thanks!

Edited by xrxs, 29 April 2014 - 18:35.


#39 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 29 April 2014 - 19:29

Cool, added these to latest update, also optimised the cycles() function so it should work faster, try it out and let me know if its any better than the last one


Haven't used the new cycles with all possibilities yet + am a n00b how to actually use it :-), will see.

Gonna test definitions to reveal some range bugs etc


Won't be hard to find them as with a lot of parameters it has been trial and error, using common sense, guess work, just putting a value there as the docs aren't consistent revealing the actual ranges! For example sometimes a time range is in seconds, sometimes ms, sometimes samples et cetera. I also made a few definitions, that didn't do anything, than I find out the .exe isn't present in the progs folder *facepalm*, or .exe's are named slightly different than how they are described in the docs (roomverb.exe vs rmverb.exe).

It can also look that a process doesn't work, but this is because certain ranges relate, can't be bigger or smaller than other ranges, have to be set smaller than actual sound-length et cetera.

Any ways feel free to go through the docs file:///C:/cdpr7/docs/html/ccdpndex.htm and cross-check the definitions if you come across funny stuff.

edit;

new definitions;

Spoiler

Edited by Djeroek, 29 April 2014 - 19:47.


#40 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 20:44

Haven't used the new cycles with all possibilities yet + am a n00b how to actually use it :-), will see.


Actually hold off using it for now, I just realised the way I set it up meant it was being calculating this every time it is used in a definition, this will of course take a very long time, it only needs to be done once per sample. Will fix this in next update.
  • Djeroek likes this

#41 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 29 April 2014 - 22:00

Actually hold off using it for now, I just realised the way I set it up meant it was being calculating this every time it is used in a definition, this will of course take a very long time, it only needs to be done once per sample. Will fix this in next update.


that's what I figured :) , not sure how and when to use it anyway. Sometimes the total duration of a sample is needed in (ms)seconds for the max value, I reckon cycles() would need some kind of additional conversion magic for it to make sense in (ms)seconds.

Moarr future feature suggestions;

Would be nice to have alternative 'Process' modes in the tool gui imo, right now clicking 'Process' closes the gui automatically, maybe right mouse clicking the button would process but keep the gui open? Saves re-initializing all the time when on a soundhaping mission.

If too much work, could you make the tool keybindable? Can't find it right now in the key-preferences..

Also an alternative process mode that would return the processed result as a new sample instrument, or added sample inside the source sample instrument could be helpful. Leaving the source sample unchanged and returning the effected sound in a new sample slot. Good for making variations.

Keep up the good work :drummer:

#42 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 22:01

Updated to v0.23 - I have included the definitions up to 'Extend Scramble 2'

Fixed the way 'srate' and 'cycles' were used - In future use these as before but without the brackets, so where you would have previously used
cycles()
now use
cycles

I have updated all the previously submitted definitions to use this format.
Also I have changed the way you can submit new definitions, I have attached a 'user_definitions.lua' file to this post (it's just an empty file). The tool will look for this in the same folder as all the CDP executables and if found it will also load the definitions found in that file. This means you can be working on new definitions and don't have to worry about backing them up when I update the tool.

So put your new definitions in there and attach the file (or copy paste) to future posts when you have new definitions to submit. Leave the updating of the 'definitions.lua' file bundled with the tool to me, I will add newly submitted definitions in tool updates. If you have submitted definitions that I have already bundled but find errors or want to update them just include them again in 'user_definitions.lua' - As long as the preset name is the same, then the settings in 'user_definitions.lua' will override the definitions included with the tool.
So for future definitions:

- Copy 'user_definitions.lua' to the CDP executables folder
- Add new definitions or updates to previous definitions to this file
- Post or copy paste this file to this thread when ready to submit
- I will include them in new versions of the tool

Hope that all makes sense.
  • Djeroek likes this

#43 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 29 April 2014 - 22:43

Sometimes the total duration of a sample is needed in (ms)seconds for the max value, I reckon cycles() would need some kind of additional conversion magic for it to make sense in (ms)seconds.


You can work out the duration from sample length and sample rate, its really easy, I'll add a function for this in the next update.

Would be nice to have alternative 'Process' modes in the tool gui imo, right now clicking 'Process' closes the gui automatically, maybe right mouse clicking the button would process but keep the gui open? Saves re-initializing all the time when on a soundhaping mission.


It shouldn't do this, on my mac the tool GUI only closes when I close it manually using the [x] button. Do you use the built in Terminal and Editor to make definitions? Try closing it before running the tool, it can sometimes interfere with tool GUI's. If that doesn't work do use any other tools that have buttons but don't do this? I can look at their code and see if there is anything different.

If too much work, could you make the tool keybindable? Can't find it right now in the key-preferences..


Yes no problem, until the next update just add this code to end of main.lua, you will see a section for keybindings, just stick it in there.


renoise.tool():add_keybinding {
  name = "Global:Tools:" .. tool_name.."...",
  invoke = start_tool
}

Also an alternative process mode that would return the processed result as a new sample instrument, or added sample inside the source sample instrument could be helpful. Leaving the source sample unchanged and returning the effected sound in a new sample slot. Good for making variations.


Good idea, I'll add it to the list Posted Image

Keep up the good work Posted Image


And you sir! Posted Image

would it work with linux?? Posted Image great works Posted Image


Cool! Did you have to compile the source?

Guys you rock Posted Image/>
Gonna test definitions to reveal some range bugs etc
Thanks!


Excellent! See my last post for instructions on how to submit new/amended definitions..

#44 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

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

Posted 30 April 2014 - 01:55

You can work out the duration from sample length and sample rate, its really easy, I'll add a function for this in the next update.


Nice!

It shouldn't do this, on my mac the tool GUI only closes when I close it manually using the [x] button. Do you use the built in Terminal and Editor to make definitions? Try closing it before running the tool, it can sometimes interfere with tool GUI's. If that doesn't work do use any other tools that have buttons but don't do this? I can look at their code and see if there is anything different.


Heh, it doesn't close it at all when pressing process, my bad. Tool auto closes when executing changes in the editor :) .

Yes no problem, until the next update just add this code to end of main.lua, you will see a section for keybindings, just stick it in there.


renoise.tool():add_keybinding {
  name = "Global:Tools:" .. tool_name.."...",
  invoke = start_tool
}


Got it working, cheers.


attached new definitions to this post, bunch of these can definitely use cycles to seconds conversion.

#45 psn

psn

    Member

  • Normal Members
  • PipPip
  • 30 posts
  • Gender:Male

Posted 30 April 2014 - 09:28

An output file was not produced - Check your settings.
NOTE: Some processes only work on mono samples.


Is this some file access problem? I'm on Windows 7.

Edit: I have tried both mono and stereo files.

Edited by psn, 30 April 2014 - 09:48.


#46 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 30 April 2014 - 09:48

Is this some file access problem? I'm on Windows 7.


It could be a number of things.. first of all, have you installed CDP on your system?

#47 psn

psn

    Member

  • Normal Members
  • PipPip
  • 30 posts
  • Gender:Male

Posted 30 April 2014 - 10:15

It could be a number of things.. first of all, have you installed CDP on your system?


Yes, and I set the path to CDP the first time I ran the script.

C:\Program Files (x86)\cdpr7\_cdp\_cdprogs

I also managed to successfully manipulate a mono wav file from the command shell.

Edited by psn, 30 April 2014 - 10:17.


#48 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 30 April 2014 - 10:26

Ok, great... can you try running the Filter Bank 1 effect. Does that work?

EDIT: Make sure you set the lowfrq to be lower than hifrq

Edited by afta8, 30 April 2014 - 10:36.


#49 psn

psn

    Member

  • Normal Members
  • PipPip
  • 30 posts
  • Gender:Male

Posted 30 April 2014 - 10:27

No, I get the same message.

#50 afta8

afta8

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 709 posts
  • Gender:Male
  • Location:London

Posted 30 April 2014 - 10:39

Sorry can you try again and make sure lowfrq is set to be lower than hifrq