Old 04-15-2022, 03:42 PM   #1
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 361
Default Item Modifiers

ITEM MODIFIERS
Item Modifiers is a script that hooks up to my Functional Console script and allows for real-time procedural workflows for creating and mangling items.
People that have experience with 3D software packages (like Houdini or Blender) are likely familiar with workflows like this.



There is a lot to cover in this post, so I will start by explaining the design methodology behind item modifiers.
The main idea is to select an item or some items, and build up a modifier stack to process them in various ways. Modifiers are components that take the output from the previous component, process it, and pass it along to the next one. Here is a simple example:

In the example above, I am using the "Delay Builder" modifier to create a delay out of the selected item, using a pattern to select it, then reversing that pattern.
I can then hit the "Apply" button to apply all the existing modifiers and keep stacking. It is also possible to save entire modifier stacks as a file and load them later.


Another useful option is the generate lua script option through the copy menu:

This generates a lua script that executes what the entire modifier stack does in one go. So if you built up a modifier stack that does something you really like, you can integrate it deeply into your workflow.

In the example above you can see me triggering the generated lua script from the simple delay stack I built above with a hotkey.


I will list the installation steps next, then go into more detail about features and usage after that. Enjoy




INSTALLATION
  • Install ReaPack
  • Add my repository to your ReaPack repositories.
    Code:
    https://raw.githubusercontent.com/Bird-Bird/ReaScript_Testing/main/index.xml
  • Install Item Modifiers through ReaPack.
  • Install ReaImGui through ReaPack.
  • Install js_ReaScript_API through ReaPack. Installing this is optional, however it needs to be installed if you want to use the "generate lua script" feature.
Launch BirdBird_Item Modifiers.lua




MODIFIERS
As described in the introduction, modifiers are the building blocks that create modifier stacks and are the backbone of the script.
While most of the names they have are self explanatory, I will list some special ones down below, this list will likely expand in the future. There are 39 modifiers in total at the time of writing this post.

Tag:

Tags an item selection with a name anywhere during the modifier stack. You can then use the "Get Tag" modifier to retrieve this selection. It is often useful to sandwich modifiers between "Tag" and "Get Tag" modifiers to run operations and keep working on a specific subset of the items.

Pattern Selection:

Selects items in a pattern determined by the checkboxes on the modifier GUI. Repeats and pattern selections combined with tagging is a good base to start building more musical modifier stacks.
  • Note that you can ctrl/cmd click any of the sliders you see to input a value manually. This will also let you go beyond the default ranges for the parameters.



BUTTONS

In this part I will go into what the buttons on the interface do.


Apply: Applies the modifier stack and clears it
Reset: Resets all parameters on the current modifier stack
Clear: Clears the modifier stack and reverts to your initial selection
Seed: Generates a new seed that is used for modifiers that include randomness, this is useful to explore variations

Select: Makes the modifier stack run on your new selection of items instead
Save: Lets you save entire modifier stacks as a ".modstk" file that can be loaded through the load button.
Load: Lets you load modifier stacks from ".modstk" files, or directly from the clipboard.
Copy: There are a few options in the menu accessed through this button:
  • Copy as preset to clipboard
    - This option copies the entire modifier stack to clipboard, which can then be loaded through the load menu. This makes it easy for people to share modifier stacks without having to toss files around.
  • Copy as command to clipboard
    - This option copies the entire modifier stack as a valid Functional Console command.
  • Generate lua script
    - This option generates a lua script that does what the entire modifier stack does in one go. You can then load it through the actions menu and use it however you want. This option will be greyed out if you don't have js_ReaScript_API installed.



MODIFIER LIST

The modifier list on the left is where you add modifiers to the modifier stack. By default the selected modifiers will go at the end of the stack. However you can drag the modifiers themselves to reorder them in the stack.
The filter box at the top lets you search all of the existing modifiers directly. You can focus this filter anywhere in the script by hitting the "f" key on your keyboard.
You can also right click modifiers to add or remove them to your favourites.


That is all of the basic functionality at the moment. In the post under this I will go into how the modifiers themselves were created, and how you can create them yourself.



Extra Notes
* This is an early version and may contain bugs.
* Undo points are finnicky with scripts that update the project in this manner, I am still thinking about how to handle them.
* Feel free to throw any cool modifier stacks that you have created into the thread here. I can build modifiers out of the cool ones and include them in the next versions under the special tag.
* Thanks to all friends that dealt with my ramblings on programming while I was developing this



_
__________________
ReaScript Discord Server | Scripts

Last edited by BirdBird; 04-17-2022 at 11:57 PM.
BirdBird is offline   Reply With Quote
Old 04-15-2022, 03:43 PM   #2
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 361
Default

MODIFIER BUILDER
The modifier builder is the companion script shipped with the main script that lets you create modifiers and test them on the fly. The new modifiers created through here will automatically show up in the main script as long as the user_modifiers.json file is selected during launch.

This editor is what I created first to create the default modifiers that are included with the script itself.
The controls for modifiers are generated from multiline text input on the fly, and can be tested live.


FORMAT
The multiline text has a simple format. It is a sequence of sections seperated by '>' on every line. The full format is:
Quote:
commands > controller_type controller parameters seperated by spaces > label
The "commands" mentioned here are Functional Console commands.
The parameters fetched from the controller are appended to the commands themselves during runtime.
The current controller types are:
  • sd -> slider double, expects 3 parameters (default value, min value, max value)
  • si -> slider int, expects 3 parameters (default value, min value, max value)
  • cb -> checbox, expects 1 parameter (default value, 1 = on, 0 = off)
    - Checboxes let you filter out the entirety of commands in the first section during runtime
  • inpd -> double text input, expects 1 parameter (default value)
  • inpi -> integer text input, expects 1 parameter (default value)
  • inps -> string text input, expects 1 parameter (default value)
  • selp -> selection pattern
    - This one has variable number of parameters determined by the first value in the second section. IE "selp=5 1 0 0 1 0" means that it has 5 parameters by default, and the sequence of 1s 0s afterwards are the default values.

The "Select" button lets you reset your initial selection to a new selection of items like it does in the main script.
Note that this is a developer tool at the moment, and while I put some safeguards in it is likely that I didn't test it as well as the main script. I will likely refine the editor more in the future.


_
__________________
ReaScript Discord Server | Scripts
BirdBird is offline   Reply With Quote
Old 04-15-2022, 03:48 PM   #3
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 1,918
Default

Crazy ideas once again, you're on fire! Thanks
Vagelis is online now   Reply With Quote
Old 04-15-2022, 06:26 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 8,390
Default

This is madness !! 🤯🤯🤯
X-Raym is offline   Reply With Quote
Old 04-15-2022, 07:25 PM   #5
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,699
Default

If you are using this you are one of the coolest kids in the playground


Thanks for your work BirdBird this script is very good, and inspiring !

Last edited by daniellumertz; 04-15-2022 at 09:21 PM.
daniellumertz is offline   Reply With Quote
Old 04-15-2022, 08:50 PM   #6
rgryrgryrgry
Human being with feelings
 
Join Date: Apr 2022
Location: Taiwan
Posts: 10
Default

wow this is insane!
rgryrgryrgry 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 07:03 AM.


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