Kara-Moon Forum
April 28, 2024, 08:20:36 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: Trigger function  (Read 5832 times)
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« on: November 04, 2014, 05:50:03 PM »

The latest MMA beta has a new set of functions I'm calling "Triggers". This was brought about by user Ignazio's request to have a chord track with would strum a chord only when a chord changed. I'm not really sure why one would want this (outside of my musical repertoire), but I figured it'd be a cool addition and interesting to work on.

So, I've hopelessly expanded the request and have a whole subset of things a trigger can do:

    Play a chord (or bass note or percussion hit) when the chord changes

    Set up triggers on preset beats in a bar for things like chord changes, rests, chord types

    Set up triggers for only certain bars in the song

    etc

Lots of cool options to expand MMA's potential.

Now, it's up to you guys to play with this and let me know if it's at all useful and what kind of wonderful things you can do with it. And, if there are things missing from the option list, let me know. This really is a first cut of this.

The code is all detailed in the docs and there are some example files in egs/triggers to get you started.

Warning: The options and syntax are NOT CAST IN STONE. They might all change in the future, so do not write production code just yet.

Happy hacking!
« Last Edit: November 17, 2014, 02:22:26 AM by bvdp » Logged

My online life: http://www.mellowood.ca
mm62
Guest
« Reply #1 on: November 13, 2014, 10:12:47 PM »

Hi I'm a new user to this site but I'm a decent MMA user form some time although I was kind of very shy to be in this forum  Smiley

I just want to say the auto accompaniment program MMA is amazing of yours I mean why do you have to get Jammer or BIAB for the customization makes this an extremely powerful

Honestly I'm no real programmer but know a bit of python and learn a bit to work with it

But anycase from sometime now I've been using MMA a lot for almost 2 years

I experimented with this new function triggers which was implemented which is exactly what I was waiting for because MMA does'nt seem to handle chord changes very well programs like ChordPulse Improvisor works like this if there is a chord change then a piano plays like this chord progression

C / / /
F / G

the program bangs a piano at bar one at the first beat
and in bar two it plays at 1 and 3 automatically
previously with MMA I had to write riffs manually like this

mset piano1-2.5-4
chord-piano riff 1 4. 90; 2.5 4. 90; 4 4 90;
msetend

mset piano1-3
chord-piano riff 1 2 90; 3 2 90;
msetend

$piano1-2.5-4
G F@2.5 G
$piano1-3
F / G

this could work but there is like a million ways of chord changes no a mention triplets and syncopated changes
but the trigger function of what was implemented makes it much easier

other functions I tried was unify which off course does not play the entire chord though just some of it

Now I heard the function works pretty much fine

Begin Chord-Piano
Sequence { 1 1 90;}
articulate 120
octave 5
voice warmpad
voicing mode=optimal
trigger auto truncate=true // cleaner chord changes
end


1 C / F
2 F / G
3 / / F
4 G

the chord changes play perfectly at bar 1 and 2 4 but on 3 there something unexpected it seems the chord just holds for the end of bar 2 but in 3 the first 2 beats is cut off untill to the F in bar 3 it plays again which is not what I won't tough I want G to hold up to F  

if I was something like
chord-piano trigger auto sequence = { 1 8 90; 1.75 16 90; 2.5 8 90; 3.5 8 90; 4.5 8 90; } count=5

result piano plays this 1 8 90; 1.75 16 90; 2.5 8 90;  3 8 90; 3.75 16 90; 4.5 8 90;
C / F

but to this chord it plays


1. Cm7 / Bb
2. / / Cm7

1. "1 8 90; 1.75 16 90; 2.5 8 90;  3 8 90; 3.75 16 90; 4.5 8 90;"
2.   "3 8 90; 3.75 16 90; 4.5 8 90;" // the first two beats is ignored muted i was expecting the pattern to finish but its just cut off

I don't know if its a bug or I'm doing something wrong here

here is my midi file and mma below its a different example



    

* test_s.mma (0.33 KB - downloaded 331 times.)
* test_s.mid (0.61 KB - downloaded 327 times.)
« Last Edit: November 13, 2014, 10:36:54 PM by mm62 » Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #2 on: November 13, 2014, 11:49:56 PM »

There are no bugs in MMA. Only features Smiley

Seriously, when you have a chord pattern like:

  1  C / Dm /
   2 /  /  E  /

working with a trigger like

   Chord Trigger Auto

You will get trigger actions at

   Bar 1, beats 1 and 3
   Bar 2, beat 3

Why not bar 2 beat 1? Cause there is no chord change. The parser automagically converts the '/' at 1 and 2 to 'Dm'. No chord change, no trigger.

Now, we could probably write a rule to handle this, but I'm not sure what it'd be. If we have:

  1  C
  2  C
  3  D

is there a trigger at bar 2? I don't know either!

One possible way around this is to have 2 tracks which are duplicates of each other, other than the trigger. Now, set a trigger in the 1st track to hit on chord changes, the trigger (or more simply a regular sequence) on beats 1/3 in the 2nd track.

Anyway guys ... give me some suggestions on this!

BTW, don't be shy to post. The web is still pretty anonymous and we really don't know who you are Smiley

Thanks for the nice words!

Oh, and now that I read your post again ... I see I miss the point completely:

Quote
the chord changes play perfectly at bar 1 and 2 4 but on 3 there something unexpected it seems the chord just holds for the end of bar 2 but in 3 the first 2 beats is cut off untill to the F in bar 3 it plays again which is not what I won't tough I want G to hold up to F

The here is the "truncate=true".  Truncate shortens the chord to the start of the next chord in the bar OR then end of the bar. We could have an option something like "Truncate=nextchord" which would leave it on over the bar change, but that gets very complicated very fast:

   - MMA doesn't know if the next bar has a new chord or not. So, we'd probably need to set up some flags that we'd look at at the start of a bar to see if something is being held and then backtrack and let it ring.

   - And, even then, you have to make sure your pattern/sequence is long enough to sound though the bar change. I think that unify can handle some of this ... make sure you have articulate set to 100 if you use unify.


Ummm, is this closer to what you want?

Code:
Begin Chord-Piano
  Sequence { 1 1 90;}
  articulate 100
  unify on
  octave 5
  voice warmpad
  voicing mode=optimal
  trigger auto  // cleaner chord changes
end


Logged

My online life: http://www.mellowood.ca
mm62
Guest
« Reply #3 on: November 14, 2014, 01:20:12 AM »

Thanks

I actually know the unify command very well which is suitable for playing strings I just used the warmpad to show the expected holes in the song with the command to see how long does the chord sustain and I notice it cuts the chord off at the end of the bar instead of ring till to the next chord

and the 1 1+1+1+1 90 which I type (in the mma file i attached) was actually try to get MMA to ring the chord long enough to the next chord which does'nt (when the truncate command is true)  I tested the midi file in a notation player program to expect the cut of the chord

with a chord change like this i want to ring the chord for 4 measures and a half but the truncate command limits the ringing for one measure instead of four
off course you you can make truncate false then it will work as long as the chord is long enough and not close
like this C D E F then it will be fine otherwise as in the manual I read I get overlapping then

this might work I think
chord trigger auto truncate=false // get the chord to ring long enough
G
/
/
/

/ / Am
chord trigger auto truncate=true
F / G
C
chord trigger auto truncate=false
F
/
/
/


I was wondering if you having like this below the trigger bangs on the the first G and the second G and "/" for holding the chord something like that like what I see in Improvisor and Chord Pulse

G
/
G
/

/ / Am
trigger bangs 1 2 3 4 beat
trigger bangs 1 ignores the "/"

G G G G
C / / /

In MMA the trigger works on the first G but the other G are ignored
it thinks like this
G / / /
C / / /

yet if you use this

G G7 G G7
C / / /
then the trigger bangs on all 4 of those G G7's but if its the same chord its ignored in some cases that is fine but in some cases it does not if you want to tie an chord over the bar

but yet you can just use a riff
like this

chord riff 1 1 90 * 4
G G G G
C / / /

but like writing every riff for each chord change is tendious  

Its just some suggestions I tought tough I might not be perfect here could miss the point here  



 
« Last Edit: November 14, 2014, 01:33:49 AM by mm62 » Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #4 on: November 14, 2014, 01:31:42 AM »

I don't think you're missing any points at all. I (and by extension, MMA) just don't know how to mind read.

Not to rain on my Trigger parade, but I'd probably write the example without a trigger Smiley

   
Code:
Begin Chord
  Voice warmpad
  Octave 6
   Unify On
   Articulate 100
   Sequence {1 1 90 * 4 }  // or * 8 if you have a lot of off beat changes
End

This way you get a sustained chord which is correct over the changes.

I see the problem with trigger is that in AUTO mode it can't tell the difference between a normal chord name and a '/'. Let me think about that a bit and see if there is something I can do about it.

Logged

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


WWW
« Reply #5 on: November 17, 2014, 02:26:40 AM »

I've been thinking about the problems mentioned a bit and don't see any easy solutions. Really, I think that it would require a complete rewrite so that MMA makes two passes over the data (one to gather the chord data into one long list; the 2nd to parse that ... ) and I'm not thinking about doing that anytime soon.

However, I can do some things:

1. Add a BAR and CHORD option to truncate. That way the user can truncate durations to the next chord, end of bar or both (what TRUE now does).

2. Add a "this is a new chord" marker. Not sure exactly, but I think it'd look something like

   1 C / D
    2 !D /

Here the D chord in line 2 would be treated as a new chord, not the same one as at the end of line 1.

Any comments on this. I've not done any coding and will wait for some responses and other ideas.

Bob.
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.05 seconds with 19 queries.