Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Structured randomization #10

Closed
cladelpino opened this issue Feb 4, 2018 · 6 comments
Closed

Feature Request: Structured randomization #10

cladelpino opened this issue Feb 4, 2018 · 6 comments

Comments

@cladelpino
Copy link
Contributor

cladelpino commented Feb 4, 2018

Hi, first, amazing work on the modules ! thanks for it 👍

I'm using chained voltSeqs in pattern mode for procedural composition, and would love to see an optional feature where randomization comes from a randomly chosen "structure" i.e. "A" (just one value repeating), "AB" (two values alternating) "ABBA", etc.

I'm totally new to c++ so for now implementing this myself would be a bit burdensome. Nevertheless I've put together a small proof of concept, where voltSeq::randomize() would call the StructGenerator.getValue(step) function:

https://onlinegdb.com/rJ4_JAVLf

I'd love to hear thoughts on this. Thanks again for the amazing work !!!

@cladelpino cladelpino changed the title Feature Request: Structured randomized Feature Request: Structured randomization Feb 4, 2018
@chichian
Copy link
Collaborator

chichian commented Feb 5, 2018

Hi cladelpino. That sounds cool! We can add that in. "Random" seems to be a popular feature.

BTW, you seem to be catching on to C++ quickly (nice PoC)!

@cladelpino
Copy link
Contributor Author

cladelpino commented Feb 5, 2018

jaja yes, more like "never wrote c++", I am not new to programming or OOP :).

If you'd really consider this feature how would you implement it ? Just 2 comments from my point of view:
1- Make it optional, I guess "full" randomization is appreciated and used by many

2- I'm not sure from a user story POV what could be a nice way to piece this. Specially at the degree of user control where of course the more you give, the more you have to intervene the GUI + runtime.
Again I don't really know the costs, but for the sake of enumerating, I can think of four degrees

+: Minimal user control: Pattern "structures" are hardcoded, one is chosen fully at random from a predefined list
+: Minimal+ user control: Pattern "structures" are hardcoded, one is chosen in a "parametrically" random  way from a predefined list (i e have a knob for "degree of variation" <entropy would be a better word but its rather technical :-P >)
+: Medium user control: User can choose a pattern "structure" from a predefined list
+: High user control: Medium + User can add their own structures to this list.

@chichian
Copy link
Collaborator

chichian commented Feb 6, 2018

Yes, I think it would be optional (keeping the traditional 'full' random as an option).

For the degree of user control, probably to start just "Minimal user control" as the option. And then the "High" option either at the same time or at a later release.

For the "High" level, I think the easiest thing to implement would be to have a text box in the context menu [if this is possible, I think I could add a text box as child of a menu item, but I've never tried] where you can define your own and underneath that text box, the menu items would enumerate the list of predefined pattern structures you could chose. If we allow users to add to the list I have to save these values and also implement delete/edit functionality, which while doable, for our time efforts, I'm not sure it would get higher priority over other items. [i.e. it may happen, but no promises].

What do you think? Would just having a Minimal and a 'non-saving' High work for your purposes? And are there any patterns you would like as part of the default list (besides 'A', 'AB', 'ABBA', 'ABAC')?

@cladelpino
Copy link
Contributor Author

First, thanks again for letting me contribute, again I think this is a very good project, and its nice to see its being developed by ambitious yet open devs.

For me, what I termed "minimal" is more than enough. I think that if the patterns are "hardcoded" at build time from a file in github (I say this without knowledge of the module building process), I can contribute a bunch of them to that file.

From the global project viewpoint, I also think that starting with "minimal" is the way to go. If in the future someone else appreciates this feature and requests more user control perhaps some effort can go into other options.

@chichian
Copy link
Collaborator

Thanks for the great ideas. Sorry we haven't gotten back sooner. Life is busy.

The "Minimal" version has been added in this 0.5.5.2 release. If we have time, I would like to add your High version too.

If you want to add more patterns for the predefined mode, look in:
TSSequencerModuleBase.hpp: Edit the constant (I was lazy, the collection is statically defined now).
#define TROWA_SEQ_NUM_RANDOM_PATTERNS 11

and then
TSSequencerModuleBase.cpp: Add your patterns there (#unique vals, pattern).

RandStructure TSSequencerModuleBase::RandomPatterns[TROWA_SEQ_NUM_RANDOM_PATTERNS] = {
	{ 1, { 0 } },
	{ 2, { 0, 1 } },
	{ 2, { 0,0,0,1 } },
	{ 2, { 0,0,1,1 } },
	{ 2, { 0,1,1,1 } },
	{ 2, { 0,1,1,0 } },
	{ 3, { 0,0,1,2 } },
	{ 3, { 0,1,0,2 } },
	{ 3, { 0,1,2,0 } },
	{ 3, { 0,1,1,2 } },
	{ 3, { 0,2,1,2 } }
};

Of course, feel free to implement anything else you desire. There may be a lot of spaghetti in my code, but I think you'd figure it out.

@cladelpino
Copy link
Contributor Author

Ok, just made a PR with some other patterns, let's see how that works !! Off to try your new version :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants