Wednesday, February 28, 2018

CopyTo is gone ...

Got COPYTO all working and even wrote up some docs.

But, then I decided that we really didn't need yet-another-command! So, it's gone.

But, don't despair. The functionality is still there. Instead of a new command COPY has been enhanced with a TO keyword. And, to keep things consistent, a redundant FROM keyword as well. So, now we have:

    Track Copy Other-track   ... copies Other-track over Track
    Track Copy From Other-track ... same
    Track Copy To Other-track   ... copies Track over Other-track

And, my tests here in Western Canada (where the snow just never seems to end) indicate that it all works.

Back to the documentation cellar when the whips and chains await. Standby for the announcement of a new beta!

Saturday, February 24, 2018

Harmony works ... and a new command


I've done a bit of testing with the perfect-4 harmonies. Delightful!

And, today, I added a COPYTO command. This is the reverse of COPY and will be quite useful, especially in Begin/End blocks.So, now when creating a track, you can duplicate it at ease. For example:

   Begin Chord
      Octave 5
      Articulate 80
      .... lots more stuff
      Copyto Chord-Quiet
   End

And, alas, Chord and Chord-Quiet will be identical. Now, make some mods to Chord-Quiet and we're off to the races. And, yes, in case you are reading along with the manual in hand, you could have done the same previously by doing:

    Chord-Quiet Copy Chord

But, that is outside of the begin/end block and just looks awkward.

I'll be putting up a beta copy (16.6.b) on the website later this week. Just gotta find some time to finish the docs ... I'm really too damned busy for an old retired fellow these days. Between a few music students, my sax/piano/voice duet, a sax trio, community band, and pit orchestra for a amateur musical ... well, you get the idea. Life is grand!



Sunday, February 18, 2018

Perfect fourths, part 2

I've been doing a bit more study and it's finally gelled in my little mind: There is a difference between a fourth and a perfect fourth! And for harmony we really need to look at PERFECT FOURTHs ... and these are easy. Just a matter of adding 5 semitones. This achieves a very "modern" feel and (for a computer program like MMA) is very easy to figure out.

So, over the next few days I'll add this as a additional harmony option.

Saturday, February 17, 2018

We're secure now

Different browsers as well as Google are really promoting the idea that ALL websites should be "secure". Typically, this means that a little lock will show up in the address bar of your browser.

So, all my pages at www.mellowood.ca now show the lock.

It means that you can rest assure that the transmission between my host (currently I use  http://namecheap.com/?aff=100587 is not scrambled or hijacked. Well, probably. But, really, it's not that important since I don't have any forms on the site asking for your private information, etc.

But, this should keep Google happy for a day or so. Especially since I also made the site "mobile friendly". What's next?

Friday, February 16, 2018

Harmonizing in 4ths

I've been wondering about adding some additional harmonizations to MMA. But, I'm really pretty much stuck ... so, help :)

Right now MMA does pretty simple harmonizations based on the current chord. As a simple example, if you have a C major chord and a G note MMA will pick a C or E (or both) for harmony. It's a bit more complicated since MMA has a concept of "open" and "close" harmony and "above" and "below". But, it's not very complicated.

Now, if we look at harmonizing on fourths life gets more complicated (and fun). This doesn't rely on chords, but, rather, on scales. MMA has a scale attached to each and every chord, so it should be simple? Not so much.

A simple harmonization in 4th might start off like this:

  • We have a C major chord
  • Associated with this scale is a C major scale (c,d,e,f,g,a,b)
Now, for a melody note 'F' we'd probably add in a 'B' harmony note. Why 'B'? Because it's 4 degrees away from the 'F'. And if the melody note is 'A', we'd use 'D' (scales just wrap around).

Getting a bit more complex, if the chord was a C7, then associated scale would have a 'Bb' note. So, for a melody note 'F' we'd pull a 'Bb' out for the harmony.

For MMA to do this, the harmonization function would need to know the scale as well as the chord. Not a problem.

Now, what if the melody note is not in the scale? Assuming the same C major chord and scale, what would you do with a 'F#' note? Well, I don't know either. Here are some of the decisions MMA would need to make:

  • Is the note a F# or is it a Gb? And the routine really can't tell since it's being passed a MIDI value. And the MIDI values for the two notes are the same. We might be able to make our guess more educated by looking at the key signature, but that will probably not be much help.
  • Since the note is not in the scale, we'd have to guess at the harmony. We might be safe is grabbing a value below (in this case F) and doing the harmony based on that. Or, should we use the 'G' to use as a count base? 
  • One option is to not generate a harmony note at all if the note isn't in the scale. But then you'll end up with harmonic "holes". 
  • Choosing the wrong base note will generate harmonies which aren't correct.
One solution for the writer of a melody is to stick in the desired note manually (in SOLO tracks harmonies aren't generated if there is more than a single note at a position). But, harmonies are also used in BASS, ARPEGGIO, and other tracks; and, you can't stick notes in there.

So, I've got a few choices: 
  • Just leave well enough alone;
  • Get some really cool advise from users;
  • Make arbitrary decisions which might be wrong.
Not sure what to do just now. Helpful suggestions will be appreciated.
Leave a comment here or shoot me an email.

Friday, February 9, 2018

Everything is so fast

I just noticed that I've not posted here for way too long! Sorry, but life does seem to eat up time.

I've been wondering lately if it'd be worthwhile to do some major modifications to MMA to permit multiple files on the command line. In the back of my mind a little voice was saying that it'd run faster if we only did the python initialization stuff once.

Well, time to test it! And, the little voice was right. But, to such a small degree that I've decided that the added complications really aren't going to be worthwhile.

My test was simple: I surrounded the call to the main parser and MIDI generators with timer. Then, I ran MMA from the command a number of times with different sized files using the Linux time command.

The result? Most files took a total of about a tenth of a second to read, process and compile (my range was 0.080 to 0.188 seconds). Not very long. And, the time to initialize seems to be around 0.050 seconds. So, on a large source file we might reduce the total processing time from 0.200 seconds to 0.150 seconds. And, this saving was applied to, say, 100 files we'd save a grand total of 5 seconds.

I just did a test of my personal files. 1171 MMA files compile on my computer (Intel I5-4570 @ 3.20Ghz) in 2:35 minutes. About .132 per file. And, if we applied the 0.05 saving to each file we'd save less than a minute. Actually, much less since there would be more processing time in parsing the very long command line and resetting all of the necessary variables, clearing out memory, etc.

I think we just wasted more time just doing/reading this blog than we'd ever save. If you need to process files more quickly just get a faster CPU.

So, unless someone presents a compelling reason to change MMA's "one file at a time" behavior I am going to leave this idea alone.




 I've been pretty neglectful in keeping this blog up-to-date. Lots of excuses ... but, I'll try to do a bit better! There is a new b...