Old 11-15-2014, 10:13 AM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default Takes Random Action - Pan and More

Hi !

Concept :
In motion design, it is well known than Randomization is one of the key of very complex compositing, involving small amount of small materials. It allows to add diversity, and if it is well down, the trick is invisible for the viewer.
Let's bring this to audio :P

Context :
In my works, I create a lot of custom ambiances from recorded sounds. And some ambiances are just a big mix of a lot of other sounds. To make it sound more natural, and more rich, I have to do a lot of random stuff on all the takes. Pan, Volume, Pitch, Stretch... Things Like that.

Here is a practical example => Screenshot.
As you can see, there is more than 200 hundreds small sounds just for this ambiances (which is just few minutes in my project).
And I have to pan it randomly... manually.


Feature Request :
It would be OH SO MAGIC if we could have Pan Selected Takes Randomly and even better : Pan Selected Takes Randomly with Envelope - cause it will let us see the results of the random pan action.

Actual Solutions :
  • Do it manually =>time consumming but efficient
  • Bring all the samples in a sampler that allow random parameters and modulation => very time consuming (you have to set all your sample in it) and not as flexible as a native solution.

Inspiration :
In the SWS extensions, there is a brillant Action by Xenakios : Pan Selected Track Randomly.

More Ideas :
We could imagine some other random takes action : Random Volume For Selected Items, Random Pitch Shifting, Random Time Stretching... all of the small things we do manually do create complex ambiances !

Advanced :
Random is cool but controlled is better. What about a contextual window to let us choose Minimum and Maximum, Distribution Type (default or gaussian) and Center Shift ?

What do you think of that ?
Could I open a feature request ? :P

Thanks for listening !

Last edited by X-Raym; 11-15-2014 at 11:11 AM.
X-Raym is offline   Reply With Quote
Old 11-15-2014, 10:49 AM   #2
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Here's an EEL script (Pan active takes randomly):
http://forum.cockos.com/showthread.p...80#post1429380
spk77 is offline   Reply With Quote
Old 11-15-2014, 11:10 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

!!!
That was fast !

Reassure me, you already have it in stock ? :P

That is actually a good start ! It could (and will) save me a lot of time :P I will discuss about your script and possible enhancement on your thread !

Thank you again !
X-Raym is offline   Reply With Quote
Old 11-15-2014, 11:30 AM   #4
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Quote:
Originally Posted by X-Raym View Post
!!!
That was fast !

Reassure me, you already have it in stock ? :P

That is actually a good start ! It could (and will) save me a lot of time :P I will discuss about your script and possible enhancement on your thread !

Thank you again !
That is actually a quite simple script
I added another script - "reset take pan to center"

(It's already possible by using the Media item properties -dialog, but there's no action for it)
spk77 is offline   Reply With Quote
Old 11-15-2014, 11:40 AM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

Simple but effective !

This reset center is a very nice idea !! I thought it was already in, you have forestall our needs :P

I just found your EEL: Take envelope scripts thread, this is impressive !

Do you think it is possible to make a Media Item Pan to Media Item Envelope action that does the following (or maybe just step 2 and three) :
  1. Reset Pan Envelope Media Item (avoid envelope conflict) - already in SWS action (Set Active Take Pan Envelope to Center)
  2. Copy Pan Media Item Property Value
  3. Create a Pan Take Envelope with the previous value stored.
  4. Set Pan Media Item to Center (avoid pan conflict) - already exist - it is the script you just made :P
It will solves one of the feature request which is basically the same thing that you did but with envelope, and allow more flexible workflow in one shot :P

Last edited by X-Raym; 11-15-2014 at 11:50 AM.
X-Raym is offline   Reply With Quote
Old 11-15-2014, 11:57 AM   #6
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Quote:
Originally Posted by X-Raym View Post
Simple but effective !

This reset center is a very nice idea !! I thought it was already in, you have forestall our needs :P

I just found your EEL: Take envelope scripts thread, this is impressive !

Do you think it is possible to make a Media Item Pan to Media Item Envelope action that does the following (or maybe just step 2 and three) :
  1. Reset Pan Envelope Media Item (avoid envelope conflict) - already in SWS action (Set Active Take Pan Envelope to Center)
  2. Copy Pan Media Item Property Value
  3. Create a Pan Take Envelope with the previous value stored.
  4. Set Pan Media Item to Center (avoid pan conflict) - already exist - it is the script you just made :P
It will solves one of the feature request which is basically the same thing that you did but with envelope, and allow more flexible workflow in one shot :P
It should be possible. (There aren't many API functions to manipulate envelope points from EEL script, but I still think it's doable )
spk77 is offline   Reply With Quote
Old 11-15-2014, 12:04 PM   #7
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

It would be very useful, in every kind of projects !
Pan envelopes are more advanced, more ergonomic and more easily tweakable than standard mediam item pan.
X-Raym is offline   Reply With Quote
Old 11-18-2014, 07:12 AM   #8
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

Quote:
There aren't many API functions to manipulate envelope points from EEL script
Let me know if I have to open a Feature Request for this Media Item Pan to Media Item Envelope, if what's in the API isn't enough for what we (you :P) are trying to achieve.
X-Raym is offline   Reply With Quote
Old 11-19-2014, 05:33 PM   #9
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Quote:
Originally Posted by X-Raym View Post
Let me know if I have to open a Feature Request for this Media Item Pan to Media Item Envelope, if what's in the API isn't enough for what we (you :P) are trying to achieve.
I haven't tried yet, but Media Item Pan to Media Item Envelope should be possible.


I've been working on this "randomization tool":

(Testing the "weighted randomization" -thing)


(Not finished yet )
spk77 is offline   Reply With Quote
Old 11-19-2014, 05:40 PM   #10
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

An UI for that !! Awesome
And different Seeds, that's nice !

This look very VERY powerful !!!
The UI helps really a lot to understand what will happend

I'm patiently waiting for news about Media Item Pan to Media Item Envelope :P

You rock !
X-Raym is offline   Reply With Quote
Old 11-19-2014, 05:44 PM   #11
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Quote:
Originally Posted by X-Raym View Post
An UI for that !! Awesome
And different Seeds, that's nice !

This look very VERY powerful !!!
The UI helps really a lot to understand what will happend

I'm patiently waiting for news about Media Item Pan to Media Item Envelope :P

You rock !
Thanks
I'll try that Media Item Pan to Media Item Envelope tomorrow.
spk77 is offline   Reply With Quote
Old 11-19-2014, 05:54 PM   #12
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

Good luck on this !
I have no doubt you will find a way

Thanks you again very much !
X-Raym is offline   Reply With Quote
Old 11-19-2014, 07:28 PM   #13
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

I just have an idea !
Do you think it would be possible have several points of influence for the randomisation ?
This way we could say 'i want my sounds to be pan especially 75 left and 75 right and not very much to the center'.
This would be very useful for ambiances sounds cause it will allow to leave more room for the center (basicly occupied by the dialogs tracks).
I guess the maths behind must be more complicated... But it worth it

Once again, thank you for you hard work !
X-Raym is offline   Reply With Quote
Old 11-20-2014, 07:50 AM   #14
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Added Create take pan envelope from take pan (reset take pan to "center"):
http://forum.cockos.com/showpost.php...99&postcount=6
spk77 is offline   Reply With Quote
Old 11-20-2014, 08:28 AM   #15
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

Just see it, and... wow... !
You will find my answer on the dedicated thread

Thank you for all you done for this feature request, which became even more advanced that what I could have dream of.

More about Distribution and Influence Points
Here is a graph about a more complex distribution involving two points of influence (which is nice for stereo) to illustrates what I said in my previous post. (I don't made this graphs, I am just interesting by the curves behaviour).


Here is another exemple :


What do you think of that ?
X-Raym is offline   Reply With Quote
Old 11-20-2014, 09:13 AM   #16
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

I'm using this simple way to approximate normal distribution:

Code:
Random numbers are an essential part of computer games and simulations.
Functions in most software development tools output random numbers with uniform distribution.
Simulations often need random numbers in normal distribution.
An easy way to approximate normal distribution is to add three random numbers:

G = X + X + X

X = a uniformly distributed random number between -1 and 1.

G ~ a standard normal random number.

To adjust the result for your needs, just
multiply by your desired standard deviation
and
add your desired mean.

R = Gσ + μ
http://www.protonfish.com/random.shtml

(I think I know how to apply two independent "influence points" - possibly with different mean/standard deviation )

Last edited by spk77; 11-20-2014 at 09:18 AM.
spk77 is offline   Reply With Quote
Old 11-20-2014, 10:09 AM   #17
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

This seems to be a nice efficient way !
I will read the article, I'm curious about that.

The more flexible solutions will be the ability to define X amounts of influence points. But I guess that 1, 2 or 2 (if we need one on left side, one on center and one at right), will be the more common distributions.
However 4-5 points can be great too

Question : can points have a negative influence ? For example say "I won't the chance to fall in center to be very VERY low). for Example, using the ReaEQ graph as a curve generator :


Note : I don't know if Negative if the proper mathematical term according to your formulas but I think you get the idea
X-Raym is offline   Reply With Quote
Old 11-20-2014, 02:59 PM   #18
Claudiohbsantos
Human being with feelings
 
Join Date: Aug 2014
Location: New York
Posts: 132
Default

Wow, this is amazing. Thanks both of you for thinking of the workflow and writing the script. I often have to do the same process and stupidly enough hadn't though of automating it until I saw this thread =p
Claudiohbsantos is offline   Reply With Quote
Old 11-20-2014, 03:02 PM   #19
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

@Claudiohbsantos
Your support is very appreciated
Stay tuned for updates on this !
X-Raym is offline   Reply With Quote
Old 11-22-2014, 11:35 AM   #20
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

A small trick for having two points of influence for random pan takes (before any news from the great spk77 ) :

Select Your Item
  • SWS : Toggle Selected Items Selected Randomly... => 50%
  • Put Selected in An Other Tracks
  • spk77 script : Pan Active Takes Randomly (normal Distribution) on the selected takes from the new tracks and on the takes on the other tracks (with two opposite ranges)
Not as effective as a well written script but it can help !
X-Raym is offline   Reply With Quote
Old 11-23-2014, 01:43 PM   #21
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

With all your formulas, I just succeed to make a Pitch Envelope version of your first random pan envelope script !!
I will try to adapt what I done to your GUI version.
Here is my work on this so far. Hope it can help !
(not : link is temporary)
X-Raym is offline   Reply With Quote
Old 11-25-2014, 08:44 AM   #22
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

Hi !
Is there any way to modify take playback rate with eel script ? I don't find functions on this in the API.
(it would be an other great way to randomize items, especially if "preserve pitch" is randomized too
EDIT : this is not necessary to include in a script, a simple trick as explain in #20 could do the trick)

With Pan, Pitch and Playrate randomization, we could really generated full ambiances in a very handy efficient way, with few sounds !

Last edited by X-Raym; 11-25-2014 at 09:15 AM.
X-Raym is offline   Reply With Quote
Old 11-25-2014, 09:13 AM   #23
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Quote:
Originally Posted by X-Raym View Post
Hi !
Is there any way to modify take playback with eel script ? I don't find functions on this in the API.
Hi,
Do you mean "take playback rate"?

(takes can get random rates from 0 to 2 in this script)
Code:
function rand_take_pb_rate() local(i, item, take)
(
  i = 0;
  loop(CountSelectedMediaItems(0), 
    (item = GetSelectedMediaItem(0, i)) ? (
      (take = GetActiveTake(item)) ? (
        //GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");
        SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rand(2));
        SetMediaItemTakeInfo_Value(take, "B_PPITCH", floor(rand(1) + 0.5)); // random "preserve pitch"
      );
    );
    i += 1;
  );
  UpdateArrange(); // refresh arrange view
  Undo_OnStateChange("Randomize take playback rate");
);

rand_take_pb_rate();
EDIT: added: random "preserve pitch"

Last edited by spk77; 11-25-2014 at 09:18 AM.
spk77 is offline   Reply With Quote
Old 11-25-2014, 09:22 AM   #24
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

That's it !
Just tested : it works !

I will certainly be able to make a normal distribution function for this if needed, with all you other scripts as references.

I don't know how to thank you for all of this !
X-Raym is offline   Reply With Quote
Old 11-25-2014, 09:34 AM   #25
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,666
Default

Quote:
Originally Posted by X-Raym View Post
That's it !
Just tested : it works !

I will certainly be able to make a normal distribution function for this if needed, with all you other scripts as references.

I don't know how to thank you for all of this !
Glad it works!
"Normal distribution function" for this would be nice.
(Let me know if you need help with it )

I think I'm going back to this slider function/"class": http://forum.cockos.com/showthread.php?t=150499, for a while. I'm also trying to make "editbox" and "button" -classes too.
spk77 is offline   Reply With Quote
Old 11-26-2014, 07:13 AM   #26
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

You definitely deserve some rest after all you have done on this !

With your consent, I will probably share the scripts on github to allow people to see the source code, propose enhancement, and have the ability to follow the updates
X-Raym is offline   Reply With Quote
Old 11-27-2014, 03:07 PM   #27
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

Here is it :
REAPER-EEL-Scripts/Randomize take playback rate (normal distribution).eel at master · X-Raym/REAPER-EEL-Scripts



Now, let's try with GUI... !
X-Raym is offline   Reply With Quote
Old 12-17-2014, 08:32 AM   #28
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

I just made Volume with GUI !

REAPER-EEL-Scripts/X-Raym_Nudge active takes volume randomly (normal distribution) with GUI.eel at master · X-Raym/REAPER-EEL-Scripts

Cheers !
X-Raym is offline   Reply With Quote
Old 08-18-2017, 04:26 AM   #29
crackinkid
Human being with feelings
 
Join Date: Nov 2016
Posts: 51
Default

I know, this is a really old thread. But I though this might be the right place to ask for a script that sets the "Start in source" (take properties) to a random point. And another script the sets the start in source to 0. I would do this by myself, but i have no clue about coding, so any help is greatly appreciated :}.

And btw thnx 4 all the scripts you guys already did. you two make awesome stuff!
crackinkid is offline   Reply With Quote
Old 01-17-2020, 01:08 PM   #30
lowellben
Human being with feelings
 
lowellben's Avatar
 
Join Date: Aug 2010
Location: They put me in a home.
Posts: 3,280
Default

This seems to only change the audio in small increments closer to the original value. Is there a script that does it more like the pan randomizer where the values are huge in variation? I've tried adjusting the settings of this nudge script but the volumes always seem to be so quiet and small.

Am I missing it? Say, I wanted to randomly range between plus +3 dB or -3 dB from original value.
__________________
47.8% of statistics are made up.
lowellben is online now   Reply With Quote
Old 01-17-2020, 01:16 PM   #31
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,315
Default

@lowellben
It is small cause it is a normal distribution approximation, so centered reults come more often than edges which are extremly rare.



You can try to set the divergence to maximum (40 on the second slider - dont really sure what it is 40, maybe an error in label) and it should give you something like +10 -10. But again, it is normal distribution. Not full random.
X-Raym is offline   Reply With Quote
Old 01-17-2020, 01:59 PM   #32
lowellben
Human being with feelings
 
lowellben's Avatar
 
Join Date: Aug 2010
Location: They put me in a home.
Posts: 3,280
Default

Quote:
Originally Posted by X-Raym View Post
@lowellben
It is small cause it is a normal distribution approximation, so centered reults come more often than edges which are extremly rare.



You can try to set the divergence to maximum (40 on the second slider - dont really sure what it is 40, maybe an error in label) and it should give you something like +10 -10. But again, it is normal distribution. Not full random.

Oh I didn't make the connection with normal vs gauss sorry! Thanks. Can I ask how to accomplish full random not normal?
__________________
47.8% of statistics are made up.
lowellben is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.