Old 03-31-2019, 02:58 PM   #441
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 23
Default

Quote:
Originally Posted by mrelwood View Post
Ah, that one’s on me, sorry! The error message tells us that there is an invalid character ”)” at row 22 in the @block section. Last row in the @block section has a closing parenthesis that has no opening parenthesis to be closed. I usually put one after the question mark like this: ”? (”
That would fix the error, and the code should (hopefully) execute.
Hi. Im back home again and did the fix you suggested. Works as a charm. And now I know that number represented wich line ot look at

Gonna get back to the original lowpass idea asap

Regards /Bo
danerius is offline   Reply With Quote
Old 04-03-2019, 04:22 AM   #442
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 23
Default

Quote:
Originally Posted by mrelwood View Post
Ok, you're already at a good start! The idea is interesting and I have no idea how it would sound. Let's make this happen!

What the Maximizer does is it writes the current sample value to "buffer[bufpos]". At launch both are at zero, so the memory slot written to is 0+0. Near the end of the code a one is added to "bufpos", so the next sample goes to mem slot 0+1, etc. Once "bufpos" is larger than "bufSize", "bufpos" goes back to zero.

At this point we have as many samples stored as the "bufSize" determines. Now you just average the samples starting from "buffer[0]" to "buffer[bufSize]" and put out the result.

In order for the result not to come out a full "bufSize" too late, the plugin must set the PDC. In the Maximizer the "bufSize" is adjustable, so it is in the "@slider" section.

Let me know if you were able to follow what I wrote and let's find out what kind of assistance you need next.
Hi

I had a shot at demystifing the Zero Maximizer and this is what I came up with. Ive commented at each section with what I presuming its doing + the bit where I have very little idea of whats happening. Needless to say I havent tried running this. Its simply not finished

Thanks and regards /danerius


//The slider sets number of samples to be stored and averaged
//They need to be odd numbers to set a correct midpoint.
slider1:3<1,101,2>LowPass (Number/Samplerate)

in_pin:left input
in_pin:right input
out_pin:left output
out_pin:right output

//"buffer" zeros current memory slot
//"pdc_delay" sets a midpoint for samples to be averaged
//"buOffs" resets the stored samples and restarts the averaging
@slider
buffer = 0;
pdc_delay = slider1 / 2;
bufOffs = bufSize + 1;

//"bufPos" is the input for samples to store. ie the left channel
//The second line here is where I get confused. I copied the bits that looked
//like something that could work. And left out what looked like maximizing related
//bits of the code. But theres no reference to the slider value. So Im more than
//certain it wont work.
@sample
buffer[bufPos] = spl0;
(bufPos += 1) > bufSize ? bufPos = 0 ;

//
danerius is offline   Reply With Quote
Old 04-03-2019, 07:51 PM   #443
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,306
Default

You might just word them out differently, but it sounds like a few things call for a better explanation.

Quote:
Originally Posted by danerius View Post
//They need to be odd numbers to set a correct midpoint.
I thought like that at first as well. But I think the center point is meaningless. The code can only average the samples after they have all been stored, and it can only output the result once new samples will no longer affect the result. So it should always calculate the average from the sample ”now” backwards to "slider1" samples ago. It doesn’t matter wether it averages 2 or 3 samples, it will still store the latest sample and output the average of all samples.

I think of it as a box that I’m dragging across sand. The box has holes in the front and back. As I drag it forward, at every step a bunch of sand gets into the box from the front hole, gets mixed with the previous sand particles, and a part of the sand mix drops out from the rear hole. The box can be 2 or 3 feet long, makes no difference.

Quote:
//"buffer" zeros current memory slot
Not quite. Memory slots in JS are just simple numbers from [0] onwards. ”Buffer” is not a memory slot, only the first zero in 0+[0]. ”Buffer” is never changed in this plugin, so it is always just zero. "buffer[bufPos] = 0" would zero the memory slot. Or "[0] = 0".

Quote:
//"pdc_delay" sets a midpoint for samples to be averaged
No, pdc_delay is just the amount of samples that other plugins are delayer for. It does not affect the output or behaviour of your plugin.

Quote:
//"buOffs" resets the stored samples and restarts the averaging
Like all others, “bufOffs” is just a parameter that can have a single value. Here the “bufOffs” is given the value of “bufSize +1”. If bufSize (the slider in ZCM) is 3, bufOffs would now be 4.

The above lines were in the @slider section, so they are executed only when a slider is changed.

Quote:
//"bufPos" is the input for samples to store. ie the left channel
“bufPos” is the second number in 0+[0]. So the memory slot being written to in “buffer[bufPos]” is “buffer” + “bufPos”.

Quote:
//The second line here is where I get confused.
The second line actually combines two lines of code. I’m sure they make more sense when separated:
bufPos += 1;
bufPos > bufSize ? bufPos = 0 ;

Quote:
But theres no reference to the slider value.
In ZCM “bufSize” is the slider value. The part that you didn’t include in your code was in the @slider section (simplified as):
pdc_delay = bufSize = slider3;
Which sets both of the parameters to the value of the slider3.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 04-04-2019, 01:52 PM   #444
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 23
Default

Quote:
Originally Posted by mrelwood View Post
I thought like that at first as well. But I think the center point is meaningless. The code can only average the samples after they have all been stored, and it can only output the result once new samples will no longer affect the result. So it should always calculate the average from the sample ”now” backwards to "slider1" samples ago. It doesn’t matter wether it averages 2 or 3 samples, it will still store the latest sample and output the average of all samples.
Hi and thanks for explaining. I really have a lot to learn...

Back to the Gaussian Averaging. The idea was to look ahead in time in order to get phase linearity. ie. The midpoint of the averaging to line up with the current sample. If you cant - then theres not much point. But never mind. Ive got other ideas Id like to try

Lets try an exponential smoothing filter with an extra smoothing tail? The math goes like this

[0] * 0.1 + [1] * 0.9
+ ( [1] - [2] * 0.5

This presumes that [x] is the buffer number with zero being current sample. Its basically adding 10% of the current sample to 90% of the buffer [1]. Plus a subtracting of the buffer [2] from [1] times 0.5

The actual multiplication numbers are supposed to be adjustable. These are just examples to get things going.

Best regards /danerius
danerius is offline   Reply With Quote
Old 04-04-2019, 10:16 PM   #445
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,306
Default

Quote:
Originally Posted by danerius View Post
Hi and thanks for explaining. I really have a lot to learn...
I have noticed that once the basics of coding started to feel natural, I was able to start thinking in code as well. Meaning that I was able to isolate the parts of what I want to achieve, and more importantly approach the goal through thinking how it would be best achieved in code.

Which brings me to the Averager. Pretty much ANYTHING can be done, but it’s not always simple to translate the thought process from math to code. I’m doing my best (translating back and forth to my spoken language as well), because I think the JS is an extraordinary environment, and I would love to see more beginners to jump aboard.

Quote:
The idea was to look ahead in time in order to get phase linearity.
Obviously the code can’t look into the future. But that doesn’t mean the end result is not achieveable! I don’t know how to explain how linear time can be harnessed in code, but let me try to open some analogies I use.

One is a pile of papers. You read the topmost paper and find that it has math calculations. You read the paper row by row from top to bottom, and calculate everything. Once youre done, you put the paper to outbox and start reading the next paper in the pile. It has the exact same calculations, and you calculate all of them again. That’s how the code reads every sample.

Then a running race track, each track representing a track in Reaper. Everybody runs at the same speed in a neat line. Now one of the runners tells everyone else to stay back and give him a 5 meter lead. They love to work together, so they do. Now others will see the one runner as being in the future, while actually he’s not, everybody else is just in the past.

That’s what the PDC does. It doesn’t read from the future, but it tells everyone else to give it a head start. The end result is the same though, so phase linearity is achieveable since all other runners are on the same line

In order to calculate anything that involves samples from different positions in time, all the samples must of course be measured (and stored) first.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 04-05-2019, 08:03 AM   #446
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 23
Default

Quote:
Originally Posted by mrelwood View Post
I have noticed that once the basics of coding started to feel natural, I was able to start thinking in code as well. Meaning that I was able to isolate the parts of what I want to achieve, and more importantly approach the goal through thinking how it would be best achieved in code.
Yep. And I am not there yet

Quote:
Originally Posted by mrelwood View Post
IObviously the code can’t look into the future. But that doesn’t mean the end result is not achieveable! I don’t know how to explain how linear time can be harnessed in code, but let me try to open some analogies I use.
Awrite. Now I get it. I thought DAWs had the ability to look ahead in time. Makes sense to delay everything else. So I guess youd have to set pdcdelay to the full length of the averaging. And then find a way to have everything play back in time? Wich sounds like all the other tracks needs to involved?

Best regards /danerius
danerius is offline   Reply With Quote
Old 04-05-2019, 08:20 PM   #447
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,306
Default

[QUOTE=danerius;2117708]Yep. And I am not there yet [quote]
Of course not, that’s why we are here! )

Quote:
I thought DAWs had the ability to look ahead in time. Makes sense to delay everything else. So I guess youd have to set pdcdelay to the full length of the averaging. And then find a way to have everything play back in time? Wich sounds like all the other tracks needs to involved?
If you only have one track, it doesn’t matter how much the plugin delays the signal. If you have other tracks, PDC kind of is the amount that the plugin will look into the future. No other timing needs to be done. But the code must output something at every sample, this was not yet present in your example.

Usually the process goes like this:
1) ”buffer” is zero. ”Size” is for example 10.
2) Write to mem slot ”buffer”.
3) Increase ”buffer” by one.
4) If ”buffer” is bigger than ”size”, ”buffer” = 0.
5) Output from slot ”buffer”.
Repeat lines 2-5 for every sample.

So the sample we wrote to mem slot ”0” will only be played back after ”buffer” goes back to zero, which takes 10 samples in the above example. Meanwhile we can process the samples stored in any or all of the mem slots. Set PDC to 10 as well, and other tracks will also hold the samples for 10 samples before output, so the tracks are still in perfect sync. Just 10 samples late.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..

Last edited by mrelwood; 04-05-2019 at 08:29 PM.
mrelwood is offline   Reply With Quote
Old 04-06-2019, 01:55 AM   #448
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 23
Default

Quote:
Originally Posted by mrelwood View Post
So the sample we wrote to mem slot ”0” will only be played back after ”buffer” goes back to zero, which takes 10 samples in the above example. Meanwhile we can process the samples stored in any or all of the mem slots. Set PDC to 10 as well, and other tracks will also hold the samples for 10 samples before output, so the tracks are still in perfect sync. Just 10 samples late.
First of all. All this help is very much appreciated

So - in my head. Averaging at a midpoint of all these samples is gonna require quite a novel concept. And its one that I cant see a way of doing. Yet... This plugin idea needs to take samples ahead, but also back in time. For example: Five samples ahead plus five samples back and then playing that back at its midpoint. A pdc_delay plus regular delay isnt gonna do that?

On a sidenote. Ive borrowed this concept from image processing. Specifically Blurring. Wich looks at the pixels surrounding the pixel to be processed and averages that. Just as in audio - theres high and low frequencies + dynamics in images. If we boldy swap the concept of pixels for samples. Image processing has a number of different and very interesting manners to massage those. I havent found anyone using these methods in audio. At least that I know of.

Images has the upside of being static in time. So you can cross process pixels all you want and your computer will be fine with it. With audio, samples operate in a now-specific-time-paradigm. I dont know if theres a way to navigate around that?

Best regards /danerius

Edit.... Maybe you could use one method of averaging for samples ahead? Plus a different one for the samples back in time? Like a Weighted Average first and then an Exponential Smoothing...?

Last edited by danerius; 04-06-2019 at 02:15 AM. Reason: Brainwave.... :D
danerius is offline   Reply With Quote
Old 04-07-2019, 02:10 AM   #449
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,306
Default

Quote:
Originally Posted by danerius View Post
This plugin idea needs to take samples ahead, but also back in time. For example: Five samples ahead plus five samples back and then playing that back at its midpoint.
Aha! No, it doesn’t have to be played back at the midpoint! You can play back the effect tomorrow and it’ll be exactly the same. If the computer needs to calculate the effect for an hour, then it’ll just play back after an hour. Not stuck in the actual ”now” any more than image processing is. There is always some latency present when playing back digital audio, so we never hear the ”now” of the computer reading the audio file anyway.

I guess this is the thing holding back your thought process. In the end the concept of time doesn’t matter to a computer, it will calculate the effect when asked to, be it an image or an audio file. And the calculations will take the time they need.

Quote:
Images has the upside of being static in time. So you can cross process pixels all you want and your computer will be fine with it. With audio, samples operate in a now-specific-time-paradigm. I dont know if theres a way to navigate around that?
Sure there is. Forget the idea of ”now”. Continuing the pile of papers analogy, the person reading the paper (code) will take the time he needs, and only then give the calculations (sample) forward.

Actually, in image processing you have to first load the pixels both left and right of the center of the blur, and only then calculate the blur, right? Same goes for audio processing, you have to gather up all relevant samples around the center point before doing the averaging.

Quote:
Edit.... Maybe you could use one method of averaging for samples ahead? Plus a different one for the samples back in time?
Sure you can, but you don’t have to.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 04-07-2019, 10:14 AM   #450
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 23
Default

Quote:
Originally Posted by mrelwood View Post

I guess this is the thing holding back your thought process.

Sure there is. Forget the idea of ”now”. Continuing the pile of papers analogy, the person reading the paper (code) will take the time he needs, and only then give the calculations (sample) forward.

Actually, in image processing you have to first load the pixels both left and right of the center of the blur, and only then calculate the blur, right? Same goes for audio processing, you have to gather up all relevant samples around the center point before doing the averaging.
Yep. My idea of what computer + code can do is limited. Im basically superconcious of stuttering audio playback wich in my head is my computer shuffling samples + MIDI and trying to play them in sync. But maybe thats something else?

Best regards /danerius
danerius is offline   Reply With Quote
Old 04-07-2019, 03:37 PM   #451
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,306
Default

Quote:
Originally Posted by danerius View Post
Im basically superconcious of stuttering audio playback wich in my head is my computer shuffling samples + MIDI and trying to play them in sync. But maybe thats something else?
Shuffling, as in mixing the order they should be in? No...

It's all about buffers. When the computer reads an audio file, it reads a piece of it into a buffer, a temporary storage. Reading a file from a hard drive is sometimes faster, sometimes slower, but the output of the buffer that we hear must be exactly 44100 (or 48000 etc) times per second. If the reading of the file happens too slow, the buffer gets empty and the output of the buffer is suddenly zero. That is a stutter.

In an audio plugin that utilizes buffers, the input and output speeds of the buffer are the same, so the plugin itself won't stutter. But if there are too many calculations that should be made and the computer can't make them in time, the output of the buffer is slower than 44100 per second. That too is a stutter.

It's like a photo editor missing a deadline while the newspaper should already be in the press!
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 04-08-2019, 08:49 AM   #452
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 23
Default

Quote:
Originally Posted by mrelwood View Post
It's like a photo editor missing a deadline while the newspaper should already be in the press!
Got it Recently Ive been having issues with MIDI and some plugins messing up timing. Im not sure why but its off by quite a bit. Mostly Nicky Romeros KickStart wich tends to makes everything stutter wildly. Considering its an automated volume adjuster. Im a bit surpriced it does. Your KickbAss is way better

Thats actually on my list on plugins Id like to make? A very simple tempo-based sidechain thing. Unless someone made a JS one already.

Best regards /danerius
danerius is offline   Reply With Quote
Old 04-12-2019, 07:23 AM   #453
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Hello, I've been using "song switcher" script, but my problem is that to all the songs have to be in one project and this is so much CPU usage. Is there any other solution? I don't mind if I have to wait 10 seconds for every song switches.
Thanks!
Foxssg is offline   Reply With Quote
Old 04-12-2019, 10:31 PM   #454
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,108
Default

Welcome to the Reaper Forum !

Take a look at the introductional Thread in the "Live" subforum, to get some hints about different ways to some workflorw options.
-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 04-15-2019, 04:02 AM   #455
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Quote:
Originally Posted by mschnell View Post
Welcome to the Reaper Forum !

Take a look at the introductional Thread in the "Live" subforum, to get some hints about different ways to some workflorw options.
-Michael
Thank you, Are you talking about this " https://forum.cockos.com/showthread.php?t=213568 " ? I've read it but I don't find a solution for this. I didn't read anything about songs change, I've made a python's script to change songs, but it's no ideal, for every new setlist I have to write a new code, and I don't think that it would be as reliable as I want (I wrote it using pyautogui so if something unexpected happens it could be a big issue at live).
Foxssg is offline   Reply With Quote
Old 04-15-2019, 07:31 AM   #456
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,108
Default

Yep. This thread.

But I don't even know what exactly is meant by "song switching".
-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 04-19-2019, 06:33 PM   #457
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Quote:
Originally Posted by mschnell View Post
Yep. This thread.

But I don't even know what exactly is meant by "song switching".
-Michael
I want to be able to switch projects pressing one key.
For example, I've a project for every song, in a show it could be 7-10 songs, so there are 7-10 projects, I want to start from song 1 and pressing one key close song 1 and go to song 2, then with the same key close song 2 and go to song 3, and another key to go to the previous project.
I've used the script song switcher, but the script works with one project within all the songs, it's too heavy and when I'm playing lots of keys in my piano the sound loses quality.

I've write this in python:

import os, sys, pyautogui, time


os.system("x-terminal-emulator -e /bin/bash")
time.sleep(1)
pyautogui.typewrite('xdg-open song1')
pyautogui.press('enter')
time.sleep(10)
pyautogui.press('esc')
time.sleep(1)
pyautogui.press('space')
time.sleep(340)
pyautogui.hotkey('alt', 'f4')
time.sleep(10)
pyautogui.typewrite('python3 python_song2.py')

That works but it's awful, and painful to change between setlist. I've to edit all the python files that is one for every song, and I've to know how many seconds every song lasts and it can't change backwards.
Foxssg is offline   Reply With Quote
Old 04-19-2019, 07:40 PM   #458
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,668
Default

Quote:
Originally Posted by Foxssg View Post
I want to be able to switch projects pressing one key.
There are actions for that:
  • Previous project tab
  • Next project tab
The ProjectList tool from the SWS extension might be useful too.

Quote:
Originally Posted by Foxssg View Post
I've used the script song switcher, but the script works with one project within all the songs, it's too heavy and when I'm playing lots of keys in my piano the sound loses quality.
I've replied to the script's thread, I'm guessing it's due to a configuration or track routing issue.

(I'm myself using Song switcher in live projects made of more than 400 tracks/18 songs/nine simultaneous keyboards..)

Last edited by cfillion; 04-19-2019 at 07:49 PM.
cfillion is offline   Reply With Quote
Old 04-21-2019, 08:13 AM   #459
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Quote:
Originally Posted by cfillion View Post
There are actions for that:
  • Previous project tab
  • Next project tab
The ProjectList tool from the SWS extension might be useful too.



I've replied to the script's thread, I'm guessing it's due to a configuration or track routing issue.

(I'm myself using Song switcher in live projects made of more than 400 tracks/18 songs/nine simultaneous keyboards..)
I'll check it out, thank you!
Foxssg is offline   Reply With Quote
Old 04-22-2019, 08:14 AM   #460
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Quote:
Originally Posted by cfillion View Post
There are actions for that:
  • Previous project tab
  • Next project tab
The ProjectList tool from the SWS extension might be useful too.



I've replied to the script's thread, I'm guessing it's due to a configuration or track routing issue.

(I'm myself using Song switcher in live projects made of more than 400 tracks/18 songs/nine simultaneous keyboards..)
Thank you, next project tab seems to work flawlessly so far. Do you know how to save a session with differents project tabs?
I'm using Linux and I only see win/mac for SWS, thank you!
Foxssg is offline   Reply With Quote
Old 04-22-2019, 08:30 AM   #461
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,668
Default

SWS ProjectList allows saving and restoring a list of project tabs. You can either build SWS from source (instructions here) or download my prebuilt Linux binaries at https://cfillion.ca/files/sws/2.10.0.0-linux/.
cfillion is offline   Reply With Quote
Old 04-22-2019, 05:16 PM   #462
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Quote:
Originally Posted by cfillion View Post
SWS ProjectList allows saving and restoring a list of project tabs. You can either build SWS from source (instructions here) or download my prebuilt Linux binaries at https://cfillion.ca/files/sws/2.10.0.0-linux/.
Perfect, thank you, I'll try this later!
Foxssg is offline   Reply With Quote
Old 04-29-2019, 07:21 AM   #463
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Quote:
Originally Posted by cfillion View Post
SWS ProjectList allows saving and restoring a list of project tabs. You can either build SWS from source (instructions here) or download my prebuilt Linux binaries at https://cfillion.ca/files/sws/2.10.0.0-linux/.
I've been playing around and so far everything works perfect, thank you! Setting up everything it's not that easy as cantabile, but it seems to has all the functions that cantabile has! The only thing that I can't figure out is how to create a macro to change a track volume in a particular second of the song and then 30 seconds later change it back.
Foxssg is offline   Reply With Quote
Old 04-29-2019, 07:43 AM   #464
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,668
Default

Volume envelope?
cfillion is offline   Reply With Quote
Old 04-29-2019, 10:27 AM   #465
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 58
Default

Please, help to make a script like this one "cfillion_Move right edge of selected automation items to end of time selection.lua" for the "left edge" as well, or both edges at the same time.
Skorobagatko is offline   Reply With Quote
Old 04-29-2019, 06:24 PM   #466
Foxssg
Human being with feelings
 
Join Date: Mar 2019
Posts: 10
Default

Quote:
Originally Posted by cfillion View Post
Volume envelope?
Thank you so much, you rock! If anyone finds this thread and wants to do this with a midi file:
track/envelopes/togglevolumne (pre-fx) active
Then you create a new point (right click), it was really easy.
Foxssg is offline   Reply With Quote
Old 05-05-2019, 06:17 AM   #467
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,306
Default

I'm having trouble figuring out how to get a bunch of nested functions to reference to the correct parameters while oversampling. I'm not sure if this can even be done exactly this way. If not, I'd love to hear suggestions. I'm not very advanced with coding, and JS is the only language I (somewhat) know.



The issue is with assigning the fixed parameters (red text) for each filter, that should then be referenced to from the nested functions. There are multiple hp-filters and multiple calls from the oversampled section.

The way I observe "this.." call to work is this:
this.param1 -> first.second.third.param1
this..param1 -> first.second.param1

So the root level ("first") is always included. Problem is that the root function title is different when creating the parameter and when executing the "hp-run" function.
"first.this.third.param1" would solve the issue, but it doesn't work, "this" can only be in the beginning.

So, how do I create the fixed parameters in multiple "hp-init" functions that can be called from the nested "hp-run" function?
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 05-05-2019, 07:06 PM   #468
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,306
Default

I solved the above issue by assigning an id value for every initialization of the filter. The fixed parameters are now stored to (buffer+id*10)[0], ...[1] etc during initialization, and instead of the name, they are called only by the id value of the function call. Now all nested function calls can have an individual name, in format:
this.hp1.hp-run(input , id);

Still, if there is a better way to do this, I'm eager to learn!
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 05-12-2019, 08:46 AM   #469
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Düsseldorf, Germany
Posts: 36
Default Receive OSC messages from Control Surface

Hey,

is there any way to receive OSC messages from reaper control surfaces in c++ plugin extensions?

Thanks!
Burtan is offline   Reply With Quote
Old 05-13-2019, 04:10 AM   #470
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,078
Default

I'm trying to set tempo envelope display range via .lua script but I can't seem to make REAPER redraw the envelope with the new values.

Code:
local tempoenvmin = reaper.SNM_GetIntConfigVar("tempoenvmin", -222)
local tempoenvmax = reaper.SNM_GetIntConfigVar("tempoenvmax", -222)

local button, value = reaper.GetUserInputs("Set tempo map display range", 2, "Min:,Max:", tempoenvmin .. "," .. tempoenvmax)
if button == true then
	local min, max = value:match'(.*),(.*)'
	min, max = math.floor(tonumber(min)), math.floor(tonumber(max))
	if min > max then local tmp = min; min = max; max = tmp; end
	if min <= 0 then min = tempoenvmin end

	reaper.PreventUIRefresh(1)
	reaper.SNM_SetIntConfigVar("tempoenvmin", min)
	reaper.SNM_SetIntConfigVar("tempoenvmax", max)
	reaper.PreventUIRefresh(-1)

	reaper.UpdateArrange()
	reaper.UpdateTimeline()
	reaper.TrackList_AdjustWindows(false)
end
Update API doesn't seem to work and so doesn't the show/hide tempo envelope action run after the script.

Anyone got any idea on how to do this?
Breeder is offline   Reply With Quote
Old 05-13-2019, 12:20 PM   #471
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Düsseldorf, Germany
Posts: 36
Default

Quote:
Originally Posted by Burtan View Post
Hey,

is there any way to receive OSC messages from reaper control surfaces in c++ plugin extensions?

Thanks!
Ok, I found out it is partially possible. You can register an observer of an action call via hookcommand2, which transfers OSC float values when the action is listening to osc messages. Integer and strings as values of the osc message call the hook without values.
Burtan is offline   Reply With Quote
Old 05-14-2019, 03:56 AM   #472
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,198
Default

Quote:
Originally Posted by Breeder View Post
I'm trying to set tempo envelope display range via .lua script but I can't seem to make REAPER redraw the envelope with the new values.

Code:
local tempoenvmin = reaper.SNM_GetIntConfigVar("tempoenvmin", -222)
local tempoenvmax = reaper.SNM_GetIntConfigVar("tempoenvmax", -222)

local button, value = reaper.GetUserInputs("Set tempo map display range", 2, "Min:,Max:", tempoenvmin .. "," .. tempoenvmax)
if button == true then
	local min, max = value:match'(.*),(.*)'
	min, max = math.floor(tonumber(min)), math.floor(tonumber(max))
	if min > max then local tmp = min; min = max; max = tmp; end
	if min <= 0 then min = tempoenvmin end

	reaper.PreventUIRefresh(1)
	reaper.SNM_SetIntConfigVar("tempoenvmin", min)
	reaper.SNM_SetIntConfigVar("tempoenvmax", max)
	reaper.PreventUIRefresh(-1)

	reaper.UpdateArrange()
	reaper.UpdateTimeline()
	reaper.TrackList_AdjustWindows(false)
end
Update API doesn't seem to work and so doesn't the show/hide tempo envelope action run after the script.

Anyone got any idea on how to do this?
Haven't tested this, but you could try triggering an update by zooming in once and zooming out once.
It's forced but may help.
If not, then it's probably a case,where setting the config-vars doesn't update the UI.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 05-14-2019, 03:59 AM   #473
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,198
Default

Quote:
Originally Posted by Burtan View Post
Ok, I found out it is partially possible. You can register an observer of an action call via hookcommand2, which transfers OSC float values when the action is listening to osc messages. Integer and strings as values of the osc message call the hook without values.


Ohh, nice!
If you get this working, could you try to add that to SWS or the JS-extension from Julian? This would be really really nice to have access to
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 05-14-2019, 09:38 AM   #474
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,668
Default

Quote:
Originally Posted by Breeder View Post
I'm trying to set tempo envelope display range via .lua script but I can't seem to make REAPER redraw the envelope with the new values.

Update API doesn't seem to work and so doesn't the show/hide tempo envelope action run after the script.

Anyone got any idea on how to do this?
https://forum.cockos.com/showthread.php?t=220431
cfillion is offline   Reply With Quote
Old 05-14-2019, 12:02 PM   #475
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Düsseldorf, Germany
Posts: 36
Default

Quote:
Originally Posted by mespotine View Post
Ohh, nice!
If you get this working, could you try to add that to SWS or the JS-extension from Julian? This would be really really nice to have access to
I'm right now implementing this for my Live plugin, which is meant to recall track and plugin settings based on presets. I'm using the sws code as a basis (actually the cfillion fork with cmake added). I'll see what I can do to make this available for others. However the functions seems to be buggy:

// val/valhw are used for actions learned with MIDI/OSC.
// val = [0..127] and valhw = -1 for MIDI CC,
// valhw >=0 for MIDI pitch or OSC with value = (valhw|val<<7)/16383.0,
// NON_API: bool onAction(KbdSectionInfo *sec, int command, int val, int valhw, int relmode, HWND hwnd);

The formula value = (valhw|val<<7)/16383.0 is only working for values from 0 to 1. This makes sense for MIDI pitch, but not for OSC. Additionally it would be very nice to have raw int values working as well!
Burtan is offline   Reply With Quote
Old 05-15-2019, 01:53 AM   #476
Colemapt
Human being with feelings
 
Join Date: May 2019
Posts: 1
Default How do I use macros with plugins?

I'm try to make my life easier when it comes to quantizing guitar parts to the grid. However ive learned a great trick to make the dynamic split tool super accurate, that trick is to filter out all sound below 1000 HZ that way the only transient and sound is that of the guitar pick, making it super easy to see when each note is being played. Here is what i want to do:



Create a duplicate of the track

Apply a High Pass filter at 1000 Hz to the duplicate

Freeze the duplicate track to mono

Dynamic Split the duplicate track (using the write stretch markers to selected items action instead of the split)

"Propagate take to all similarly named active takes"

"Stretch Markers in selected item" / "Snap to grid"

Delete the duplicate track....


All with one shortcut... Is this possible? It seems like a lot but the only issues I'm having right now is getting the plugin onto the track with a macro command and getting passed the dynamic split without having to press enter. It would save me so much time editing tracks if this is possible.

EDIT: I DID IT and it works amazing, I am new to this forum and want to share my action with everyone, is there a specific place i should upload it to??

Last edited by Colemapt; 05-16-2019 at 08:48 PM. Reason: figured it out
Colemapt is offline   Reply With Quote
Old 05-15-2019, 09:53 AM   #477
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Düsseldorf, Germany
Posts: 36
Default

// NON_API: bool onAction(KbdSectionInfo *sec, int command, int val, int valhw, int relmode, HWND hwnd);

I did some more re(a)search. val and valhw are taking values raging from 0 to 127. That makes a total range of 0 to 16383. The formula to translate Floats from 0.0 to 16383.0 is:

float = (127 - val) * 128 + (128 - valhw);

However adding decimals beside .0 gives totally other results.

@mespotine
What would you exactly need?
Burtan is offline   Reply With Quote
Old 05-22-2019, 05:39 AM   #478
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,078
Default

Quote:
Originally Posted by mespotine View Post
Haven't tested this, but you could try triggering an update by zooming in once and zooming out once.
It's forced but may help.
If not, then it's probably a case,where setting the config-vars doesn't update the UI.
Sorry for the late reply and thank you for answering - I'll test it when I get the chance.

edit: nope, still isn't working. I think this wraps up all the ways in which you could try and force REAPER to refresh this :/

Quote:
Originally Posted by cfillion View Post
Thanks - this would really be a good option to have per-project anyway.
Breeder is offline   Reply With Quote
Old 05-24-2019, 05:50 AM   #479
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,198
Default

Quote:
Originally Posted by Breeder View Post
Sorry for the late reply and thank you for answering - I'll test it when I get the chance.

edit: nope, still isn't working. I think this wraps up all the ways in which you could try and force REAPER to refresh this :/
Ok, another stupid idea: change the height of the envelope. Or maybe do Sort EnvelopePoints(maybe including temporarily adding a point, that you removed after it again).

I'm pretty sure there's a way, but I currently take a break from coding so can't test it myself.

@Burtan
Which post are you refering to? My OSC-related-questions?
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635

Last edited by mespotine; 05-24-2019 at 05:56 AM.
mespotine is offline   Reply With Quote
Old 05-24-2019, 05:57 AM   #480
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,198
Default

Quote:
Originally Posted by Colemapt View Post
I'm try to make my life easier when it comes to quantizing guitar parts to the grid. However ive learned a great trick to make the dynamic split tool super accurate, that trick is to filter out all sound below 1000 HZ that way the only transient and sound is that of the guitar pick, making it super easy to see when each note is being played. Here is what i want to do:



Create a duplicate of the track

Apply a High Pass filter at 1000 Hz to the duplicate

Freeze the duplicate track to mono

Dynamic Split the duplicate track (using the write stretch markers to selected items action instead of the split)

"Propagate take to all similarly named active takes"

"Stretch Markers in selected item" / "Snap to grid"

Delete the duplicate track....


All with one shortcut... Is this possible? It seems like a lot but the only issues I'm having right now is getting the plugin onto the track with a macro command and getting passed the dynamic split without having to press enter. It would save me so much time editing tracks if this is possible.

EDIT: I DID IT and it works amazing, I am new to this forum and want to share my action with everyone, is there a specific place i should upload it to??
Sure, open a new thread specifically for your script. Welcome to the forums
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   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 04:41 AM.


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