Kara-Moon Forum
April 20, 2024, 05:04:06 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]
  Print  
Author Topic: Parse Tree  (Read 5472 times)
sjzabel
Jr. Member
*
Posts: 9


« on: August 24, 2014, 09:49:56 PM »

This is more of a general how would you approach this...

In iPython I wanted to get to the point of introspecting in on the list and dicts that you have created after the parsing of the syntax but before the midi generation. I was just about to start diving through the code in the mma executable Smiley but figured I would just ask since my son is waking up from his nap and I won't be able to look until later Smiley

Cheers,
Stephen
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #1 on: August 24, 2014, 11:49:39 PM »

Okay, this is off the top of my head ... but the idea is that:

1. We have a dict of midi events for each track. This is called miditrk and is part of the gbl.mtrks{} class

2. We use the offset for the name of the keys.

3. Each key  in miditrk has a number of lists []. The list is the actual midi data.

The data is put in the track in the order it's encountered.

Is this muddy business clear enough? Have a look at writeout() in midi.py for a good example of how to parse this mess.
Logged

My online life: http://www.mellowood.ca
sjzabel
Jr. Member
*
Posts: 9


« Reply #2 on: August 26, 2014, 02:08:03 AM »

Cool, thank you for the pointers Smiley its not often that I get a project maintainer that is as responsive.

I'll let you know as I get a chance to dig in.

Cheers,
Stephen
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #3 on: August 26, 2014, 04:18:58 PM »

Before you dig too much ... share with us what you're trying to accomplish. It might already be there Smiley
Logged

My online life: http://www.mellowood.ca
sjzabel
Jr. Member
*
Posts: 9


« Reply #4 on: September 08, 2014, 03:12:22 AM »

Cool,
One thing that I'm interested in is how you define a tuning and chords? For instance I'm working with an open G tuning (GBDGDB) and all major cords are just barred straight across.

I also have some pieces that I want to do using an eight strings (but in reality would like to be able to program n strings)

So, is there a syntax for defining chord voicings for different tunings?  (I'll go back and double check the documentation again)

Cheers,
Stephen
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #5 on: September 08, 2014, 04:52:39 PM »

Yeah, it's covered in the manual in excruciating detail Smiley But, simply you want a command like:

   Plectrum Tuning e- a- d g b e+

The number of notes/pitches in the tuning option also sets the number of strings in the instrument. Duplicates are silently ignored.

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