Kara-Moon Forum
April 20, 2024, 04:28:14 AM *
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] 2
  Print  
Author Topic: After (more)  (Read 8983 times)
sciurius
Sr. Member
****
Posts: 443



« on: May 13, 2020, 12:10:40 PM »

While trying to find out why this doesn't work:

Code:
After Count=2 Drum-KickDrum2   @rhythm Seq=|3-------3-------3-------3-------|
After Count=2 Drum-PedalHiHat  @rhythm Seq=|--------6---------------6-------|
After Count=2 Drum-RideCymbal1 @rhythm Seq=|7-------7----7--7-------7----7--|

It seems that only one After is possible for a specific location, and that subsequent Afters for the same location are silently ignored. Is that intentional?
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #1 on: May 13, 2020, 04:53:46 PM »

No, they should not. They are supposed to be stacked. Are you using this is * repeat?

A few lines of context would help.
Logged

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



« Reply #2 on: May 13, 2020, 05:06:35 PM »

Okay. Yes, it is related to the * repeat stuff.

Code:
After Count=2 print 2A
After Count=2 print 2B
After Count=3 print 3A
After Count=3 print 3B
After Count=4 print 4A
After Count=4 print 4B
  1  z * 6

This prints 2A, 3A, 4A. With 6 lines z instead of the * repeat it prints 2A, 2B, 3A, 3B, 4A, 4B.
Logged
sciurius
Sr. Member
****
Posts: 443



« Reply #3 on: May 13, 2020, 05:39:38 PM »

BTW Are you still considering adding Before? Given the recent changes to After this shouldn't be so hard now Smiley .
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #4 on: May 13, 2020, 06:51:23 PM »

Okay. Yes, it is related to the * repeat stuff.

Code:
After Count=2 print 2A
After Count=2 print 2B
After Count=3 print 3A
After Count=3 print 3B
After Count=4 print 4A
After Count=4 print 4B
  1  z * 6

This prints 2A, 3A, 4A. With 6 lines z instead of the * repeat it prints 2A, 2B, 3A, 3B, 4A, 4B.

Right then. I was scratching my head at some of the code when I was doing the * stuff and wondering why it was like it was ... guess that's the answer Smiley I'll look more!
Logged

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


WWW
« Reply #5 on: May 13, 2020, 06:52:17 PM »

Before? Ummm, not sure ... just what is the point of this?
Logged

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



« Reply #6 on: May 13, 2020, 08:38:58 PM »

Because I cannot do this:

Code:
After Count=1 Drum-KickDrum2      @rhythm  Seq=|3--3--3--3--|
Groove A
  1    z
Groove B
  2    z

After the 1st measure the Drum-KickDrum2 sequence is altered. But the Groove B statement restores the sequences so the change gets lost.

A hypothetical Before would solve this:

Code:
Before Count=2 Drum-KickDrum2      @rhythm  Seq=|3--3--3--3--|
Groove A
  1    z
Groove B
  2    z

Now the sequence alteration takes place before the 2nd bar, and after the groove change.
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #7 on: May 13, 2020, 10:17:39 PM »

Okay, I will need to digest this.
Logged

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


WWW
« Reply #8 on: May 14, 2020, 02:02:50 AM »

I think this fixes the after * problem. In after.py at line 148 out-comment the loop. Should look like this then:

Code:
  fd.close()
  afterData = [ x for x in afterData if x.bar != nn]
  MMA.parse.parseFile(name)

I think we were removing discarded events too many times Smiley

Opps ... editing since it is not quite right. I still need to delete one event since we're getting a duplicate. Well, tomorrow.
« Last Edit: May 14, 2020, 02:04:27 AM by bvdp » Logged

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


WWW
« Reply #9 on: May 14, 2020, 06:59:10 PM »

Hey, that was fun. Keep looking at the recursion, etc. And all along it was just that I wasn't writing all the needed data to the scratch file. The sound you hear is my head and palm connecting Smiley

Anyway, here's the patch. Let me know.

Next, guess I'll have to look at BEFORE Smiley

* patch.txt (1.49 KB - downloaded 207 times.)
Logged

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



« Reply #10 on: May 14, 2020, 07:19:26 PM »

Are you sure this is the right patch? It seems targetted to the midi channel allocation problem, not the After behaviour...
Logged
sciurius
Sr. Member
****
Posts: 443



« Reply #11 on: May 14, 2020, 07:34:35 PM »

While at it, would it be possible to allow zero for the Count argument, so this

    After Count=0 Statement

becomes legal and equivalent to

    Statement
Logged
sciurius
Sr. Member
****
Posts: 443



« Reply #12 on: May 14, 2020, 07:51:43 PM »

Can't wait to try this... This is automatically generated out of a MIDI percussion file.

* cantwait.mma (4.21 KB - downloaded 212 times.)
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #13 on: May 14, 2020, 08:53:23 PM »

Are you sure this is the right patch? It seems targetted to the midi channel allocation problem, not the After behaviour...

Did you grab/process the right file? the first few lines of the file I posted read:

124,125d123
<     stuff = []
<     elns = []
127c125,129
<     nn = gbl.barNum
---
>     barNum = gbl.barNum
>     # Gather all the AFTER events for this point
>     # in the MMA file into stuff[] for pushback

And this is for the AFTER problem. Nothing to do with channel allocation Smiley
Logged

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


WWW
« Reply #14 on: May 14, 2020, 08:58:26 PM »

While at it, would it be possible to allow zero for the Count argument, so this

    After Count=0 Statement

becomes legal and equivalent to

    Statement


Yeah ... I suppose so ... but why? If you want to do it right away why not just do it? I'm confused Smiley
Logged

My online life: http://www.mellowood.ca
Pages: [1] 2
  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.05 seconds with 19 queries.