Old 02-14-2019, 01:01 AM   #401
trigger303
Human being with feelings
 
Join Date: Nov 2015
Posts: 15
Default Add keyboard shortcut to an action programmatically

Hi all,

I want to programmatically add keyboard shortcut to certain action,
but it seems that there's no such a function in reaper_plugin_functions.h.

Previously I thought there's a function like this :

bool AddActionShortcut( KbdSectionInfo* section, int cmdID, char* desc, int desclen );

but unfortunately it doesn't exists.
Is there a way to do that ?


Many thanks in advance.
trigger303 is offline   Reply With Quote
Old 02-16-2019, 12:19 AM   #402
Urban Musiq
Human being with feelings
 
Urban Musiq's Avatar
 
Join Date: Nov 2017
Location: Europe
Posts: 31
Default decode rpl format

Quote:
Originally Posted by Xenakios View Post
You are totally out of luck with these opaque data structures. It's the VST plugin's configuration in binary format, encoded here as base64 text strings. It'll be different for each plugin, is in 99.99% of cases undocumented by the plugin maker etc...Pretty much the only thing you can do with these is to copy them as they are or omit them.
Hi there,

I prototype vst plugins in faust and create a lot of creative presets on the way. I want to combine them in a rpl.

Can so help me decode this base64 string? I only get garbage when decoding these strings for a test plugin with only 1 parameter ("gain=1.0"):
Code:
<REAPER_PRESET_LIBRARY `VSTi: abc`
  <PRESET `Default`
    RZaZMu5e7f4AAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAQAAAAAAEAAAAIA/AERlZmF1bHQAEAAAAA==  //1.0
  >
I can automatically warp every preset in a vst plugin and import manally but thats annoying. There is also ardour2fxp.py which should do a similar job, but can handle only 1 preset.

Anyone?

TIA,
Urban
__________________
| Reverb Design | Source Code |
Urban Musiq is offline   Reply With Quote
Old 02-16-2019, 08:14 AM   #403
WyattRice
Human being with feelings
 
WyattRice's Avatar
 
Join Date: Sep 2009
Location: Virginia
Posts: 2,067
Default

Quote:
Originally Posted by trigger303 View Post
Hi all,

I want to programmatically add keyboard shortcut to certain action,
but it seems that there's no such a function in reaper_plugin_functions.h.

Previously I thought there's a function like this :

bool AddActionShortcut( KbdSectionInfo* section, int cmdID, char* desc, int desclen );

but unfortunately it doesn't exists.
Is there a way to do that ?


Many thanks in advance.
I think it's in Reaper extra API in the header "reaper_plugin.h" and not the "reaper_plugin_funtions.h"

Here's an example from an extension.
Code:
gaccel_register_t editMarkersAccelerator = {
	{FCONTROL | FALT | FVIRTKEY, 'D', 0},
	editMarkersAction,
};
There is also an example from the older Reaper extension sdk in the reaper_ninjamloop example.
Here's the link.
https://www.reaper.fm/sdk/plugin/plugin.php

Hope this helps.
Regards,
Wyatt
__________________
DDP To Cue Writer. | DDP Marker Editor.
WyattRice is offline   Reply With Quote
Old 02-18-2019, 08:00 AM   #404
trigger303
Human being with feelings
 
Join Date: Nov 2015
Posts: 15
Default

Quote:
Originally Posted by WyattRice View Post
I think it's in Reaper extra API in the header "reaper_plugin.h" and not the "reaper_plugin_funtions.h"
Thank you very much WyattRice !

I actually tried registering with gaccel_register_t with certain shortcut setting,
but I couldn't get good results.
It doesn't seem to register shortcut for existing action.
(I confirmed I can register new action and its default shortcut with gaccel_register_t)

But maybe my usage is not good... I'll try further.

Thanks !

Last edited by trigger303; 02-19-2019 at 03:21 PM.
trigger303 is offline   Reply With Quote
Old 02-20-2019, 06:15 AM   #405
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Xenakios View Post
Not really, the extremely outdated official SDK has some example projects and there have been examples floating around done for example by me. But those are always painful because the projects can get so easily outdated. Also it's quite tricky to do GUIs with C++. There is nothing like the gfx thing in ReaScript available from the C or C++ Reaper API.

The simplest possible extension plugin code, that does nothing, but makes all the C API functions available, is something like :
Code:
#define REAPERAPI_IMPLEMENT
#include "reaper_plugin_functions.h"

extern "C"
{
	REAPER_PLUGIN_DLL_EXPORT int REAPER_PLUGIN_ENTRYPOINT(REAPER_PLUGIN_HINSTANCE hInstance, reaper_plugin_info_t *rec) {
		if (rec != nullptr)
		{
		   if (REAPERAPI_LoadAPI(rec->GetFunc) > 0) return 0;
                   return 1;
		}
		return 0;
	}
}
You of course have to set up a Visual Studio or Xcode project properly to build a dll for Windows or dylib for macOs to make that work.

Thanks. One more thing I stumbled with, I tried to add my own function as action and one as ReaScript-exposed function. I tried anything I could come up with, but Reaper didn't expose that, so obviously, I was using the plugin_register-function wrong.

So, could you please add to your example one hello-world-action and one helloworld-function, that returns the passed parameter-value(string for example) back?


Something like:
Code:
function HelloWorldAction()
   return "Hello World"
end

function HelloWorldApiFunction(string_parameter)

   return string_parameter
end

that are properly registered in Reaper? This would help me a lot with learning that stuff.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-20-2019, 07:06 AM   #406
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Actually making the plugin add working actions and API functions for ReaScript to use is quite involved. You for example have to implement the action handling callback yourself. Adding API functions requires lots of obscure boilerplate code per added function too. But I'll try come up with some examples. (You probably by the way meant the "hello world" action to actually print something on the Reaper console or show a message box instead of returning a string that isn't going to go anywhere...?)

edit : I made a new "minimal" example here that adds some actions (no API functions yet, doing that is so obscure I'll need to study again how that is done...You could look at Julian Sander's extension plugin for inspiration on that, though) :

https://github.com/Xenakios/reaper_very_minimal
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 02-20-2019, 07:12 AM   #407
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Xenakios View Post
Actually making the plugin add working actions and API functions for ReaScript to use is quite involved. You for example have to implement the action handling callback yourself. Adding API functions requires lots of obscure boilerplate code per added function too. But I'll try come up with some examples. (You probably by the way meant the "hello world" action to actually print something on the Reaper console or show a message box instead of returning a string that isn't going to go anywhere...?)

Thank you.

And yes, I meant to use MB or something to print the HelloWorld


As far as I could see in SWS or JS-Extension-code, there's tons of stuff to do, that I don't understand as I can't get my head around the pure basics.
The more I can get into that, I'll try to write an introduction for new-coders to come up with at least a basic-plugin and documenting potential missteps and stumbling stones and how to set up XCode/VS to make it work at all.

For more complex stuff, like the action/function-register-management in SWS which is quite abstracted away to make stuff convenient, one needs to have more experience in C++ anyway, I guess.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-20-2019, 09:41 PM   #408
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

How to expose API functions: https://forum.cockos.com/showthread.php?p=1963963

Minimal "Hello World" extension example (no need for XCode/VS): https://gist.github.com/cfillion/f32...63abb1eda41400
cfillion is offline   Reply With Quote
Old 02-20-2019, 11:03 PM   #409
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by mespotine View Post
s far as I could see in SWS or JS-Extension-code, there's tons of stuff to do, that I don't understand as I can't get my head around the pure basics.
The more I can get into that, I'll try to write an introduction for new-coders to come up with at least a basic-plugin and documenting potential missteps and stumbling stones and how to set up XCode/VS to make it work at all.
Perhaps check out the threads that I started on this topic in this forum. They chronicle my own step-by-step journey into the world of REAPER extensions:

Most important:
REQ: Example of minimal extension for adding Reascript API

Examples of other threads:
Using CoolScrollBar from C++ extension: undocumented functions?
How to: SWELL_PROVIDED_BY_APP and Linux?
SWS ReaScript: How to pass HWND from Lua to C++: Unknown type HWND
Can extension-provided API functions return strings that contain \0 characters?
Can someone help me build an extension for MacOS?

Last edited by juliansader; 02-20-2019 at 11:09 PM.
juliansader is offline   Reply With Quote
Old 02-21-2019, 10:10 AM   #410
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

@cfillion and Julian Sader

Thanks, I hope this answers most of my questions
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-27-2019, 01:28 PM   #411
Derjayger
Human being with feelings
 
Join Date: Apr 2013
Posts: 36
Default JS: State Variable Morphing Filter

Hello,

it's about JS: State Variable Morphing Filter.

Can you show me a way to change the parameter "Frequency (Scale)"
from 0-100
to frequency (Hz) (like it is in ReaEQ)?

(There is a frequency-display already above the right box.)

I need it badly for lots of pitch-precise automation.

That would be REALLY nice!
Derjayger is offline   Reply With Quote
Old 02-28-2019, 07:50 AM   #412
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Quote:
Originally Posted by Derjayger View Post
Hello,

it's about JS: State Variable Morphing Filter.

Can you show me a way to change the parameter "Frequency (Scale)"
from 0-100
to frequency (Hz) (like it is in ReaEQ)?

(There is a frequency-display already above the right box.)

I need it badly for lots of pitch-precise automation.

That would be REALLY nice!
I guess I needed some off-time, since I decided to do this. Added a Frequency (Hz) slider. You should still be able to use both Scale and Hz sliders.

Here you go: https://stash.reaper.fm/35528/statevariable_Hz
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-01-2019, 06:05 AM   #413
Derjayger
Human being with feelings
 
Join Date: Apr 2013
Posts: 36
Default

Wow, thank you so much! How long did this take you?

[edit] Any idea why automation only works with the effects window open? And why the frequency jumps with a loud pop-noise when starting playback from a point where there is no pitch-change automation?

Last edited by Derjayger; 03-01-2019 at 08:14 AM.
Derjayger is offline   Reply With Quote
Old 03-01-2019, 05:08 PM   #414
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Quote:
Originally Posted by Derjayger View Post
Wow, thank you so much! How long did this take you?
Honestly, since I wanted to have the both controls working, it took most of the time. perhaps an hour total.

Quote:
[edit] Any idea why automation only works with the effects window open? And why the frequency jumps with a loud pop-noise when starting playback from a point where there is no pitch-change automation?
Ha! So much for that solution... The way I got both controls working was to piggyback to the Scale slider. If the slider is not visible, it's not moving, and so isn't the Hz slider either. Just a moment, I'll kill the Scale option.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-01-2019, 07:16 PM   #415
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Managed to fix the dead-when-hidden issue. Automation even works for both Scale and Hz sliders, one at a time of course.

Didn't get it to pop on me.

Here you go:
https://stash.reaper.fm/v/35555/statevariable_Hz_2
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-03-2019, 06:56 AM   #416
Derjayger
Human being with feelings
 
Join Date: Apr 2013
Posts: 36
Default

Thanks a lot!
(Just donated 10 bucks to you, which is rather symbolic, since it's probably not covering your time)
Derjayger is offline   Reply With Quote
Old 03-03-2019, 12:49 PM   #417
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

I have been bothered by the "Scale" slider before, perhaps that's why I wanted to do this now that I (almost) can...

Quote:
Originally Posted by Derjayger View Post
Thanks a lot!
(Just donated 10 bucks to you, which is rather symbolic, since it's probably not covering your time)
Wow, thank you Derjayger!! Don't undermine the value, it means a whole lot to me either way!
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-04-2019, 03:30 PM   #418
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Posts: 2,436
Default

Is there a safe way to read it (by REAPER API or some simple call to VST .dll) if vst effect is an instrument or not?
A lot of PIZ MIDI FX are treated as instruments while they are simply FX preceding main instrument

As far as I've found is TrackFX_GetInstrument() which only detects first instrument in chain and can't be used to check for multiple instrument FXs
Breeder is offline   Reply With Quote
Old 03-04-2019, 04:22 PM   #419
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

If it's specifically about PIZ MIDI FX, you can force them to appear as FX via tweaking pizmidi.ini (so it says there in the comments, but I never tried it myself).
nofish is offline   Reply With Quote
Old 03-05-2019, 12:28 AM   #420
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

@Breeder
https://mespotin.uber.space/Mespotin...tplugins64.ini

is a place to find that information. Vsti means instrument.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-07-2019, 04:47 AM   #421
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Posts: 2,436
Default

Quote:
Originally Posted by nofish View Post
If it's specifically about PIZ MIDI FX, you can force them to appear as FX via tweaking pizmidi.ini (so it says there in the comments, but I never tried it myself).
Quote:
Originally Posted by mespotine View Post
@Breeder
https://mespotin.uber.space/Mespotin...tplugins64.ini

is a place to find that information. Vsti means instrument.

Yeah, I knew somewhere deep inside this was the way but couldn't find the option.
For all the plugins, and not just PIZ, it seems it's there when you rename the plugin in FX browser where you can set it as an instrument or not.


Still, I do sometimes use two synths on the same track so the API solution, if ever developed, might come in handy. I have shortcuts and MIDI learns set to various scripts for disabling only non-instrument FX so would be nice to be able to differentiate between two different instruments on the same track
Breeder is offline   Reply With Quote
Old 03-07-2019, 08:52 AM   #422
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Post it into the Ultraschall-API-thread as Feature-Request and I'll look into that.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-07-2019, 09:46 AM   #423
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

Quote:
Originally Posted by mrelwood View Post
- Click the "Param" button on top of the EQ plugin. And choose Parameter modulation / MIDI link.
- Check the box "Link from MIDI or FX parameter", and choose which FX parameter you want to link.
If something is possible, we can ask next question: Why is it not easier possible?

Example: IO drag to new track and you have your audio send. Similarly parameter drag onto another parameter could exactly do this, meaning activating parameter modulation, selecting link, then assigning from > to. 3 steps in one, would it be possible? Of course. If developers want it. It would just add one more simple drag and drop action then using all the functions which are already there, giving them preset values: parameter modulation, link, target. And this would feel almost like bitwig, if not better. Know it only from youtube videos, never tried bitwig.
TonE is offline   Reply With Quote
Old 03-07-2019, 09:51 AM   #424
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by TonE View Post
Similarly parameter drag onto another parameter could exactly do this, meaning activating parameter modulation, selecting link, then assigning from > to. 3 steps in one, would it be possible? Of course. If developers want it.
Nope, not possible with the GUIs of 3rd party plugins. The host application has no idea where the parameter controls/knobs are in the plugin GUI or what they are. (So operations like mouse dragging won't work.) For Reaper's own Rea plugins it would be possible to implement, though.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 03-07-2019, 04:14 PM   #425
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

Quote:
Originally Posted by Xenakios View Post
Nope, not possible with the GUIs of 3rd party plugins. The host application has no idea where the parameter controls/knobs are in the plugin GUI or what they are. (So operations like mouse dragging won't work.) For Reaper's own Rea plugins it would be possible to implement, though.
But there is an option to switch to normal slider view and there it could work.
TonE is offline   Reply With Quote
Old 03-08-2019, 12:48 AM   #426
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Quote:
Originally Posted by TonE View Post
If something is possible, we can ask next question: Why is it not easier possible?

Example: IO drag to new track and you have your audio send. Similarly parameter drag onto another parameter could exactly do this, meaning activating parameter modulation, selecting link, then assigning from > to. 3 steps in one, would it be possible? Of course. If developers want it. It would just add one more simple drag and drop action then using all the functions which are already there, giving them preset values: parameter modulation, link, target. And this would feel almost like bitwig, if not better. Know it only from youtube videos, never tried bitwig.
That’s what feature requests are for, for the devs to learn what the users want. Maybe make one?

I agree, the feature is well hidden. I do see an issue with dragging a slider to another track though, since the point of sliders is to be dragged, for the control itself. And holding additional keys is for precise, group dragging etc, and impossible to remember unless used constantly. But right-clicking a slider might be an option for this, and perhaps other features as well.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-16-2019, 01:25 PM   #427
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 173
Default Gaussian LowPass

Hi

I thought Id have my first try at making a JSFX-plugin. Its gonna be based on a Gaussian Distribution and therefore needs to look a number of samples both ahead in time and back. I dont think its been tried before and it might sound really cool.

The idea is pretty clear in my head but Im bad at writing actual code. Im doing this so I can learn. And if you guys would be willing to walk me through this. It'd be very much appreciated. I literally dont know where to start.

So to get up and going. Lets start with averaging a number of samples. Lets say nine: Five back in time + four ahead of time. Wich I guess would have a lowpass effect around 5.3 kHz ( 48 kHz / 9 ) if my math is correct....?!?

How would I do that?

Thanks and best regards /Bo
danerius is offline   Reply With Quote
Old 03-17-2019, 02:19 AM   #428
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Quote:
Originally Posted by danerius View Post
How would I do that?
The question I quoted is so vague that people don’t tend to bother replying. You say you are bad at writing code. But you have some experience? Have you looked at the code of the included plugins? How much can you follow what the code does?

While I’m not very advanced myself, I’d like to try and help. But I really don’t know how, or where to start.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-17-2019, 05:15 AM   #429
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 173
Default

Quote:
Originally Posted by mrelwood View Post
The question I quoted is so vague that people don’t tend to bother replying. You say you are bad at writing code. But you have some experience? Have you looked at the code of the included plugins? How much can you follow what the code does?

While I’m not very advanced myself, I’d like to try and help. But I really don’t know how, or where to start.
Hi. Thanks for clarifying that

My experience with code is surface level tinkering with bits of existing code. Mostly HTML, CSS + PHP. Wich means that I can spot the parameters in a code where I need to change it. I can copy + paste bits. I can understand a flow chart for code and what its functions are. But writing code from scratch is beyond me.

I have looked at JSFX-code and changed some parameters in a couple of Reaper plugs to better fit my requirements. But thats it.

================================================== =================

Back to the Gaussian Filter. Ive included two different graphics. Theyre hopefully better illustrations of averaging samples ahead + back in time. The "Gaussian-Filter-2.png" is to show the end goal of the idea. And "First-Filter-2.png" is to show my first goal post for it and check if it actually works as I intended.

This comes from years of working in photoshop with blurring and sharpening images. Wich is essentially the same as reducing or enhancing treble. Some types of blurring are sweeter looking than others. As with sharpening. And I think the math for that can be adjusted + applied to audio as well. Hopefully with interesting results.

An extension of this could be a Laplacian Distribution or Edge Detection Treble/Air Enhancers. Maybe Side Chained Matrix Filters. Wich again. If it works would sound very cool.

Best regards /Bo

PS. BTW. I love the Mrelwood KickbAss DS
Attached Images
File Type: png Gaussian-Filter-2.png (22.5 KB, 262 views)
File Type: png First-Filter-2.png (12.0 KB, 235 views)

Last edited by danerius; 03-17-2019 at 05:21 AM. Reason: typos
danerius is offline   Reply With Quote
Old 03-18-2019, 05:22 AM   #430
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Quote:
Originally Posted by danerius View Post
I have looked at JSFX-code and changed some parameters in a couple of Reaper plugs to better fit my requirements. But thats it.
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!

Quote:
Originally Posted by danerius View Post
But writing code from scratch is beyond me.
Luckily you don't have to! I would take elements from existing plugins that would fit the purpose, and use them. Unless you plan on distributing the plugin, there are no licence issues. (And even if you would, copying the GPL licence with the plugin is often enough.)

What you need is to store samples for later use, and set a Plugin Delay Compensation value. LOSER's great "Zero Crossing Maximizer" has both.

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.

The basic structure of a JS plugin and all the relevant functions are explained in the reference guide, although it is a difficult read for a beginner:
https://www.reaper.fm/sdk/js/js.php

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


Quote:
Originally Posted by danerius View Post
PS. BTW. I love the Mrelwood KickbAss DS
Thanks, that's nice to hear! You know, I think you are the first to spell the plugin title correctly!
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-18-2019, 03:12 PM   #431
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 173
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!
Cool. This is exactly the info + level of support I was looking for
I had a quick look but need to delve deeper into it. Be back as soon as Ive gotten me head - a bit more - around it.

Kiitos /Bo

Last edited by danerius; 03-18-2019 at 11:20 PM.
danerius is offline   Reply With Quote
Old 03-20-2019, 06:58 AM   #432
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 173
Default

Quote:
Originally Posted by mrelwood View Post
Luckily you don't have to! I would take elements from existing plugins that would fit the purpose, and use them. Unless you plan on distributing the plugin, there are no licence issues. (And even if you would, copying the GPL licence with the plugin is often enough.)
Hi

A tiny update. I managed to stumble upon LOSERs Jesusonic Tutorials. So now Im working my way through that. Fiddling with the parameters of the delay + marinating in how the code works.

Question 1: Regarding bufpos. Why is it buffering +1 samples til it reaches the specified parameter and then executing. Instead of buffering specified number of samples, and then executing at the right time? Is that just the way DAWs work? One sample at the time?

Question 2: The info in the right column of the Code Editor? Are those all the available functions in JSFX? Or a selection? See attachment

Best regards /Bo
Attached Images
File Type: jpg JS PlugIn Code Window.jpg (29.9 KB, 248 views)
danerius is offline   Reply With Quote
Old 03-20-2019, 07:46 AM   #433
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Quote:
Originally Posted by danerius View Post
A tiny update. I managed to stumble upon LOSERs Jesusonic Tutorials.
Didn’t know such exists, I better check them out as well!

Quote:
Question 1: Regarding bufpos. Why is it buffering +1 samples til it reaches the specified parameter and then executing. Instead of buffering specified number of samples, and then executing at the right time? Is that just the way DAWs work? One sample at the time?
Exactly. Reaper reads the value of the next sample in the audio file and gives it to the plugin as values in parameters called ”spl0” (left) and ”spl1” (right). The plugin updated the ”spl0” and ”spl1” values, and reads and executes all code in the @sample section. So that section is executed 48000 times per second, for every new sample. (Or whatever the samplerate is set to.)

Other code sections:
@init - is read only at plugin load, srate change, and depending on settings at playback start/stop.
@slider - is read only when you drag the plugin’s slider with the mouse.
@block - is read at every audio buffer start, so every 64-2048 samples, depending on the audio buffer size.
@gfx - is executed max 30 times per second, depending on how hard the computer is working.
The section before @init is only read once at plugin load. Sliders and some options are set there.

Quote:
Question 2: The info in the right column of the Code Editor? Are those all the available functions in JSFX?
Not exactly, they are all parameters in the plugin code. If you set ”myage = 128;” in the code, it will show up on the right. You can filter the list by typing ”age” at the filtering field below, then the list will only show ”myage”, ”yourage”, ”cages” etc, if you have them set in the code. And who doesn’t, right? ;o)
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-21-2019, 08:40 AM   #434
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 173
Default

Quote:
Originally Posted by mrelwood View Post
Didn’t know such exists, I better check them out as well!

Exactly. Reaper reads the value of the next sample in the audio file and gives it to the plugin as values in parameters called ”spl0” (left) and ”spl1” (right). The plugin updated the ”spl0” and ”spl1” values, and reads and executes all code in the @sample section. So that section is executed 48000 times per second, for every new sample. (Or whatever the samplerate is set to.)

Other code sections:
@init - is read only at plugin load, srate change, and depending on settings at playback start/stop.
@slider - is read only when you drag the plugin’s slider with the mouse.
@block - is read at every audio buffer start, so every 64-2048 samples, depending on the audio buffer size.
@gfx - is executed max 30 times per second, depending on how hard the computer is working.
The section before @init is only read once at plugin load. Sliders and some options are set there.

Not exactly, they are all parameters in the plugin code. If you set ”myage = 128;” in the code, it will show up on the right. You can filter the list by typing ”age” at the filtering field below, then the list will only show ”myage”, ”yourage”, ”cages” etc, if you have them set in the code. And who doesn’t, right? ;o)
Kiitos mrelwood

Heres LOSERs Tutorial: https://wiki.cockos.com/wiki/index.p...sonic_Tutorial

Ive done some research on the things you mentioned. Much appreciated and helpful. Still in the learning stage and slowly getting there

Best regards /Bo
danerius is offline   Reply With Quote
Old 03-22-2019, 01:57 PM   #435
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 173
Default Getting to grips with JSFX

Hi

So I managed to take a millisecond based delay and convert it to note length. However it wont start with the set delay value. It defaults to zero. Im guessing its the @init that needs the right instruction? I tried some different things but to no avail. What should it say?

Also. Are there other ways to get note length values other than from sample rate and bpm?

Thanks /Bo

desc:Mono Tempo Delay
slider1:0.5<0,2,0.125>Length 1/4 note

@init
bufpos=0;

@slider
echolength = srate * (60/tempo) * slider1;

@sample
bufpos[0] = spl0 ;
bufpos = bufpos + 1 ;
bufpos > echolength ? bufpos = 0;
spl0 = spl0 + bufpos[0] ;
spl1 = spl0 ;
danerius is offline   Reply With Quote
Old 03-22-2019, 09:18 PM   #436
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

The issue with the delay happens because the "tempo" is not yet assigned during @init, and based on my testing not even at the first execution of @slider. So the echolength is calculated for a tempo of "0".

I don't know why tempo is zero during @init. But because of this the first calculation of "echolength" must happen either in the @block or @sample sections.

I'd like to introduce "user functions", as I would solve this with one:

Code:
@init

firstrun = 0;
function getlength()(
  echolength = srate * (60/tempo) * slider1;
);


@slider

getlength();


@block

firstrun == 0 ? (
  getlength();
);

firstrun = 1;

tempo != tempo_old ? getlength();
tempo_old = tempo;


@sample

// Copy from the original code

- In the @init section we assign the function "getlength".
- If the slider is used, we again just call the function.
- In the @block section, if "parameter "firstrun" is zero, we call the function.
After that we assign "firstrun" to be "1", so the @block call is not executed again until the "firstrun" is reset.
- I also added a condition in @block which if the tempo changes, calls the function.




Quote:
Originally Posted by danerius View Post
Hi

So I managed to take a millisecond based delay and convert it to note length. However it wont start with the set delay value. It defaults to zero. Im guessing its the @init that needs the right instruction? I tried some different things but to no avail. What should it say?

Also. Are there other ways to get note length values other than from sample rate and bpm?

Thanks /Bo

desc:Mono Tempo Delay
slider1:0.5<0,2,0.125>Length 1/4 note

@init
bufpos=0;

@slider
echolength = srate * (60/tempo) * slider1;

@sample
bufpos[0] = spl0 ;
bufpos = bufpos + 1 ;
bufpos > echolength ? bufpos = 0;
spl0 = spl0 + bufpos[0] ;
spl1 = spl0 ;
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..

Last edited by mrelwood; 03-27-2019 at 03:11 AM. Reason: Missed "(" from the code.
mrelwood is offline   Reply With Quote
Old 03-26-2019, 03:56 AM   #437
danerius
Human being with feelings
 
Join Date: Oct 2018
Posts: 173
Default

Quote:
Originally Posted by mrelwood View Post
The issue with the delay happens because the "tempo" is not yet assigned during @init, and based on my testing not even at the first execution of @slider. So the echolength is calculated for a tempo of "0".
Hi. Pardon the late reply but Im traveling and the internet is real slow

Im not sure what Im doing wrong. Ive had issues with the plugin seemingly not updating. And I get this error message. See attachment

Regarding the tempo timing? Would the beat-parameter useful? As opposed to calculating from BPM and samplerate to milliseconds?

Kiitos /Bo
Attached Images
File Type: png plugin error mess.png (19.5 KB, 197 views)
danerius is offline   Reply With Quote
Old 03-27-2019, 01:13 AM   #438
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,528
Default

Quote:
Originally Posted by danerius View Post
Im not sure what Im doing wrong. Ive had issues with the plugin seemingly not updating. And I get this error message. See attachment
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.

Quote:
Regarding the tempo timing? Would the beat-parameter useful? As opposed to calculating from BPM and samplerate to milliseconds?
Nothing wrong with how the timing is currently calculated. ”beat_position” is not very helpful for this purpose.
__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 16" Late '19 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE SC207 .. Focal: Shape 65, Alpha 65, CMS 40, Listen Pro ..
mrelwood is offline   Reply With Quote
Old 03-29-2019, 06:43 AM   #439
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

How can I get the empty-part of the TCP, it's position and size? Breeder did it in SWS for the GetMouseContext-function, but I couldn't understand, what he did to make that happen.

My CPP-knowledge is still too bad for that... :/


And another thing, that came into my mind, maybe interesting for SWS:
Currently, there's no possibility for extension-stuff in the VideoProcessor or JSFX.
Could we use gmem to overcome that?
SWS monitors certain things in the background and constantly updates a gmem-state, that can be accessed in JSFX/Videoprocessor or something, where SWS defines gmem-names.
Or maybe sending "commands" to SWS that way to make things happen, that are usually outside the scope of JSFX.

Though I don't know, if gmem is accessible from C/C++ at all...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-29-2019, 06:45 AM   #440
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by trigger303 View Post
Previously I thought there's a function like this :

bool AddActionShortcut( KbdSectionInfo* section, int cmdID, char* desc, int desclen );
I remember something like that as well. It seemed like opening the Setting of a shortcut-window, usually existing in the Actions-Dialog, afair...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada 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 12:06 PM.


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