Kara-Moon Forum
May 08, 2024, 10:51:06 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: using stdpats.mma  (Read 5056 times)
jlb
Jr. Member
*
Posts: 7


« on: April 23, 2010, 01:30:48 PM »

Hello,

I have a question about the purpose and use of stdpats.mma (and similar files in the includes directory).  For example, I noticed in the library files (in stdlib), there are several grooves defined.  I have not looked at all these files, so this may not apply to all.  However, if I may take one for an example:

In the metronome.mma file, there are some Drum tracks defined (M1, M3, M13, ...)[Am I correct in the terminology?  These are tracks, right?]
When I look in stdpats.mma file in the includes directory, there appear to be identical patterns defined, named D1, D2, D13, and so on.
So, then, I was supposing that the stdpats.mma file could be used in the metronome.mma file, and the M1, M3, ... would not need to be redefined.  I guess I was looking for an hierarchical (object oriented?) approach.  Since stdpats.mma is not used in the metronome.mma file, I assume that I have an incorrect paradigm, and may be reading too much into the file structure.  If so, can you provide some insight to help with understanding how things fit together, if they are indeed intended to? 

Thanks,
Jerry



I realize that this is a rather broad question.  Can you shed some light on it as is?
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #1 on: April 23, 2010, 04:19:24 PM »

Let me try....

1st off, the structure of MMA is not nearly as neat and tidy as it could/should be. If you ever decide to write something like this remember to structure your DATA FIRST, then the code. Don't do it the wrong way around like I did.

Now, there is structure Smiley

Lowest level is PATTERN. A pattern is simply a collection of on/off pulses for a given track or instrument for a single bar or beat. You can define a pattern with the <track> define command. So,

      Drum Define D1 1 0 90

defines a pattern which sets a drum hit at beat one, velocity 90, etc.

And

       Drum Define ZZ 1 0 90; 3 0 90

also creates a pattern with hits on 1 and 3.

You can combine existing patterns:

      Drum define XX  Z0; Z1; Z3

(assuming the Z0, etc are existing patterns) is quite useful.

Next level is TRACK. A track is just a collection of patterns Smiley So, assuming that the Z0 etc are defined:

     Seqsize 4
     Drum-Zoos  Sequence Z0  Z1  Z3  Z1

Creates a drum track with a pattern of Z0 on the 1st bar, Z1 on the 2nd, etc.

Finally, a GROOVE is container for an existing set of defined tracks and other settings.

Back to your question about stdpats. Nope, you don't need to use them at all. The main reason for NOT using it in metronome was so that we could use a custom pattern using the $_Stackvalue macro which lets us turn off the metronome sound when the macro NoMetronome is set. This can be useful in a script.

stdpats is just a convenience when you are creating, well, standard sequences.

Hope this helps.
« Last Edit: April 23, 2010, 04:23:52 PM by bvdp » Logged

My online life: http://www.mellowood.ca
jlb
Jr. Member
*
Posts: 7


« Reply #2 on: April 23, 2010, 07:12:26 PM »

Thanks, Bob.
That does help.  If I may followup:

I understand now why the definitions in stdpats were not used.  If you wanted to use them, however, do you need to include a "use" statement in the file, or are they defined by default?

Also, it appears that by combining 2 grooves is only possible by going back to the initial definitions.  Is that correct?  For example, to add the Metronome2-4 to another groove (say, folk ballad, or whatever) I'd need to call the folk ballad groove, then do something like you did here in an example I found (I think it was a hindi song), with Drum-Fill replaced by essentially the definition of Metronome2-4 from the mentronome.mma file.  Is that right, or is there a better way of doing it?  (I know 'better' is somewhat subjective... what I guess I mean to ask is if there is a way to use the heirarchy more effectively, without redefining it in the file I want to use it in).

Thanks,
Jerry

Groove Main   // use the main groove
Begin Drum-Fill
  Tone JingleBell
  Volume p
  Sequence { 1 0 90 }
End

DefGroove Fill   Adds a bell to the first beat.
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #3 on: April 23, 2010, 10:00:13 PM »

I understand now why the definitions in stdpats were not used.  If you wanted to use them, however, do you need to include a "use" statement in the file, or are they defined by default?

See the paths section of the manual. I'd use "include" since this sets the proper path to the include files like stdpats. Just remember that all .mma files are equal (well, almost ... they do differ slightly in how they handle existing states, but that is pretty much a "they do what is expected" thing. I think this is covered in "paths" in the manual.). They do the same thing ... anything (song data, macros, grooves) can be defined in any file. But, calling a groove directly in a file, using USE, etc. follows a different path (which you can set). The -o cmd line option shows complete path names as mma does its thing(s).

Quote
Also, it appears that by combining 2 grooves is only possible by going back to the initial definitions.  Is that correct?  For example, to add the Metronome2-4 to another groove

Not quite.

When you load a groove that becomes the current "state". Loading a groove zaps out current settings and replaces everything (mostly) with the groove you are loading.

However, you can load just a part of a groove. I do this all the time in the stdlib files. Just use a command like:

    Arpeggio Groove Whatever

This grabs the Arpeggio settings from the 'whatever' groove and inserts that into the current state. See the stdlib files and you'll find lots of uses for that, esp. in situations where I'm adding a sustain to an existing groove. I guess the only "issue" is that you can't automatically change the track name (ie arpeggio stays arpeggio ... you can't change it to arpeggio-funny.)

The other way to modify is to load an entire groove and then change and (if you want to) rename things. So, you could do something like

   Groove FolkBallad
   Arpeggio Sequence ....
   DefGroove MyFolkBallad A folk ballad with a different pattern.

and continue on your way.

It all works pretty fast and seems to not cause problems Smiley
Logged

My online life: http://www.mellowood.ca
jlb
Jr. Member
*
Posts: 7


« Reply #4 on: April 23, 2010, 11:54:14 PM »

Ah. Thank you very much, Bob.  That is very helpful.  I should have checked more closely in the manual regarding the path question.  I just wasn't sure if the path was set to include the standard libraries by default.

The inclusion of part of a groove and redefinition of tracks seems like it will make things very flexible.

Thanks again for your help.

Jerry
Logged
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.053 seconds with 19 queries.