View Issue Details

IDProjectCategoryView StatusLast Update
0001564OpenMPTFeature Requestpublic2024-11-30 01:39
Reportertennisers Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0001564: randomization of effects/velocity
Description

i posted this in the irc before but i missed if i got a response or not. i would be interested to have a right-click menu option for randomizing effects and velocity within a given range. there are several possible cases. for velocity, the idea would be self-explanatory. for volume effects, only the 2nd param can be randomized. for effects, there's the case of effects that go from 00 to FF (Exx/Fxx/Oxx), effects that have two arguments which are both factored in (like vibrato), effects that have 2 arguments where one of the arguments must be 0 (Dxx/Kxx/Lxx), and effects that have only one param (SCx/SEx/S7x) etc. I would be interested in forking mpt and working on this myself if it seems possible with mpt's architecture.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2022-02-05 23:12

administrator   ~0005040

I remember rewbs started working on something like this way back in 2006 but all of that code has been removed from the codebase because it wasn't doing anything useful (all the randomization was in fact missing, just some basic GUI setup was there). If you want to give this a try yourself, I'd recommend having a look at the EffectInfo class which provides range information for various pattern effects. This is also what is used for the Find&Replace dialog, for example.

tennisers

tennisers

2024-07-29 17:52

reporter   ~0006027

Last edited: 2024-07-29 17:54

It's been a long time but I started working on this back in May of this year and recently resumed and made some progress today, I think I'll be able to complete an initial version of this feature soon, then I'll be happy to share it for wider feedback and code review. I based my initial version off the code for interpolation.

Saga Musix

Saga Musix

2024-07-29 18:27

administrator   ~0006028

Cool!

tennisers

tennisers

2024-10-04 23:33

reporter   ~0006077

Hi, I was still working on this really slowly, my idea to base the code off interpolation ran into an issue, where i realized that if multiple columns are selected, then it could be different effects that are selected to randomize, so different ranges would apply. I copied the find in range code and ui window for the find and replace dialog so i could select a range, but i accidentally copied it inside the iteration across multiple columns, so the same window pops up for each column, and the range can be entered there. That would be a good enough approach for me to do what I wanted, but it seems very hacky. Also, i was gonna do the same stuff for notes and instruments, and I'm not sure if it makes sense to randomize those per column, as there isn't as much of a reason that one would want different ranges there. I was thinking ideally there could be just one window in general, but it lists all the columns for effects. However, I don't know of any windows that are dynamically generated like that. i think at least if I can change the randomize range UI window text to reflect which column it's on, that would be less weird for a user, is there an ability to dynamically change the window title? Sorry for a lot of text, I'm just trying to get out all my thoughts.

Saga Musix

Saga Musix

2024-10-05 00:41

administrator   ~0006078

Yes, I don't expect that there is an easy, intuitive answer for this, and maybe a couple of things just have to be tried to figure out which one feels the best. Regarding the multi-column selection, we have the Data Entry shortcuts for example, which only update the leftmost column type across the selection (so if the selection starts in the instrument column, only this column will be modified across all selected channels). Do you think that would make sense here and make things easier?

However, I don't know of any windows that are dynamically generated like that

The closest to that might be CDefaultVstEditor which generates a repeated set of controls.

is there an ability to dynamically change the window title

That would be SetWindowText.

tennisers

tennisers

2024-11-28 04:48

reporter   ~0006218

Last edited: 2024-11-28 04:51

Further update: I have a public fork containing my initial implementation: https://github.com/terrytheplatypus/openmpt-randomize/tree/firstDraft. I haven't implemented 100% of what I want, but pretty close to ironing out the main functionality (randomization working for notes, instruments, velocity, and effects, with some bugs remaining to be fixed.) Currently I have the dialog boxes popping up for each column still, I hadn't tried what I mentioned in the previous post. I'd rather get something a bit sloppy out for feedback than labor over the perfect thing and never put it out for people to see.

Saga Musix

Saga Musix

2024-11-28 18:18

administrator   ~0006221

Very nice! I'll have a look at it ASAP.

tennisers

tennisers

2024-11-30 01:19

reporter   ~0006233

Further question: Initially I naively started using this CommandHasTwoNibbles() function to determine whether I would want the range of effects to be capped at FF or just at F, with my initial use case being Sxy effect in .it, but that had unwanted behavior because it capped the range for Hxy and Jxy from 0 to F, only randomizing the second nibble. I finally used the EffectInfo class's IsExtendedEffect function, and that worked specifically for Sxy (.it) and Exy (.xm) but I would also like it to cap the range for EFx from 0 to F and it doesn't see that as an extended function so it still just sees it as Exx, so the IsExtendedEffect function is insufficient. Looking at the code, i see this is because the Sxy and Exy effects have a paramMask defined, but the finetune effect doesn't have one defined, is that a bug?

Saga Musix

Saga Musix

2024-11-30 01:39

administrator   ~0006234

For IT/S3M-style fine portamentos, there isn't really any specific rule in EffectInfo, I'm afraid. The only thing it does is formatting the parameter nicely for fine and extra fine slides, but otherwise assumes it's a full-range command. You would probably have to add some special handling for CMD_PORTAMENTOUP/DOWN but only in case CSoundFile::UseCombinedPortamentoCommands is true.

Issue History

Date Modified Username Field Change
2022-02-05 23:07 tennisers New Issue
2022-02-05 23:12 Saga Musix Note Added: 0005040
2024-07-29 17:52 tennisers Note Added: 0006027
2024-07-29 17:54 tennisers Note Edited: 0006027
2024-07-29 18:27 Saga Musix Note Added: 0006028
2024-10-04 23:33 tennisers Note Added: 0006077
2024-10-05 00:41 Saga Musix Note Added: 0006078
2024-11-28 04:48 tennisers Note Added: 0006218
2024-11-28 04:49 tennisers Note Edited: 0006218
2024-11-28 04:51 tennisers Note Edited: 0006218
2024-11-28 18:18 Saga Musix Note Added: 0006221
2024-11-30 01:19 tennisers Note Added: 0006233
2024-11-30 01:39 Saga Musix Note Added: 0006234