Kara-Moon Forum
March 29, 2024, 03:57:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: SeqRnd  (Read 4317 times)
sciurius
Sr. Member
****
Posts: 443



« on: December 07, 2020, 10:36:48 AM »

Using `SeqRnd` I can have random selection of track sequences. For example:

Code:
SeqSize 4
SeqRnd On
Chord Sequence C1 C2 C3 C4

Can I obtain random selection of more track sequences than `SeqSize`? For example, with `SeqSize 1`, have random selection of a sequence out of a pool of, say, 20 sequences?
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #1 on: December 07, 2020, 04:51:45 PM »

SeqRnd works on 2 levels: track and/or groove. If you set it at a groove level all the the individual tracks keep their "alignment"; at a track level it mashes things up more.

I'm assuming you want something like: "SeqRnd 1 4 9 12" which forces a selection from the listed grooves or tracks? Right now the answer is no. If you think this would be a valuable addition, we can add it to the TODO list.
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #2 on: December 08, 2020, 08:02:08 PM »

I'm looking for ways to make accompaniment parts more lively by introducing small variations. The finest-grain variation is at the sequence level, which should be sufficient (for now). What I would like to achieve is something like:
  • Define a number of sequences, e.g. S01, S02, S03, ..., S10
  • Assign a randomly selected sequence to each bar

With a few sequences this is easy:

Code:
SeqSize 4
Chord SeqRnd On
Chord Sequence S01 S02 S03 S04

but it quickly becomes clumsy when more sequences are involved.
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #3 on: December 08, 2020, 08:59:09 PM »

I don't see a big issue with implementing this Smiley I'll do it later this week ... right after I post 20.12.
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #4 on: December 09, 2020, 12:52:36 AM »

Actually, it already works Smiley

Assuming a groove with 4 sequences and you want to select only seq 2 and 4 from the CHORD track ...

  Chord SeqRnd On
  Chord SeqRndWeight  0 1 0 1

Will do this. The docs really aren't very clear on this ... more work for the doc maintainer Smiley

If you have 100 different sequences ... this will get ugly very fast Smiley
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #5 on: December 09, 2020, 08:23:33 PM »

How about 'electric' sequences...

Code:
Begin Plectrum
    Define S01 ...
    Define S02 ...
    Define S03 ...
    Define S04 ...
    Define S0 AnyOf S01 S02 S03 S04 ...
    Define S1 AnyOf S01 S01 S04 S04 ...
    Sequence S0
End
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #6 on: December 09, 2020, 10:13:14 PM »

MMA has no "AnyOf" keyword. However, it'd be easy enough to add a plugin it provide @AnyOf Smiley
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #7 on: December 10, 2020, 12:11:09 AM »

However ... I think that deprecating SEQRNDWEIGHT and replacing it with a keyword option in SEQRND would make sense. So we could then have:

     [TrackName]  SeqRnd On [Weight=1,2,3,4]

The comma-separated list might make something more obvious to the reader. No shorter. Plus, I'd be less resistant in the future to enhancements which don't require yet-another-keyword Smiley
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #8 on: December 10, 2020, 07:40:19 AM »

Combining SeqRnd and SeqRndWight in a single command is nice!

It does, however, still require all alternatives to be part of the sequence, so you'll need a seqsize at least equal to the number of alternatives.

The AnyOf keyword is, of course, fictional. The idea is twofold: one is decoupling of the alternatives from the seqsize, and second to allow a single sequence (in the example, S0) to be used as an ordinary sequence, but with the added effect of choosing an alternative everytime it is applied.

It is probably easier to implement than explain  Cheesy
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #9 on: December 10, 2020, 04:44:28 PM »

I do understand what you are trying to. My next TODO is to combine the weight into the main command. Let me gel out the other idea into something which not only works, but can be documented Smiley Something to figure for cold, damp weather we're having.
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #10 on: December 29, 2020, 07:03:10 PM »

I got the code working for your initial request. Let me see if I can just send out a patch file or do a dot-release (probably the later). But, here is what I did: add the ONLYFROM option to the SeqRndWeight command. Will work on tracks or globally. So:

    SeqSize 4
    SeqRndWeight  OnlyFrom=1,4

ends up with the identical result as

    SeqRndWeight  1 0 0 1

I see that it's a lot easier if you have 90 sequences: OnlyFrom 1,9,88 Smiley

Let me know if I'm on track.
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #11 on: January 04, 2021, 07:51:37 PM »

You are definitely on track, but I'm not sure it is the track I had in mind.

SeqRndWeight OnlyFrom (I think just 'From' would be better) is an alternative way to set sequence randomizing. From=1,4 is the same as '1 0 0 1'. '2 2 1 1' would then become 'From=1,1,2,2,3,4'? 'From=1-4,1-2'?

In either case, the collection of sequences is controlled by SeqSize.

SeqSize 4
Sequence S1 S2 S3 S4
// applied to 12 bars you get S1 S2 S3 S4 S1 S2 S3 S4 S1 S2 S3 S4
SeqRndWeight From=1,4
// applied to 12 bars you get (e.g.) S1 S1 S4 S1 S4 S4 S4 S1 S4 S1 S1 S4

I would like being able to control the sequence itself.

Define S0 From=1,4 S1 S2 S3 S4
// S0 is now a sequence of one bar
SeqSize 1
Sequence S0
// applied to 12 bars you get (e.g.) S1 S1 S4 S1 S4 S4 S4 S1 S4 S1 S1 S4

Why is it important that it is a one-bar sequence? Because then you can apply it in grooves with arbitrary SeqSize, for example

SeqSize 4
Drums Sequence Dr1 Dr2 Dr3 Dr4
Plectrum Sequence S0

It is so easy in my head, so hard to explain ...
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #12 on: January 04, 2021, 08:40:27 PM »

We might just be looking though the murky glass from different angles.

Matters not if we are talking about global or track command since they work the same way.

You have a seqsize of 4 with seqenences S1, S2, S3 and S4.

SeqRnd ... obvious.

SeqRndWeight OnlyFrom=1,3

Will give S1 and S3 ONLY. But, the order is not predictable. So it might be S1 S3 S3 S1 S1 S3... But only those 2.

SeqRndWeight 1 0 1 0  is the same as OnlyFrom=1,3

If you ONLY want to use S3:  SeqRndWeight 0 0 1 0  OR OnlyFrom=3

Now, you don't want rnd at all. You want a predictable S1 S3 S1 S3 ... ?? Now this isn't more complex, but it is NOT SeqRnd. You can do this right now using (assuming only S3) by putting:

  Seq 3

Before each new bar. Or, you could write an AFTER for that. Simplest version would be

   After Repeat=1 Seq 1

If you want 2 bars of S1 followed by 2 bars of S3, then a more complicated AFTER command would work.

Oh, I agree that OnlyFrom is very long as a command. "From" is probably sufficient. You think a NoRND=True/False would be a good addition?





Logged

My online life: http://www.mellowood.ca
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.055 seconds with 20 queries.