|
|
|
09-20-2017, 12:15 PM
|
#1
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Lua:FXChain(for Dev)
Last edited by eugen2777; 09-20-2017 at 08:58 PM.
|
|
|
09-20-2017, 07:24 PM
|
#2
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Okay, if no one wants it, I will delete this thread, had chances.Best wishes
Last edited by eugen2777; 09-20-2017 at 07:31 PM.
|
|
|
09-20-2017, 08:44 PM
|
#3
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Quote:
Originally Posted by eugen2777
Okay, if no one wants it, I will delete this thread, had chances.Best wishes
|
So dumb act.
|
|
|
09-20-2017, 08:53 PM
|
#4
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Michael, I'm very glad to see you!
Короче, я очень-очень рад видеть тебя!
In short, I'm very, very glad to see you!
If you need a thing - spread it back!
Just look, the thing is really cool!
|
|
|
09-20-2017, 09:02 PM
|
#5
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Link in first post, it's cool script.
You will see it!
|
|
|
09-20-2017, 09:09 PM
|
#6
|
Human being with feelings
Join Date: Feb 2017
Posts: 4,820
|
Hey eugen! Hope you good !
i got an error:
where can i get this required stuff?
Code:
local mouse = require "mouse"
local Button_class = require "button class"
I thought we were very limited on requiring stuff inside reaper!
Thank you
|
|
|
09-20-2017, 09:18 PM
|
#7
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
You do not need this!
Just put comments
|
|
|
09-20-2017, 09:21 PM
|
#8
|
Human being with feelings
Join Date: Feb 2017
Posts: 4,820
|
Quote:
Originally Posted by eugen2777
You do not need this!
Just put comments
|
why do you need them?
i commented but then i get errors after errors!
|
|
|
09-20-2017, 09:23 PM
|
#9
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Well, you have to create a very simple script!
Last edited by eugen2777; 09-20-2017 at 09:41 PM.
|
|
|
09-20-2017, 09:29 PM
|
#10
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Now, any connection will be fine!
I'm saying exactly!
|
|
|
09-20-2017, 09:32 PM
|
#11
|
Human being with feelings
Join Date: Feb 2017
Posts: 4,820
|
Quote:
Originally Posted by eugen2777
Now, any connection will be fine!
I'm saying exactly!
|
i don't know i tried and something not good here! or probably you should update the initial code! just saying! i'll try tommorow!
Good night!
|
|
|
09-20-2017, 09:38 PM
|
#12
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Ok. I have very symple example usage.
Code:
----------------
function msg(m) reaper.ShowConsoleMsg("\n" .. m) end
--------------------------------------------------
function get_script_path() -- script_path and name from reaper function
local filename = select(2, reaper.get_action_context())
local script_path, script_name = filename:match("^(.*)[\\/](.+)")
return script_path, script_name
end
----------
function modify_package_path(new_path) -- add new path to package.path
package.path = package.path .. ";" .. new_path .. "/?.lua"
end
-- Get pathes -------------------------------------
local script_path, script_name = get_script_path()
-- Add script path to package.path
modify_package_path(script_path)
local FXChain = require "FXChainForTest"
----------------------------------------------------------
-- Test!!!------------------------------------------------
----------------------------------------------------------
track = reaper.GetSelectedTrack(0, 0)
function SeAllFXBypass(track)
local fx_cnt = reaper.TrackFX_GetCount(track)
local fx_chain = FXChain.Get(track)
for i = 1, fx_cnt do
local fx_chunk = FXChain.GetFXChunk(fx_chain, i)
local bp1, bp2, bp3 = fx_chunk:match("BYPASS (%d) (%d) (%d)\n")
if bp1 == "1" then bp1 = "0" elseif bp1 == "0" then bp1 = "1" end
local new_state = "BYPASS ".. bp1 .. " " .. bp2 .. " " .. bp3 .. "\n"
fx_chunk = fx_chunk:gsub("BYPASS %d %d %d\n", new_state)
FXChain.SetFXChunk(fx_chain, fx_chunk, i)
end
local use_src_track_chunk = false
FXChain.Set(track, fx_chain, use_src_track_chunk)
end
function SeAllFXOffline(track)
local fx_cnt = reaper.TrackFX_GetCount(track)
local fx_chain = FXChain.Get(track)
for i = 1, fx_cnt do
local fx_chunk = FXChain.GetFXChunk(fx_chain, i)
local bp1, bp2, bp3 = fx_chunk:match("BYPASS (%d) (%d) (%d)\n")
if bp2 == "1" then bp2 = "0" elseif bp2 == "0" then bp2 = "1" end
local new_state = "BYPASS ".. bp1 .. " " .. bp2 .. " " .. bp3 .. "\n"
fx_chunk = fx_chunk:gsub("BYPASS %d %d %d\n", new_state)
FXChain.SetFXChunk(fx_chain, fx_chunk, i)
end
local use_src_track_chunk = false
FXChain.Set(track, fx_chain, use_src_track_chunk)
end
|
|
|
09-20-2017, 09:43 PM
|
#13
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Are you alive there?
|
|
|
09-21-2017, 01:30 AM
|
#14
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@eugen2777
Be patient ! Scripts for developers have less feedbacks than others. Sometimes they are too specific and it takes a while before someone bump the thread. People need time to find the script, understand the code, make their experiments, and their are often from different time zones... that doesn't your work isn't appreciated. People love your stuffs !
In this case, I think just a bit more documentation is needed.
:P
|
|
|
09-21-2017, 08:19 AM
|
#15
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Quote:
Originally Posted by eugen2777
If you need a thing - spread it back!
Just look, the thing is really cool!
|
Sorry, I'm currently out of these things(especially chunking) and more about
developing stuff for everyday use (for example RS5k and Sequence management)
|
|
|
09-21-2017, 12:15 PM
|
#16
|
Human being with feelings
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
|
Very cool arsenal of functions! I wıll use em in my further scripts. Thanx a lot!
Do you plan to do this for items (Items Chunks)? would be completely awesome
|
|
|
09-21-2017, 12:56 PM
|
#17
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Very useful functions! Thank you eugen!
|
|
|
10-22-2017, 05:43 PM
|
#18
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
I updated the script.
<PROGRAMENV...> section now regarging.
And all plink rebuilds when FX chain changed
|
|
|
10-24-2017, 12:38 PM
|
#19
|
Human being with feelings
Join Date: Apr 2014
Posts: 4,175
|
Just like to pop into this thread to say good work!
I've written mostly my own dedicated functions to deal with track/fx chunk parsing - but always thought it would be neat to have a dedicated set of functions that just work and can be relied upon.
Your functions look a little neater than mine and your command of the Lua language definitely appears more advanced than my own so thanks for sharing - it's always useful to analyze others code to see where I can improve my own.
Unfortunately for my paid work I moved on from languages like C and C++ 20 years ago - and have been programming in VB and VBA for so many years now that I've developed a coding style more suited to that. It takes a while to adjust to the more efficient methods of programming in a language like Lua. I will say that since learning Lua, the switch back to VB for work each day is a painful one
|
|
|
11-01-2017, 12:56 PM
|
#20
|
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
|
Thanks eugen for all your great scripts, did not check this yet, but after your initial comment, I thought I have to thank here also! Thanks a lot for great scripts and sharing them generously, like mpl and many many others! Thanks to all of you.
|
|
|
11-09-2017, 06:57 AM
|
#21
|
Human being with feelings
Join Date: Aug 2012
Posts: 271
|
Hello, lb0. Perhaps this small code will help other people avoid the errors associated with the chunks.
Some errors when working with the chunk are not obvious and are difficult to detect.
For example:
Combination PARENV(LFO, Links etc) + more then one FX + Allow Live FX multiprocessing on in preferences.
This is a critical error.
It is in all scripts, even in SWS extensions(Resources>FXChain)
Last edited by eugen2777; 11-09-2017 at 07:09 AM.
|
|
|
11-11-2017, 11:21 AM
|
#22
|
Human being with feelings
Join Date: Apr 2014
Posts: 4,175
|
Quote:
Originally Posted by eugen2777
Hello, lb0. Perhaps this small code will help other people avoid the errors associated with the chunks.
Some errors when working with the chunk are not obvious and are difficult to detect.
|
Thanks Eugen - I shall take a look when I have a bit of time to work out what I need to do to fix. Are you saying your code here works ok - if so I shall analyse.
Thanks for the solution. No idea how you worked that one out!!
Now to implement thoughout my code :/
Last edited by lb0; 11-11-2017 at 03:44 PM.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 02:14 AM.
|