From fb48baaf0933926afad896a904442c04fe41d6fb Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sun, 17 May 2009 22:34:44 +0000 Subject: [PATCH] Updated to MMA 1.4 --- mma/MMA/alloc.py | 9 +- mma/MMA/auto.py | 24 +- mma/MMA/chords.py | 33 +- mma/MMA/chordtable.py | 17 +- mma/MMA/common.py | 85 +- mma/MMA/docs.py | 119 +- mma/MMA/file.py | 54 +- mma/MMA/gbl.py | 61 +- mma/MMA/grooves.py | 448 +++ mma/MMA/harmony.py | 14 +- mma/MMA/lyric.py | 52 +- mma/MMA/macro.py | 130 +- mma/MMA/main.py | 64 +- mma/MMA/mdefine.py | 5 +- mma/MMA/midi.py | 208 +- mma/MMA/midiC.py | 105 +- mma/MMA/midiIn.py | 15 +- mma/MMA/miditables.py | 360 +- mma/MMA/notelen.py | 1 + mma/MMA/options.py | 59 +- mma/MMA/parse.py | 502 +-- mma/MMA/pat.py | 458 ++- mma/MMA/patAria.py | 14 +- mma/MMA/patArpeggio.py | 11 +- mma/MMA/patBass.py | 8 +- mma/MMA/patChord.py | 13 +- mma/MMA/patDrum.py | 12 +- mma/MMA/patScale.py | 14 +- mma/MMA/patSolo.py | 42 +- mma/MMA/patWalk.py | 11 +- mma/MMA/patch.py | 148 + mma/MMA/safe_eval.py | 48 + mma/MMA/seqrnd.py | 155 + mma/MMA/translate.py | 43 +- mma/MMA/volume.py | 71 +- mma/cp-install | 5 +- mma/docs/html/lib/index.html | 11 +- mma/docs/html/lib/kara/K50s_rock.html | 2 +- mma/docs/html/lib/kara/Kfunk1.html | 2 +- mma/docs/html/lib/kara/twi.html | 2 +- mma/docs/html/lib/stdlib/50srock.html | 2 +- mma/docs/html/lib/stdlib/60srock.html | 20 +- mma/docs/html/lib/stdlib/8beat.html | 2 +- mma/docs/html/lib/stdlib/ballad.html | 27 +- mma/docs/html/lib/stdlib/ballad128.html | 4 +- mma/docs/html/lib/stdlib/ballad68.html | 125 + mma/docs/html/lib/stdlib/basicrock.html | 2 +- mma/docs/html/lib/stdlib/beguine.html | 2 +- mma/docs/html/lib/stdlib/bigband.html | 2 +- mma/docs/html/lib/stdlib/bluegrass.html | 2 +- mma/docs/html/lib/stdlib/blues.html | 2 +- mma/docs/html/lib/stdlib/boggiewoggie.html | 2 +- mma/docs/html/lib/stdlib/bolero.html | 90 +- mma/docs/html/lib/stdlib/bossanova.html | 2 +- mma/docs/html/lib/stdlib/broadway.html | 8 +- mma/docs/html/lib/stdlib/calypso.html | 2 +- mma/docs/html/lib/stdlib/chacha.html | 25 +- mma/docs/html/lib/stdlib/countryblues.html | 2 +- mma/docs/html/lib/stdlib/countryswing.html | 2 +- mma/docs/html/lib/stdlib/countrywaltz.html | 2 +- mma/docs/html/lib/stdlib/desert.html | 2 +- mma/docs/html/lib/stdlib/dixie.html | 2 +- mma/docs/html/lib/stdlib/dixiemarch.html | 2 +- mma/docs/html/lib/stdlib/easyswing.html | 27 +- mma/docs/html/lib/stdlib/fastblues.html | 2 +- mma/docs/html/lib/stdlib/folk.html | 36 +- mma/docs/html/lib/stdlib/foxtrot.html | 16 +- mma/docs/html/lib/stdlib/frenchwaltz.html | 8 +- mma/docs/html/lib/stdlib/guitarballad.html | 2 +- mma/docs/html/lib/stdlib/hillcountry.html | 2 +- mma/docs/html/lib/stdlib/jazz-54.html | 2 +- mma/docs/html/lib/stdlib/jazzguitar.html | 2 +- mma/docs/html/lib/stdlib/jazzwaltz.html | 2 +- mma/docs/html/lib/stdlib/jive.html | 25 +- mma/docs/html/lib/stdlib/lfusion.html | 2 +- mma/docs/html/lib/stdlib/lighttango.html | 43 +- mma/docs/html/lib/stdlib/lullaby.html | 2 +- mma/docs/html/lib/stdlib/mambo.html | 2 +- mma/docs/html/lib/stdlib/march.html | 2 +- mma/docs/html/lib/stdlib/merengue.html | 16 +- mma/docs/html/lib/stdlib/metronome.html | 2 +- mma/docs/html/lib/stdlib/metronome3.html | 2 +- mma/docs/html/lib/stdlib/modernjazz.html | 55 +- mma/docs/html/lib/stdlib/pianoballad.html | 2 +- mma/docs/html/lib/stdlib/polka.html | 21 +- mma/docs/html/lib/stdlib/popballad.html | 2 +- mma/docs/html/lib/stdlib/quickstep.html | 20 +- mma/docs/html/lib/stdlib/rb-ballad.html | 91 + mma/docs/html/lib/stdlib/rb.html | 2 +- mma/docs/html/lib/stdlib/rhumba.html | 2 +- mma/docs/html/lib/stdlib/rock-128.html | 2 +- mma/docs/html/lib/stdlib/rockballad.html | 40 +- mma/docs/html/lib/stdlib/rockwaltz.html | 263 ++ mma/docs/html/lib/stdlib/salsa.html | 114 + mma/docs/html/lib/stdlib/samba.html | 4 +- mma/docs/html/lib/stdlib/showtune.html | 168 + mma/docs/html/lib/stdlib/shuffleboggie.html | 22 +- mma/docs/html/lib/stdlib/ska.html | 2 +- mma/docs/html/lib/stdlib/slowblues.html | 2 +- mma/docs/html/lib/stdlib/slowbolero.html | 2 +- mma/docs/html/lib/stdlib/slowbroadway.html | 133 + mma/docs/html/lib/stdlib/slowcountry.html | 2 +- mma/docs/html/lib/stdlib/slowjazz.html | 18 +- mma/docs/html/lib/stdlib/softrock.html | 2 +- mma/docs/html/lib/stdlib/softshoe.html | 2 +- mma/docs/html/lib/stdlib/son.html | 73 +- mma/docs/html/lib/stdlib/swing.html | 2 +- mma/docs/html/lib/stdlib/tango.html | 2 +- mma/docs/html/lib/stdlib/trance.html | 203 + mma/docs/html/lib/stdlib/vienesewaltz.html | 2 +- mma/docs/html/lib/stdlib/waltz.html | 40 +- mma/docs/html/lib/stdlib/zydeco.html | 2 +- mma/docs/html/lib/yamaha/mambo.html | 2 +- mma/docs/html/lib/yamaha/quando-g.s280.html | 2 +- mma/docs/html/lib/yamaha/salsa1.html | 280 ++ mma/docs/html/lib/yamaha/salsa2.html | 268 ++ mma/docs/html/lib/yamaha/w-rock.html | 2 +- mma/docs/html/lib/yamaha/western.html | 2 +- mma/docs/html/ref/crossref.png | Bin 147 -> 0 bytes mma/docs/html/ref/img1.png | Bin 212 -> 227 bytes mma/docs/html/ref/img10.png | Bin 136 -> 199 bytes mma/docs/html/ref/img11.png | Bin 213 -> 157 bytes mma/docs/html/ref/img12.png | Bin 254 -> 209 bytes mma/docs/html/ref/img13.png | Bin 454 -> 247 bytes mma/docs/html/ref/img14.png | Bin 298 -> 461 bytes mma/docs/html/ref/img15.png | Bin 429 -> 299 bytes mma/docs/html/ref/img16.png | Bin 212 -> 445 bytes mma/docs/html/ref/img17.png | Bin 207 -> 199 bytes mma/docs/html/ref/img18.png | Bin 229 -> 215 bytes mma/docs/html/ref/img19.png | Bin 278 -> 228 bytes mma/docs/html/ref/img2.png | Bin 283 -> 271 bytes mma/docs/html/ref/img20.png | Bin 271 -> 272 bytes mma/docs/html/ref/img21.png | Bin 258 -> 275 bytes mma/docs/html/ref/img22.png | Bin 276 -> 251 bytes mma/docs/html/ref/img23.png | Bin 214 -> 264 bytes mma/docs/html/ref/img24.png | Bin 218 -> 221 bytes mma/docs/html/ref/img25.png | Bin 233 -> 219 bytes mma/docs/html/ref/img26.png | Bin 219 -> 232 bytes mma/docs/html/ref/img27.png | Bin 268 -> 219 bytes mma/docs/html/ref/img28.png | Bin 0 -> 275 bytes mma/docs/html/ref/img3.png | Bin 222 -> 213 bytes mma/docs/html/ref/img4.png | Bin 188 -> 207 bytes mma/docs/html/ref/img5.png | Bin 215 -> 224 bytes mma/docs/html/ref/img6.png | Bin 194 -> 221 bytes mma/docs/html/ref/img7.png | Bin 251 -> 214 bytes mma/docs/html/ref/img8.png | Bin 157 -> 268 bytes mma/docs/html/ref/img9.png | Bin 205 -> 163 bytes mma/docs/html/ref/index.html | 677 ++-- mma/docs/html/ref/mma.css | 14 + mma/docs/html/ref/mma.html | 677 ++-- mma/docs/html/ref/mupex/arp4s.png | Bin 3535 -> 4291 bytes mma/docs/html/ref/mupex/bassb8.png | Bin 4836 -> 6092 bytes mma/docs/html/ref/mupex/chord43.png | Bin 5474 -> 7270 bytes mma/docs/html/ref/mupex/cmajor.png | Bin 6218 -> 7639 bytes mma/docs/html/ref/mupex/fermata.png | Bin 4634 -> 6221 bytes mma/docs/html/ref/mupex/fermata2.png | Bin 8269 -> 9945 bytes mma/docs/html/ref/mupex/repeat.png | Bin 5437 -> 6838 bytes mma/docs/html/ref/mupex/soloeg.png | Bin 8291 -> 10766 bytes mma/docs/html/ref/mupex/swingconv.png | Bin 12937 -> 16923 bytes mma/docs/html/ref/mupex/swingdrum8-3.png | Bin 3682 -> 4763 bytes mma/docs/html/ref/mupex/swingdrum8.png | Bin 2388 -> 3526 bytes mma/docs/html/ref/mupex/tilde.png | Bin 6619 -> 8429 bytes mma/docs/html/ref/mupex/tilde2.png | Bin 7205 -> 8968 bytes mma/docs/html/ref/mupex/trip1.png | Bin 5299 -> 6735 bytes mma/docs/html/ref/mupex/trip3.png | Bin 5550 -> 7208 bytes mma/docs/html/ref/node1.html | 143 +- mma/docs/html/ref/node10.html | 118 +- mma/docs/html/ref/node11.html | 72 +- mma/docs/html/ref/node12.html | 1329 +------ mma/docs/html/ref/node13.html | 1467 +++++-- mma/docs/html/ref/node14.html | 1109 ++---- mma/docs/html/ref/node15.html | 1014 ++++- mma/docs/html/ref/node16.html | 990 +---- mma/docs/html/ref/node17.html | 1219 +++++- mma/docs/html/ref/node18.html | 1531 +------- mma/docs/html/ref/node19.html | 2800 +++++++------- mma/docs/html/ref/node2.html | 204 +- mma/docs/html/ref/node20.html | 1680 ++++++-- mma/docs/html/ref/node21.html | 1905 +++------- mma/docs/html/ref/node22.html | 500 ++- mma/docs/html/ref/node23.html | 1340 ++++++- mma/docs/html/ref/node24.html | 1123 +----- mma/docs/html/ref/node25.html | 228 +- mma/docs/html/ref/node26.html | 1207 +++++- mma/docs/html/ref/node27.html | 3489 +---------------- mma/docs/html/ref/node28.html | 269 +- mma/docs/html/ref/node29.html | 3799 +++++++++++++++++-- mma/docs/html/ref/node3.html | 123 +- mma/docs/html/ref/node30.html | 139 +- mma/docs/html/ref/node31.html | 472 +++ mma/docs/html/ref/node32.html | 74 + mma/docs/html/ref/node4.html | 218 +- mma/docs/html/ref/node5.html | 106 +- mma/docs/html/ref/node6.html | 380 +- mma/docs/html/ref/node7.html | 52 +- mma/docs/html/ref/node8.html | 64 +- mma/docs/html/ref/node9.html | 144 +- mma/docs/html/tut/index.html | 17 +- mma/docs/html/tut/mma-tutorial.css | 4 + mma/docs/html/tut/mma-tutorial.html | 17 +- mma/docs/html/tut/mup/bass.png | Bin 2788 -> 3413 bytes mma/docs/html/tut/mup/deep.png | Bin 37196 -> 45298 bytes mma/docs/html/tut/mup/drums.png | Bin 3162 -> 5210 bytes mma/docs/html/tut/mup/fella.png | Bin 28213 -> 33589 bytes mma/docs/html/tut/mup/piano.png | Bin 4538 -> 5670 bytes mma/docs/html/tut/node1.html | 30 +- mma/docs/html/tut/node2.html | 9 +- mma/docs/html/tut/node3.html | 32 +- mma/docs/html/tut/node4.html | 26 +- mma/docs/html/tut/node5.html | 92 +- mma/docs/html/tut/node6.html | 15 +- mma/docs/man/mma-libdoc.1 | 76 + mma/docs/man/mma-renum.1 | 47 + mma/docs/man/mma.1 | 46 + mma/egs/aria/barb.mid | Bin 14888 -> 14589 bytes mma/egs/aria/girl.mid | Bin 5785 -> 5834 bytes mma/egs/harmony/harmony.mid | Bin 3112 -> 3204 bytes mma/egs/lyrics/README | 12 + mma/egs/lyrics/twinkle.mid | Bin 5566 -> 5645 bytes mma/egs/lyrics/twinkle1.mid | Bin 5553 -> 5542 bytes mma/egs/lyrics/twinkle2.mid | Bin 5525 -> 5590 bytes mma/egs/lyrics/twinkle3.mid | Bin 3332 -> 3406 bytes mma/egs/midi-inc/frankie.mid | Bin 7799 -> 8005 bytes mma/egs/misc/cascade.mid | Bin 518 -> 581 bytes mma/egs/misc/extended-voice.mid | Bin 246 -> 309 bytes mma/egs/misc/grooves.mid | Bin 13283 -> 13366 bytes mma/egs/misc/macros.mid | Bin 827 -> 886 bytes mma/egs/misc/math.mma | 36 + mma/egs/misc/volumes.mid | Bin 3581 -> 3644 bytes mma/egs/riffs/riffs.mid | Bin 1922 -> 1971 bytes mma/egs/rndset/rndchords.mid | Bin 4319 -> 4386 bytes mma/egs/rndset/tempo.mid | Bin 5336 -> 5408 bytes mma/egs/scales/scales.mid | Bin 3286 -> 3349 bytes mma/egs/simple/bill-bailey.mid | Bin 18692 -> 18717 bytes mma/egs/simple/marine-hymn.mid | Bin 4214 -> 4338 bytes mma/egs/tutorial/deep-river.mid | Bin 12257 -> 12012 bytes mma/egs/tutorial/fella1.mid | Bin 3704 -> 3700 bytes mma/egs/tutorial/fella2.mid | Bin 7060 -> 7169 bytes mma/includes/README | 6 +- mma/includes/casio-wk3000.mma | 562 +++ mma/includes/init-long.mma | 33 + mma/includes/init.mma | 21 +- mma/includes/stdpats.mma | 1 + mma/lib/stdlib/.mmaDB | Bin 11092 -> 12686 bytes mma/lib/stdlib/60srock.mma | 21 + mma/lib/stdlib/ballad.mma | 28 + mma/lib/stdlib/ballad128.mma | 2 +- mma/lib/stdlib/ballad68.mma | 172 + mma/lib/stdlib/bolero.mma | 38 + mma/lib/stdlib/broadway.mma | 2 +- mma/lib/stdlib/chacha.mma | 18 + mma/lib/stdlib/easyswing.mma | 12 +- mma/lib/stdlib/folk.mma | 24 + mma/lib/stdlib/foxtrot.mma | 9 +- mma/lib/stdlib/frenchwaltz.mma | 54 +- mma/lib/stdlib/jazzguitar.mma | 1 + mma/lib/stdlib/jazzwaltz.mma | 11 +- mma/lib/stdlib/jive.mma | 18 +- mma/lib/stdlib/lighttango.mma | 53 +- mma/lib/stdlib/merengue.mma | 10 +- mma/lib/stdlib/modernjazz.mma | 34 +- mma/lib/stdlib/polka.mma | 28 + mma/lib/stdlib/quickstep.mma | 17 + mma/lib/stdlib/rb-ballad.mma | 172 + mma/lib/stdlib/rockballad.mma | 40 +- mma/lib/stdlib/rockwaltz.mma | 237 ++ mma/lib/stdlib/salsa.mma | 184 + mma/lib/stdlib/samba.mma | 2 +- mma/lib/stdlib/showtune.mma | 194 + mma/lib/stdlib/shuffleboggie.mma | 26 +- mma/lib/stdlib/slowbolero.mma | 2 +- mma/lib/stdlib/slowbroadway.mma | 170 + mma/lib/stdlib/slowjazz.mma | 18 + mma/lib/stdlib/son.mma | 61 + mma/lib/stdlib/trance.mma | 216 ++ mma/lib/stdlib/waltz.mma | 29 +- mma/lib/yamaha/.mmaDB | Bin 253 -> 1248 bytes mma/lib/yamaha/salsa1.mma | 1632 ++++++++ mma/lib/yamaha/salsa2.mma | 1524 ++++++++ mma/ln-install | 6 +- mma/{util/mklibdoc.py => mma-libdoc} | 8 + mma/mma-renum | 108 + mma/mma.py | 26 +- mma/text/ANNOUNCE | 20 +- mma/text/CHANGES-1.0 | 1 + mma/text/CHANGES-1.1 | 28 + mma/text/CHANGES-1.2 | 53 + mma/text/CHANGES-1.3 | 37 + mma/text/CONTRIB | 9 +- mma/text/PATFILE | 98 + mma/text/TIMIDITY | 17 +- mma/util/README.mklibdoc | 64 - mma/util/README.pg2mma | 54 + mma/util/README.timsplit | 28 +- mma/util/mma-renum.py | 72 - mma/util/mmatabs.py | 55 +- mma/util/mup2mma.py | 6 +- mma/util/pg2mma.py | 130 + mma/util/timsplit.py | 85 +- 299 files changed, 27510 insertions(+), 16024 deletions(-) create mode 100644 mma/MMA/grooves.py create mode 100644 mma/MMA/patch.py create mode 100644 mma/MMA/safe_eval.py create mode 100644 mma/MMA/seqrnd.py create mode 100644 mma/docs/html/lib/stdlib/ballad68.html create mode 100644 mma/docs/html/lib/stdlib/rb-ballad.html create mode 100644 mma/docs/html/lib/stdlib/rockwaltz.html create mode 100644 mma/docs/html/lib/stdlib/salsa.html create mode 100644 mma/docs/html/lib/stdlib/showtune.html create mode 100644 mma/docs/html/lib/stdlib/slowbroadway.html create mode 100644 mma/docs/html/lib/stdlib/trance.html create mode 100644 mma/docs/html/lib/yamaha/salsa1.html create mode 100644 mma/docs/html/lib/yamaha/salsa2.html delete mode 100644 mma/docs/html/ref/crossref.png create mode 100644 mma/docs/html/ref/img28.png create mode 100644 mma/docs/html/ref/node31.html create mode 100644 mma/docs/html/ref/node32.html create mode 100644 mma/docs/man/mma-libdoc.1 create mode 100644 mma/docs/man/mma-renum.1 create mode 100644 mma/docs/man/mma.1 create mode 100644 mma/egs/lyrics/README create mode 100644 mma/egs/misc/math.mma create mode 100644 mma/includes/casio-wk3000.mma create mode 100644 mma/includes/init-long.mma create mode 100644 mma/lib/stdlib/ballad68.mma create mode 100644 mma/lib/stdlib/rb-ballad.mma create mode 100644 mma/lib/stdlib/rockwaltz.mma create mode 100644 mma/lib/stdlib/salsa.mma create mode 100644 mma/lib/stdlib/showtune.mma create mode 100644 mma/lib/stdlib/slowbroadway.mma create mode 100644 mma/lib/stdlib/trance.mma create mode 100644 mma/lib/yamaha/salsa1.mma create mode 100644 mma/lib/yamaha/salsa2.mma rename mma/{util/mklibdoc.py => mma-libdoc} (95%) create mode 100755 mma/mma-renum create mode 100644 mma/text/CHANGES-1.1 create mode 100644 mma/text/CHANGES-1.2 create mode 100644 mma/text/CHANGES-1.3 create mode 100644 mma/text/PATFILE delete mode 100644 mma/util/README.mklibdoc create mode 100644 mma/util/README.pg2mma delete mode 100755 mma/util/mma-renum.py create mode 100755 mma/util/pg2mma.py diff --git a/mma/MMA/alloc.py b/mma/MMA/alloc.py index 05bbf27..3b383e8 100644 --- a/mma/MMA/alloc.py +++ b/mma/MMA/alloc.py @@ -31,10 +31,11 @@ import MMA.patScale import MMA.patArpeggio import MMA.patSolo import MMA.patAria +import MMA.grooves + import gbl from MMA.common import * - trkClasses = { 'BASS' : MMA.patBass.Bass, 'CHORD' : MMA.patChord.Chord, @@ -75,9 +76,9 @@ def trackAlloc(name, err): If not, we either error (err==1) or return (err==0). """ - if trkClasses.has_key(base): + try: f = trkClasses[base] - else: + except: if err: error("There is no track class '%s' for trackname '%s'" % (base, name) ) else: @@ -93,7 +94,7 @@ def trackAlloc(name, err): # Update current grooves to reflect new track. - for slot in gbl.settingsGroove.keys(): + for slot in MMA.grooves.glist.keys(): newtk.saveGroove(slot) diff --git a/mma/MMA/auto.py b/mma/MMA/auto.py index f8deb05..7fa7585 100644 --- a/mma/MMA/auto.py +++ b/mma/MMA/auto.py @@ -29,10 +29,12 @@ import sys import pickle import MMA.midi -import gbl import MMA.parse + +import gbl from MMA.common import * + grooveDir = {} mmadir = ".mmaDB" # constant, name of the lib database file fileCount = 0 @@ -52,8 +54,8 @@ def updateGrooveList(n): def libUpdate(): """ Update the mma library database file(s) with -g or -G option. - This is called from the main program after the initialization - and other option parsing. No RETURN. + This is called from the main program after the initialization + and other option parsing. No RETURN. """ global fileCount, gdDate, grooveDir, processedfiles @@ -137,9 +139,9 @@ def dolibupdate(root, subdir): """ Get a list of the files in this directory. If the list - includes a file called 'MMAIGNORE' the entire directory - (and subdirs) is ignored. Otherwise, each file in the - directory ending in 'mma' is parsed for groove defs. + includes a file called 'MMAIGNORE' the entire directory + (and subdirs) is ignored. Otherwise, each file in the + directory ending in 'mma' is parsed for groove defs. """ p = os.path.join(root,subdir) @@ -156,9 +158,7 @@ def dolibupdate(root, subdir): if fn.startswith('.') or fn.startswith('#'): continue - # Create full path name - - f=os.path.join(root, subdir, fn) + f=os.path.join(root, subdir, fn) # Create full path name if os.path.isdir(f): dolibupdate(root, os.path.join(subdir,fn)) # recursive! @@ -168,18 +168,18 @@ def dolibupdate(root, subdir): processedFiles.append(ename) - if gdDate and grooveDir.has_key(ename) and \ - os.path.getmtime(f) < gdDate: + if gdDate and ename in grooveDir and os.path.getmtime(f) < gdDate: print " Existing: %s" % f grooveCount += len(grooveDir[ename]) continue - if grooveDir.has_key(ename): + if ename in grooveDir: print " Updating: %s" % f else: print " Creating: %s" % f mkGrooveList = [] gbl.mtrks = {} + MMA.grooves.aliaslist = {} for c in gbl.midiAssigns.keys(): gbl.midiAssigns[c]=[] for a,v in enumerate(gbl.midiAvail): diff --git a/mma/MMA/chords.py b/mma/MMA/chords.py index 76a6dc4..6cd366e 100644 --- a/mma/MMA/chords.py +++ b/mma/MMA/chords.py @@ -27,7 +27,7 @@ import copy from MMA.common import * -from MMA.chordtable import chords +from MMA.chordtable import chordlist @@ -42,7 +42,7 @@ def defChord(ln): if not len(ln): error(emsg) name = ln.pop(0) - if name in chords.keys(): + if name in chordlist.keys(): warning("Redefining chordtype '%s'" % name) if '/' in name: @@ -77,27 +77,28 @@ def defChord(ln): scale[i]=v - chords[name] = ( notes, scale, "User Defined") + chordlist[name] = ( notes, scale, "User Defined") if gbl.debug: - print "ChordType '%s', %s" % (name, chords[name]) + print "ChordType '%s', %s" % (name, chordlist[name]) def printChord(ln): """ Display the note/scale/def for chord(s). """ for c in ln: - if not chords.has_key(c): + try: + print c, ':', chordlist[c][0], chordlist[c][1], chordlist[c][2] + except: error("Chord '%s' is unknown" % c) - print c, ':', chords[c][0], chords[c][1], chords[c][2] + -""" -Table of chord adjustment factors. Since the initial chord is based -on a C scale, we need to shift the chord for different degrees. Note, -that with C as a midpoint we shift left for G/A/B and right for D/E/F. +""" Table of chord adjustment factors. Since the initial chord is based + on a C scale, we need to shift the chord for different degrees. Note, + that with C as a midpoint we shift left for G/A/B and right for D/E/F. -Should the shifts take in account the current key signature? + Should the shifts take in account the current key signature? """ cdAdjust = { @@ -288,14 +289,14 @@ class ChordNotes: ctype='M' try: - notes = chords[ctype][0] + notes = chordlist[ctype][0] adj = cdAdjust[tonic] + octave except: error( "Illegal/Unknown chord name: '%s'" % name ) self.noteList = [ x + adj for x in notes ] self.bnoteList = tuple(self.noteList) - self.scaleList = tuple([ x + adj for x in chords[ctype][1] ]) + self.scaleList = tuple([ x + adj for x in chordlist[ctype][1] ]) self.chordType = ctype self.tonic = tonic self.rootNote = self.noteList[0] @@ -311,11 +312,11 @@ class ChordNotes: # Do inversions if there is a valid slash notation. if slash: - if not cdAdjust.has_key(slash): + try: + r=cdAdjust[slash] # r = -6 to 6 + except KeyError: error("The note '%s' in the slash chord is unknown" % slash) - r=cdAdjust[slash] # r = -6 to 6 - # If the slash note is in the chord we invert # the chord so the slash note is in root position. diff --git a/mma/MMA/chordtable.py b/mma/MMA/chordtable.py index 99b0fe7..ca96a46 100644 --- a/mma/MMA/chordtable.py +++ b/mma/MMA/chordtable.py @@ -53,7 +53,7 @@ A = Bbb= 9 As = Bb = 10 B = Cb = 11 -chords = { +chordlist = { 'M': ((C, E, G ), (C, D, E, F, G, A, B), "Major triad. This is the default and is used in " @@ -399,8 +399,8 @@ chords = { """ Extend our table with common synomyns. These are real copies, -not pointers. This is done so that a user redefine only affects -the original. + not pointers. This is done so that a user redefine only affects + the original. """ aliases = ( @@ -448,14 +448,15 @@ aliases = ( ('9sus', 'sus9', ''), ('9-5', '9b5', ''), ('dim3', 'mb5', 'Diminished triad (non-standard notation).'), - ('omit3(add9)','omit3add9', '') + ('omit3(add9)','omit3add9', ''), + ('9sus4', 'sus9', '') ) for a,b,d in aliases: - n=chords[b][0] - s=chords[b][1] + n=chordlist[b][0] + s=chordlist[b][1] if not d: - d=chords[b][2] + d=chordlist[b][2] - chords[a] = (n, s, d) + chordlist[a] = (n, s, d) diff --git a/mma/MMA/common.py b/mma/MMA/common.py index b50865e..9f79b97 100644 --- a/mma/MMA/common.py +++ b/mma/MMA/common.py @@ -56,29 +56,34 @@ def error(msg): if ln: ln += '\n' - + print "ERROR:%s %s" % (ln, msg) + # Parse though the error message and check for illegal characters. + # Report (first only) if any found. + + for a in msg: + a=ord(a) + if a<0x20 or a >=0x80: + print "Corrupt input file? Illegal character 0x%2x found." % a + break + sys.exit(1) def warning(msg): """ Print warning message and return. """ + if not gbl.noWarn: + ln = "" - if gbl.noWarn: - return + if gbl.lineno >= 0: + ln = "" % gbl.lineno - ln = "" - - if gbl.lineno >= 0: - ln = "" % gbl.lineno - - if gbl.inpath: - ln += "" % gbl.inpath.fname - - print "Warning:%s\n %s" % (ln, msg) + if gbl.inpath: + ln += "" % gbl.inpath.fname + print "Warning:%s\n %s" % (ln, msg) def getOffset(ticks, ran=None): @@ -124,10 +129,13 @@ def stof(s, errmsg=None): try: return float(s) except: - if errmsg: - error(errmsg) - else: - error("Expecting a value, not %s" % s) + try: + return int(s,0) + except: + if errmsg: + error(errmsg) + else: + error("Expecting a value, not %s" % s) @@ -144,15 +152,15 @@ def printList(l): def pextract(s, open, close, onlyone=None): """ Extract a parenthesized set of substrings. - s - original string - open - substring start tag \ can be multiple character - close - substring end tag / strings (ie. "<<" or "-->") - onlyone - optional, if set only the first set is extracted + s - original string + open - substring start tag \ can be multiple character + close - substring end tag / strings (ie. "<<" or "-->") + onlyone - optional, if set only the first set is extracted - returns ( original sans subs, [subs, ...] ) + returns ( original sans subs, [subs, ...] ) - eg: pextract( "x{123}{666}y", '{', '}' ) - Returns: ( 'xy', [ '123', '666' ] ) + eg: pextract( "x{123}{666}y", '{', '}' ) + Returns: ( 'xy', [ '123', '666' ] ) """ @@ -171,3 +179,34 @@ def pextract(s, open, close, onlyone=None): return s.strip(), subs + + +def seqBump(l): + """ Expand/contract an existing sequence list to the current seqSize.""" + + while len(l) < gbl.seqSize: + l += l + return l[:gbl.seqSize] + + + +def lnExpand(ln, msg): + """ Validate and expand a list passed to a set command. """ + + + if len(ln) > gbl.seqSize: + warning("%s list truncated to %s patterns" % (msg, gbl.seqSize) ) + ln = ln[:gbl.seqSize] + + last = None + + for i,n in enumerate(ln): + if n == '/': + if not last: + error ("%s cannot use a '/' as the first item in list." % cmd) + else: + ln[i] = last + else: + last = n + + return ln diff --git a/mma/MMA/docs.py b/mma/MMA/docs.py index d268e2c..8b22fa4 100644 --- a/mma/MMA/docs.py +++ b/mma/MMA/docs.py @@ -26,9 +26,13 @@ Bob van der Poel import os import time +import MMA.midiC +import MMA.grooves + import gbl from MMA.common import * -import MMA.midiC + + def docDrumNames(order): @@ -76,22 +80,22 @@ def docInstNames(order): """ Whenever MMA encounters a DOC command, or if it defines -a groove with DEFGROOVE it calls the docAdd() function. + a groove with DEFGROOVE it calls the docAdd() function. -The saved docs are printed to stdout with the docDump() command. -This is called whenever parse() encounters an EOF. + The saved docs are printed to stdout with the docDump() command. + This is called whenever parse() encounters an EOF. -Both routines are ignored if the -Dx command line option has -not been set. + Both routines are ignored if the -Dx command line option has + not been set. -Storage is done is in the following arrays. + Storage is done is in the following arrays. """ -fname = '' -author="" -notes="" -defs=[] -variables=[] +fname = '' +author = "" +notes = "" +defs = [] +variables = [] def docAuthor(ln): global author @@ -104,7 +108,7 @@ def docNote(ln): global fname, notes - if not gbl.docs or not ln: + if not gbl.createDocs or not ln: return # Grab the arg and data, save it @@ -119,7 +123,7 @@ def docVars(ln): global fname, variables - if not gbl.docs or not ln: + if not gbl.createDocs or not ln: return fname = os.path.basename(gbl.inpath.fname) @@ -129,9 +133,9 @@ def docVars(ln): def docDefine(ln): """ Save a DEFGROOVE comment string. - Entries are stored as a list. Each item in the list is - complete groove def looking like: - defs[ [ Name, Seqsize, Description, [ [TRACK,INST]...]] ...] + Entries are stored as a list. Each item in the list is + complete groove def looking like: + defs[ [ Name, Seqsize, Description, [ [TRACK,INST]...]] ...] """ @@ -149,12 +153,13 @@ def docDefine(ln): defs.append(l) + def docDump(): """ Print the LaTex docs. """ global fname, author, notes, defs, variables - if gbl.docs == 1: # latex docs + if gbl.createDocs == 1: # latex docs if notes: if fname.endswith(gbl.ext): fname='.'.join(fname.split('.')[:-1]) @@ -170,13 +175,21 @@ def docDump(): if defs: for l in defs: - print " \\instable{%s}{%s}{%s}{" % \ - (totex(l[0]), totex(l[2]), l[1] ) + alias = MMA.grooves.getAlias(l[0]) + if alias: + if len(alias)>1: + alias="Aliases: %s" % alias + else: + alias="Alias: %s" % alias + else: + alias='' + print " \\instable{%s}{%s}{%s}{%s}{" % \ + (totex(l[0]), totex(l[2]), l[1], alias) for c,v in l[3:]: print " \\insline{%s}{%s}" % (c.title(), totex(v)) print " }" - - if gbl.docs == 2: # html docs + + if gbl.createDocs == 2: # html docs if notes: print '' % time.ctime() print '' @@ -213,6 +226,13 @@ def docDump(): print '' print ' ' print '
' print '

%s

' % l[0] + alias=MMA.grooves.getAlias(l[0]) + if alias: + if len(alias)>1: + ll="Aliases" + else: + ll="Alias" + print '

%s: %s

' % (ll, alias) print ' %s (%s) ' % ( l[2], l[1] ) print '
' @@ -224,17 +244,54 @@ def docDump(): print '
' print print '' + + if gbl.createDocs == 3: + if notes: + if fname.endswith(gbl.ext): + fname='.'.join(fname.split('.')[:-1]) + print "%s.mma %s" % (fname, notes) + print + + if variables: + print " Variables:" + for l in variables: + print " %s %s" % ( l[0], l[1] ) + print + + if defs: + for l in defs: + print "Groove %s" % l[0].title() + + MMA.grooves.grooveDo(l[0].upper()) + for t in sorted(gbl.tnames): + tr = gbl.tnames[t] + sq = tr.sequence + if sq[0]: + rt = [] + for a in range(gbl.seqSize): + s=sq[a] + x = '{' + tr.formatPattern(sq[a]) + '}' + rt.append(x) + print " %s Sequence %s" % (tr.name, ' '.join(rt)) + if tr.vtype == 'DRUM': + print " %s Tone %s" % (tr.name, + ' '.join([MMA.midiC.valueToDrum(a) for a in tr.toneList])) + else: + print " %s Voice %s" % (tr.name, + ' '.join([MMA.midiC.voiceNames[a] for a in tr.voice])) + + print + defs = [] variables=[] notes = "" author = "" - def totex(s): """ Parse a string and quote tex stuff. - Also handles proper quotation style. + Also handles proper quotation style. """ s = s.replace("$", "\$") @@ -254,3 +311,17 @@ def totex(s): return s + + + +def docVerbose(): + """ Print verbose pattern/sequence info: -Dp command line. """ + + global fname, author, notes, defs, variables + + + defs = [] + variables=[] + notes = "" + author = "" + diff --git a/mma/MMA/file.py b/mma/MMA/file.py index cd0cc0d..6c46f1d 100644 --- a/mma/MMA/file.py +++ b/mma/MMA/file.py @@ -32,11 +32,11 @@ from MMA.common import * def locFile(name, lib): """ Locate a filename. - This checks, in order: - lib/name + .mma - lib/name - name + .mma - name + This checks, in order: + lib/name + .mma + lib/name + name + .mma + name """ ext=gbl.ext @@ -52,7 +52,7 @@ def locFile(name, lib): t=os.path.join(lib, name) if exists(t): return t - + if not name.endswith(ext): t = name + ext if exists(t): @@ -73,7 +73,7 @@ class ReadFile: class FileData: """ After reading the file in bulk it is parsed and stored in this - data structure. Blanks lines and comments are removed. + data structure. Blanks lines and comments are removed. """ def __init__(self, lnum, data, label): @@ -97,7 +97,6 @@ class ReadFile: try: inpath = file(fname, 'r') - except: error("Unable to open '%s' for input" % fname) @@ -107,7 +106,6 @@ class ReadFile: self.fname = fname """ Read entire file, line by line: - - strip off blanks, comments - join continuation lines - parse out LABELS @@ -131,11 +129,18 @@ class ReadFile: if not l: continue + # join lines ending in '\' (the strip() makes this the last char + while l[-1] == '\\': l = l[0:-1] + ' ' + inpath.readline().strip() lcount +=1 + """ input cleanup ... for now the only cleanup is to convert + 0xa0 (non-breakable space) to 0x20 (regular space). + """ + l=l.replace('\xa0', '\x20') + """ This next line splits the line at the first found comment '//', drops the comment, and splits the remaining line into tokens using whitespace delimiters. @@ -200,6 +205,7 @@ class ReadFile: else: label = None + # Save the line, linenumber and (maybe) the label. fdata.append( dataStore(lcount, l, label)) @@ -222,15 +228,15 @@ class ReadFile: def goto(self, l): """ Do a goto jump. - This isn't perfect, but is probably the way most GOTOs work. If - inside a repeat/if then nothing more is processed. The jump is - immediate. Of course, you'll run into problems with missing - repeat/repeatend if you try it. Since all repeats are stacked - back into the que, we just delete the que. Then we look for a - matching label in the file line array. + This isn't perfect, but is probably the way most GOTOs work. If + inside a repeat/if then nothing more is processed. The jump is + immediate. Of course, you'll run into problems with missing + repeat/repeatend if you try it. Since all repeats are stacked + back into the que, we just delete the que. Then we look for a + matching label in the file line array. - Label search is linear. Not too efficient, but the lists - will probably never be that long either. + Label search is linear. Not too efficient, but the lists + will probably never be that long either. """ @@ -251,13 +257,13 @@ class ReadFile: def push(self, q, nums): """ Push a list of lines back into the input stream. - Note: This is a list of semi-processed lines, no comments, etc. + Note: This is a list of semi-processed lines, no comments, etc. - It's quicker to extend a list than to insert, so add to the end. - Note: we reverse the original, extend() then reverse again, just - in case the caller cares. + It's quicker to extend a list than to insert, so add to the end. + Note: we reverse the original, extend() then reverse again, just + in case the caller cares. - nums is a list of linenumbers. Needed to report error lines. + nums is a list of linenumbers. Needed to report error lines. """ if not self.que: @@ -276,8 +282,8 @@ class ReadFile: def read(self): """ Return a line. - This will return either a queued line or a line from the - file (which was stored/processed earlier). + This will return either a queued line or a line from the + file (which was stored/processed earlier). """ while 1: diff --git a/mma/MMA/gbl.py b/mma/MMA/gbl.py index 4a22d18..6ca4cb6 100644 --- a/mma/MMA/gbl.py +++ b/mma/MMA/gbl.py @@ -24,7 +24,7 @@ Bob van der Poel import os -version = "1.1" # Version -- March 7/2007 +version = "1.4" # Version -- Sept/2008 """ mtrks is storage for the MIDI data as it is created. It is a dict of class Mtrk() instances. Keys are the @@ -56,7 +56,7 @@ for c in range(0,17): is inc/decremented. """ -midiAvail=[ 0 ] * 17 # slots 0..16, slot 0 is not used. +midiAvail = [ 0 ] * 17 # slots 0..16, slot 0 is not used. deletedTracks = [] # list of deleted tracks for -c report @@ -64,28 +64,14 @@ deletedTracks = [] # list of deleted tracks for -c report are names, data is a channel. Eg. midiChPrefs['BASS-SUS']==9 """ -midiChPrefs={} +midiChPrefs = {} - -""" Groove storage. Each entry in settingsGroove{} has a keyname - of a saved groove. - - lastGroove and currentGroove are used by macros +""" Is the -T option is used only the tracks in this list + are generated. All other tracks are muted (OFF) """ -settingsGroove = {} -lastGroove = '' -currentGroove = '' - - -""" SeqRnd variable is a list. The first entry is a flag:(0, 1 or x): - 0 - not set - 1 - set - 2 - set for specific tracks, track list starts at position [1] -""" - -seqRnd = [0] # set if SEQRND has been set +muteTracks = [] ############# String constants #################### @@ -98,28 +84,31 @@ ext = ".mma" # extension for song/lib files. BperQ = 192 # midi ticks per quarter note -QperBar = 4 # Beats/bar, set with TIME -tickOffset = 0 # offset of current bar in ticks +QperBar = 4 # Beats/bar, set with TIME +tickOffset = 0 # offset of current bar in ticks tempo = 120 # current tempo -seqSize = 1 # variation sequence table size -seqCount = 0 # running count of variation +seqSize = 1 # variation sequence table size +seqCount = 0 # running count of variation -transpose = 0 # Transpose is global (ignored by drum tracks) +totTime = 0.0 # running duration count in seconds -lineno = -1 # used for error reporting +transpose = 0 # Transpose is global (ignored by drum tracks) -swingMode = 0 # defaults to 0, set to 1 for swing mode -swingSkew = None # this is just for $_SwingMode macro +lineno = -1 # used for error reporting -barNum = 0 # Current line number +swingMode = 0 # defaults to 0, set to 1 for swing mode +swingSkew = None # this is just for $_SwingMode macro + +barNum = 0 # Current line number + +synctick = 0 # flag, set if we want a tick on all tracks at offset 0 +endsync = 0 # flag, set if we want a eof sync -synctick = 0 # flag, set if we want a tick on all tracks at offset 0 ############# Path and search variables. ############# - libPath = '' -for p in ( "c:\\mma\\lib", "/usr/local/share/mma/lib", "/usr/share/mma/lib", "./lib"): +for p in ( "c:\\mma\\lib", "/usr/local/share/mma/lib", "/usr/share/mma/lib", "./lib"): if os.path.isdir(p): libPath=p break @@ -139,8 +128,8 @@ mmaEnd = [] # list of END files mmaRC = None # user specified RC file, overrides defaults inpath = None # input file -midiFileType = 1 # type 1 file, SMF command can change to 0 -runningStatus = 1 # running status enabled +midiFileType = 1 # type 1 file, SMF command can change to 0 +runningStatus = 1 # running status enabled ############# Options. ############# @@ -163,9 +152,11 @@ chshow = Lchshow = 0 outfile = None infile = None -docs = 0 +createDocs = 0 maxBars = 500 makeGrvDefs = 0 cmdSMF = None +playFile = 0 # set if we want to call a player +midiPlayer = "aplaymidi" diff --git a/mma/MMA/grooves.py b/mma/MMA/grooves.py new file mode 100644 index 0000000..7360a62 --- /dev/null +++ b/mma/MMA/grooves.py @@ -0,0 +1,448 @@ + +# grooves.py + + +""" +This module is an integeral part of the program +MMA - Musical Midi Accompaniment. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Bob van der Poel + +""" + + +""" Groove storage. Each entry in glist{} has a keyname + of a saved groove. + + lastGroove and currentGroove are used by macros +""" + +import os + + +import MMA.midi +import MMA.notelen +import MMA.auto +import MMA.volume +import MMA.parse +import MMA.seqrnd +import MMA.docs + +import gbl +from MMA.common import * + + +glist = {} +aliaslist = {} + +lastGroove = '' # name of the last groove (used by macros) +currentGroove = '' # name of current groove (used by macros) + +""" groovesList[] holds a list of grooves to use when the + groove command is used with several args. ie, when + we use either: + + Groove 2 groove1 groove2 groove3 + or + Groove groove1 groove2 groove3 + + in both cases, the names of the grooves are stored in groovesList[] +""" + +groovesList = None +groovesCount = 0 + +def grooveDefine(ln): + """ Define a groove. + + Current settings are assigned to a groove name. + """ + + if not len(ln): + error("Use: DefGroove Name") + + slot=ln[0].upper() + + # Slot names can't contain a '/' (reserved) or be an integer (used in groove select). + + if '/' in slot: + error("The '/' is not permitted in a groove name") + + if slot.isdigit(): + error("Invalid slot name '%s'. Cannot be only digits" % slot) + + if slot in aliaslist: + error("Can't define groove name %s, already defined as an alias for %s." \ + % (slot, aliaslist[slot])) + + grooveDefineDo(slot) + + if gbl.debug: + print "Groove settings saved to '%s'." % slot + + if gbl.makeGrvDefs: + MMA.auto.updateGrooveList(slot) + + if len(ln) > 1: + MMA.docs.docDefine(ln) + + +def grooveDefineDo(slot): + + for n in gbl.tnames.values(): + n.saveGroove(slot) + + glist[slot] = { + 'SEQSIZE': gbl.seqSize, + 'SEQRNDWT': MMA.seqrnd.seqRndWeight[:], + 'QPERBAR': gbl.QperBar, + 'SEQRND': MMA.seqrnd.seqRnd[:], + 'TIMESIG': MMA.midi.timeSig.get(), + '81': MMA.notelen.noteLenTable['81'], + '82': MMA.notelen.noteLenTable['82'], + 'SWINGMODE': gbl.swingMode , + 'SWINGSKEW': gbl.swingSkew, + 'VRATIO': (MMA.volume.vTRatio, MMA.volume.vMRatio)} + + +def grooveAlias(ln): + """ Create an alias name for an existing groove. """ + + global aliaslist + + if len(ln) != 2: + error("GrooveAlias needs exactly 2 args: GrooveName AliasName.") + + a = ln[0].upper() + g = ln[1].upper() + + if not g in glist: + error("GrooveAlias: Groove %s has not been defined." % ln[0]) + + aliaslist[a]=g + + +def groove(ln): + """ Select a previously defined groove. """ + + global groovesList, groovesCount, lastGroove, currentGroove + + if not ln: + error("Groove: needs agrument(s)") + + + tmpList =[] + + if ln[0].isdigit(): + wh=stoi(ln[0]) + if wh<1: + error("Groove selection must be > 0, not '%s'" % wh) + ln=ln[1:] + else: + wh = None + + for slot in ln: + slot = slot.upper() + if slot == "/": + if len(tmpList): + slot=tmpList[-1] + else: + error("A previous groove name is needed before a '/'") + + if not slot in glist: # convert alias to real groove name + for a,r in aliaslist.iteritems(): + if slot == a: + slot = r + break + + if not slot in glist: + if gbl.debug: + print "Groove '%s' not defined. Trying auto-load from libraries" \ + % slot + + l=MMA.auto.loadGrooveDir(slot) # name of the lib file with groove + + if l: + if gbl.debug: + print "Attempting to load groove '%s' from '%s'." % (slot, l) + + reportFutureVols() + + MMA.parse.usefile([os.path.join(gbl.autoLib, l)]) + + if not slot in glist: + error("Groove '%s' not found. Have libraries changed " + "since last 'mma -g' run?" % slot) + + else: + error("Groove '%s' could not be found in memory or library files" % slot ) + + tmpList.append(slot) + + if not len(tmpList): + error("Use: Groove [selection] Name [...]") + + """ If the first arg to list was an int() (ie: 3 groove1 groove2 grooveFoo) + we select from the list. After the selection, we reset the list to be + just the selected entry. This was, if there are multiple groove names without + a leading int() we process the list as groove list changing with each bar. + """ + + if wh: + wh = (wh-1) % len(tmpList) + tmpList=tmpList[wh:wh+1] + + slot=tmpList[0] + grooveDo(slot) + + groovesCount = 0 + if len(tmpList)==1: + groovesList=None + else: + groovesList=tmpList + + lastGroove = currentGroove + currentGroove = slot + if lastGroove == '': + lastGroove = slot + + if gbl.debug: + print "Groove settings restored from '%s'." % slot + +def grooveDo(slot): + """ This is separate from groove() so we can call it from + usefile() with a qualified name. """ + + reportFutureVols() + + oldSeqSize = gbl.seqSize + + g=glist[slot] + + gbl.seqSize = g['SEQSIZE'] + MMA.seqrnd.seqRndWeight = g['SEQRNDWT'] + gbl.QperBar = g['QPERBAR'] + MMA.seqrnd.seqRnd = g['SEQRND'] + MMA.midi.timeSig.set( *g['TIMESIG']) # passing tuple as 2 args. + MMA.notelen.noteLenTable['81'] = g['81'] + MMA.notelen.noteLenTable['82'] = g['82'] + gbl.swingMode = g['SWINGMODE'] + gbl.swingSkew = g['SWINGSKEW'] + MMA.volume.vTRatio, MMA.volume.vMRatio = g['VRATIO'] + + for n in gbl.tnames.values(): + n.restoreGroove(slot) + + """ This is important! Tracks NOT overwritten by saved grooves way + have the wrong sequence length. I don't see any easy way to hit + just the unchanged/unrestored tracks so we do them all. + Only done if a change in seqsize ... doesn't take long to be safe. + """ + + if oldSeqSize != gbl.seqSize: + for a in gbl.tnames.values(): + a.setSeqSize() + + MMA.seqrnd.seqRndWeight = seqBump(MMA.seqrnd.seqRndWeight) + + gbl.seqCount = 0 + +def reportFutureVols(): + """ Print warning for pending track cresendos. + + We need a seperate func here since the groove() may + parse a new file, which will clear out data before + getting to grooveDo(). + + Note that the test is for more that one trailing future volume. + This is deliberate ... a construct like: + + Chord Cresc ff 1 + ..somechord + Groove NEW + + will leave a future volume on the stack. + """ + + volerrs=[] + for n in gbl.tnames.values(): + if len(n.futureVols)>1: + volerrs.append(n.name) + n.futureVols = [] # don't want leftover future vols a track level! + + if volerrs: + volerrs.sort() + warning("Pending (de)Cresc in %s." % ', '.join(volerrs)) + +def grooveClear(ln): + """ Delete all previously loaded grooves from memory.""" + + global groovesList, groovesCount, glist, lastGroove, currentGroove, aliaslist + + if ln: + error("GrooveClear does not have any arguments.") + + groovesList = {} + aliaslist = {} + groovesCount = 0 + + try: + a= glist[gmagic] + except: + a=None + + glist={} + + if a: + glist[gmagic]=a + + lastGroove = '' + currentGroove = '' + + + if gbl.debug: + print "All grooves deleted." + + + +def nextGroove(): + """ Handle groove lists. Called from parse(). + + If there is more than 1 entry in the groove list, + advance (circle). We don't have to qualify grooves + since they were verified when this list was created. + groovesList==None if there is only one groove (or none). + """ + + global lastGroove, currentGroove, groovesCount + + if groovesList: + groovesCount += 1 + if groovesCount > len(groovesList)-1: + groovesCount = 0 + slot = groovesList[groovesCount] + + if slot != currentGroove: + grooveDo(slot) + + lastGroove = currentGroove + currentGroove = slot + + if gbl.debug: + print "Groove (list) setting restored from '%s'." % slot + + +def trackGroove(name, ln): + """ Select a previously defined groove for a single track. """ + + if len(ln) != 1: + error("Use: %s Groove Name" % name) + + slot = ln[0].upper() + + if not slot in glist: # convert alias to real groove name + for a,r in aliaslist.iteritems(): + if slot == a: + slot = r + break + + if not slot in glist: + error("Groove '%s' not defined" % slot) + + g=gbl.tnames[name] + g.restoreGroove(slot) + + if g.sequence == [None] * len(g.sequence): + warning("'%s' Track Groove has no sequence. Track name error?" % name) + + g.setSeqSize() + + if gbl.debug: + print "%s Groove settings restored from '%s'." % (name, slot) + + + +def getAlias(al): + """ This is used by the library doc printer to get a list aliases. """ + + + al=al.upper() + l=[] + + for a,r in aliaslist.iteritems(): + if al == r: + l.append(a.title()) + + + return ', '.join(l) + + + +def allgrooves(ln): + """ Apply a command to all currently defined grooves. """ + + if not ln: + error("OverRide: requires a directive.") + + + origSlot = MMA.parse.gmagic # save the current groove + grooveDefineDo(origSlot) + + action = ln[0].upper() + if len(ln)>1: + trAction = ln[1].upper() + else: + trAction = '' + + sfuncs = MMA.parse.simpleFuncs + tfuncs = MMA.parse.trackFuncs + + counter = 0 + + for g in glist: + grooveDo(g) + + if action in sfuncs: + sfuncs[action](ln[1:]) + counter += 1 + continue + + if len(ln) < 2: + error("AllGrooves: No command for assumed trackname %s." % action) + + name=action + + if not name in gbl.tnames: + continue + + if trAction in tfuncs: + tfuncs[trAction](name, ln[2:]) + counter += 1 + else: + error ("AllGrooves: Not a command: '%s'" % ' '.join(ln)) + + grooveDefineDo(g) # store the change!!! + + grooveDo(origSlot) # restore groove + + if not counter: + warning("No tracks affected with '%s'" % ' '.join(ln)) + + else: + if gbl.debug: + print "AllGrooves: %s tracks modified." % counter + diff --git a/mma/MMA/harmony.py b/mma/MMA/harmony.py index 2ef8188..77e98da 100644 --- a/mma/MMA/harmony.py +++ b/mma/MMA/harmony.py @@ -90,16 +90,16 @@ def harmonize(hmode, note, chord): def gethnote(note, chord): """ Determine harmony notes for a note based on the chord. - note - midi value of the note + note - midi value of the note - chord - list of midi values for the chord + chord - list of midi values for the chord - This routine works by creating a chord list with all - its notes having a value less than the note (remember, this - is all MIDI values). We then grab notes from the end of - the chord until one is found which is less than the original - note. + This routine works by creating a chord list with all + its notes having a value less than the note (remember, this + is all MIDI values). We then grab notes from the end of + the chord until one is found which is less than the original + note. """ wm="No harmony note found since no chord, using note " + \ diff --git a/mma/MMA/lyric.py b/mma/MMA/lyric.py index 878f3d1..e53ad73 100644 --- a/mma/MMA/lyric.py +++ b/mma/MMA/lyric.py @@ -252,35 +252,37 @@ class Lyric: if self.dupchords: ly = [] + for v in ln.split(): # do each chord symbol or '/' mark - for v in ln.split(): - v = v.replace('&', 'b') - if v == 'z': - v = 'N.C.' - if 'z' in v: - v = v.split('z')[0] - while v.startswith('-'): - v=v[1:] - while v.startswith('+'): - v=v[1:] + if v != '/': + v = v.replace('&', 'b') # remember, "&" is optional + + if v == 'z' or v == 'z!': # convert plain z to "NC" + v = 'N.C.' - if self.transpose: - tr=0 # Needed in case line is invalid! - cn=v[0:2] - if self.chordnames.has_key(cn): - tr=self.chordnames[cn] + self.transpose + if 'z' in v: # strip out the 'zCDA..' after the chord + v = v.split('z')[0] + + v = v.lstrip("+-") # strip off leading "+" and "-" + + if self.transpose: # transpose will be set to 0, 1, -1, etc. + t=None # Needed in case line is not a chord ('/', "NC")! + + try: # try for 2 char chord name (F#, Gb, etc) + cn=v[0:2] + t=self.chordnames[cn] + self.transpose + except: + try: # try 1 char chord name (C, D, etc) + cn=v[0:1] + t=self.chordnames[cn] + self.transpose + except: + pass # not a chord pitch - else: - cn=v[0:1] - if self.chordnames.has_key(cn): - tr=self.chordnames[cn] + self.transpose - - while tr>=12: tr-=12 - while tr<=-12: tr+=12 - - if tr: - v = self.transNames[self.transKey][tr] + v[len(cn):] + if t != None: # use None, 0 is okay + while t>=12: t-=12 + while t<=-12: t+=12 + v = self.transNames[self.transKey][t] + v[len(cn):] ly.append(v) diff --git a/mma/MMA/macro.py b/mma/MMA/macro.py index 91eab54..3066ee1 100644 --- a/mma/MMA/macro.py +++ b/mma/MMA/macro.py @@ -26,18 +26,21 @@ class. At the top of MMAparse an instance in created with something like: macros=MMMmacros.Macros(). """ -import gbl -from MMA.common import * -from MMA.notelen import getNoteLen +import random + import MMA.midiC -import MMA.lyric import MMA.translate import MMA.patSolo import MMA.patAria import MMA.volume -import MMA.notelen +import MMA.grooves +import MMA.parse +import MMA.seqrnd -import random +import gbl +from MMA.lyric import lyric +from MMA.common import * +from MMA.safe_eval import safe_eval class Macros: @@ -90,15 +93,15 @@ class Macros: return str(int(MMA.volume.lastVolume * 100)) elif s == 'GROOVE': - return gbl.currentGroove + return MMA.grooves.currentGroove elif s == 'LASTGROOVE': - return gbl.lastGroove + return MMA.grooves.lastGroove elif s == 'SEQRND': - if gbl.seqRnd[0] == 0: return "Off" - if gbl.seqRnd[0] == 1: return "On" - return ' '.join(gbl.seqRnd[1:]) + if MMA.seqrnd.seqRnd[0] == 0: return "Off" + if MMA.seqrnd.seqRnd[0] == 1: return "On" + return ' '.join(MMA.seqrnd.seqRnd[1:]) elif s == 'SEQSIZE': return str(gbl.seqSize) @@ -141,7 +144,7 @@ class Macros: return ' '.join([str(x) for x in MMA.midi.splitChannels]) elif s == 'SEQRNDWEIGHT': - return ' '.join([str(x) for x in MMA.parse.seqRndWeight]) + return ' '.join([str(x) for x in MMA.seqrnd.seqRndWeight]) elif s == 'AUTOLIBPATH': return gbl.autoLib @@ -168,7 +171,7 @@ class Macros: return str(gbl.lineno) elif s == 'LYRIC': - return MMA.lyric.lyric.setting() + return lyric.setting() # Track vars ... these are in format TRACKNAME_VAR @@ -179,10 +182,10 @@ class Macros: tname = s[:a] func = s[a+1:] - if gbl.tnames.has_key(tname): + try: t=gbl.tnames[tname] - else: - error("System variable $_%s refers to nonexistent track" % s) + except: + error("System variable $_%s refers to nonexistent track." % s ) if func == 'ACCENT': @@ -246,6 +249,12 @@ class Macros: elif func == 'RVOLUME': return ' '.join([str(int(a * 100)) for a in t.rVolume]) + + elif func == 'SEQUENCE': + tmp = [] + for a in range(gbl.seqSize): + tmp.append('{' + t.formatPattern(t.sequence[a]) + '}') + return ' '.join(tmp) elif func == 'SEQRND': if t.seqRnd: return 'On' @@ -271,7 +280,8 @@ class Macros: return ' '.join([str(x) for x in t.unify]) elif func == 'VOICE': - return ' '.join([MMA.midiC.voiceNames[a] for a in t.voice]) + return ' '.join([MMA.midiC.valueToInst(a) for a in t.voice]) + elif func == 'VOICING': if t.vtype != 'CHORD': @@ -287,7 +297,6 @@ class Macros: error("Unknown system track variable %s" % s) - def expand(self, l): """ Loop though input line and make variable subsitutions. MMA variables are pretty simple ... any word starting @@ -301,23 +310,36 @@ class Macros: if not self.expandMode: return l + gotmath=0 + while 1: # Loop until no more subsitutions have been done sub=0 + for i,s in enumerate(l): - if s[:2] == '$$': - continue - if s[0]=='$': - s=s[1:].upper() - if s.startswith('_'): + s = s[1:].upper() + frst = s[0] + + if frst == '$': # $$ - don't expand (done in IF clause) + continue + + elif frst == '(': # flag math macro + gotmath = 1 + continue + + # we have a var, see if system or user. Set 'ex' + + elif frst == '_': # system var ex=self.sysvar(s[1:]) + + + elif s in self.vars: # user var? + ex = self.vars[s] - elif not s in self.vars: + else: # unknown var...error error("User variable '%s' has not been defined" % s ) - else: - ex=self.vars[s] if type(ex) == type([]): # MSET variable if len(ex): @@ -336,6 +358,35 @@ class Macros: if not sub: break + # all the mma internal and system macros are expanded. Now check for math. + + if gotmath: + l = ' '.join(l) # join back into one line + + while 1: + try: + s1 = l.index('$(') # any '$(' left? + except: + break # nope, done + # find trailing ) + nest=0 + s2 = s1+2 + max = len(l) + while 1: + if l[s2] == '(': nest+=1 + if l[s2] == ')': + if not nest: + break + else: + nest-=1 + s2 += 1 + if s2 >= max: + error("Unmatched delimiter in '%s'." % l) + + l = l[:s1] + str(safe_eval( l[s1+2:s2].strip())) + l[s2+1:] + + l=l.split() + return l @@ -567,6 +618,7 @@ class Macros: l=l.upper() if l[:2] == '$$': + l=l.upper() l=l[2:] if not l in self.vars: error("String Variable '%s' does not exist" % l) @@ -575,9 +627,12 @@ class Macros: try: v=float(l) except: - v=None + try: + v=int(l,0) # this lets us convert HEX/OCTAL + except: + v=None - return ( l, v ) + return ( l.upper(), v ) def readblk(): @@ -626,9 +681,9 @@ class Macros: retpoint = 2 if action == 'DEF': - compare = self.vars.has_key(v) + compare = v in self.vars elif action == 'NDEF': - compare = ( not self.vars.has_key(v)) + compare = ( v not in self.vars ) else: error("Unreachable unary conditional") @@ -693,4 +748,19 @@ class Macros: gbl.inpath.push( q, qnum ) + +def domath(s): + """ A simple math factoring func. Just does add, sub, mult, divide. """ + print '>>>',s + s = ' '.join(s) + + try: + s = eval(s) + + except: + error("Error in '%s' expression." % s) + print s + return str(s) + + macros = Macros() diff --git a/mma/MMA/main.py b/mma/MMA/main.py index cb11f3d..c63f92d 100644 --- a/mma/MMA/main.py +++ b/mma/MMA/main.py @@ -24,14 +24,19 @@ Bob van der Poel """ import os +import time + +import MMA.midi +import MMA.parse +import MMA.file +import MMA.options +import MMA.auto +import MMA.docs + import gbl from MMA.common import * -import MMA.midi -import MMA.docs -import MMA.parse -from MMA.file import locFile from MMA.lyric import lyric -import MMA.options + ######################################## ######################################## @@ -66,37 +71,36 @@ m.addTrkName(0, 'MetaTrack') m.addTempo(0, gbl.tempo) MMA.parse.setTimeSig(['4','4']) # most stdlib files will override this - ##################################### # Read an RC file. All found files are processed. -docOption = gbl.docs # Disable doc printing for RC file -gbl.docs = 0 +docOption = gbl.createDocs # Disable doc printing for RC file +gbl.createDocs = 0 -rcread=0 +#rcread=0 rcfiles = ('mmarc', 'c:\\mma\\mmarc', '~/.mmarc', '/usr/local/etc/mmarc', '/etc/mmarc' ) if gbl.mmaRC: rcfiles = [ gbl.mmaRC ] for i in rcfiles: - f = locFile(i, None) + f = MMA.file.locFile(i, None) if f: if gbl.showrun: print "Reading RC file '%s'" % f MMA.parse.parseFile(f) - rcread+=1 + #rcread+=1 break else: if gbl.mmaRC: error("Specified init file '%s' not found" % gbl.mmaRC) -if not rcread: +else: #if not rcread: gbl.lineno = -1 warning("No RC file was found or processed") -gbl.docs = docOption # Restore doc options +gbl.createDocs = docOption # Restore doc options ################################################ @@ -106,8 +110,7 @@ gbl.docs = docOption # Restore doc options if gbl.makeGrvDefs: if gbl.infile: error("No filename is permitted with the -g option") - from MMA.auto import libUpdate - libUpdate() # update and EXIT + MMA.auto.libUpdate() # update and EXIT ################################ @@ -124,7 +127,7 @@ gbl.mtrks[0].addText(0, "Input filename: %s" % gbl.infile) # Just extract docs (-Dx) to stdout. if docOption: - f=locFile(gbl.infile, None) + f=MMA.file.locFile(gbl.infile, None) if not f: error("File '%s' not found" % gbl.infile) MMA.parse.parseFile(f) @@ -146,15 +149,19 @@ if gbl.cmdSMF: # 1. strip off the extension if it is .mma, # 2. append .mid +if gbl.playFile and gbl.outfile: + error("You cannot use the -f option with -P") + if gbl.outfile: outfile = gbl.outfile +elif gbl.playFile: + outfile = "MMAtmp%s.mid" % os.getpid() else: outfile, ext = os.path.splitext(gbl.infile) if ext != gbl.ext: outfile=gbl.infile outfile += '.mid' - outfile=os.path.expanduser(outfile) @@ -164,7 +171,7 @@ outfile=os.path.expanduser(outfile) # First the mmastart files for f in gbl.mmaStart: - fn = locFile(f, gbl.incPath) + fn = MMA.file.locFile(f, gbl.incPath) if not fn: warning("MmaStart file '%s' not found/processed" % fn) MMA.parse.parseFile(fn) @@ -172,7 +179,8 @@ for f in gbl.mmaStart: # The song file specified on the command line -f = locFile(gbl.infile, None) + +f = MMA.file.locFile(gbl.infile, None) if not f: gbl.lineno = -1 @@ -183,12 +191,11 @@ MMA.parse.parseFile(f) # Finally, the mmaend files for f in gbl.mmaEnd: - fn = locFile(f, None) + fn = MMA.file.locFile(f, None) if not fn: warning("MmaEnd file '%s' not found/processed" % f) MMA.parse.parseFile(fn) - ################################################# # Just display the channel assignments (-c) and exit... @@ -253,6 +260,7 @@ if gbl.noOutput: gbl.lineno=-1 # disable line nums for error/warning + """ We fix the outPath now. This lets you set outpath in the song file. The filename "outfile" was created above. It is either the input filename @@ -270,7 +278,7 @@ gbl.lineno=-1 # disable line nums for error/warning otherwise it is inserted before the filename portion. """ -if (not outfile.startswith('/')) and gbl.outPath and (not gbl.outfile): +if (not outfile.startswith('/')) and gbl.outPath and not gbl.outfile and not gbl.playFile: if gbl.outPath[0] in '.\\/': outfile = "%s/%s" % (gbl.outPath, outfile) else: @@ -288,6 +296,7 @@ for n in gbl.tnames.values(): if n.channel: n.doMidiClear() n.clearPending() + n.doChannelReset() if n.riff: warning("%s has pending Riff(s)" % n.name) @@ -317,7 +326,7 @@ if fileExist: print "Overwriting existing", else: print "Creating new", -print "midi file (%s bars): '%s'" % (gbl.barNum, outfile) +print "midi file (%s bars, %.2f min): '%s'" % (gbl.barNum, gbl.totTime, outfile) try: out = file(outfile, 'wb') @@ -327,6 +336,15 @@ except: MMA.midi.writeTracks(out) out.close() +if gbl.playFile: + print "Playing %s with %s" % (outfile, gbl.midiPlayer) + t=time.time() + os.system("%s %s" % (gbl.midiPlayer, outfile)) + os.remove(outfile) + print "Play complete (%.2f min), file has been deleted." % ((time.time()-t)/60) + if gbl.debug: print "Completed processing file '%s'." % outfile + + diff --git a/mma/MMA/mdefine.py b/mma/MMA/mdefine.py index ebc6028..bc4fb89 100644 --- a/mma/MMA/mdefine.py +++ b/mma/MMA/mdefine.py @@ -26,9 +26,12 @@ the sequences for later recall. """ +import MMA.midiC + import gbl from MMA.common import * -import MMA.midiC + + class Mdefine: def __init__(self): diff --git a/mma/MMA/midi.py b/mma/MMA/midi.py index e3c9fd9..329a65d 100644 --- a/mma/MMA/midi.py +++ b/mma/MMA/midi.py @@ -22,15 +22,15 @@ Bob van der Poel """ - - -import gbl -from MMA.common import * from MMA.midiM import intToWord, intTo3Byte, intToLong, intToVarNumber import MMA.midiC +import gbl +from MMA.common import * + splitChannels = [] + def setSplitChannels(ln): """ Parser routine, sets up list of track to split. Overwrites existing. """ @@ -39,10 +39,10 @@ def setSplitChannels(ln): splitChannels = [] for a in ln: - c = stoi(a) - if c < 1 or c >16: - error("SplitChannels: Expecting value 1 to 16, not %s" % c) - splitChannels.append(c) + a = stoi(a) + if a < 1 or a >16: + error("SplitChannels: Expecting value 1 to 16, not %s" % a) + splitChannels.append(a) if gbl.debug: print "SplitChannels: ", @@ -106,15 +106,16 @@ def writeTracks(out): def writeSplitTrack(channel, out): - """ Split a drum track into a separate track for the non-note - stuff and then a track for each note. + """ Split a track. In drum tracks this puts different instruments + into individual tracks (useful!); for instrument tracks it puts + each pitch into a track (probably not useful). """ tr = gbl.mtrks[channel].miditrk # track to split """ A dict to store the split midi tracks. We'll end out with a track for each pitch which appears in the track and - a track (labeled -1) to store every other than note on data. + a track (labeled -1) to store every other-than-note-on data. """ notes={} @@ -130,7 +131,7 @@ def writeSplitTrack(channel, out): else: n = -1 # special value for non-note on events - if not notes.has_key(n): # create a new mtrk if needed + if not n in notes: # create a new mtrk if needed notes[n]=Mtrk(10) if offset in notes[n].miditrk: # copy event to new track @@ -149,7 +150,7 @@ def writeSplitTrack(channel, out): if channel == 10: m = "%s" % MMA.midiC.valueToDrum(a) else: - m= "%s-%s" % (gbl.mtrks[channel].trackname, a) + m = "%s-%s" % (gbl.mtrks[channel].trackname, a) notes[a].addTrkName(0, m) @@ -166,8 +167,7 @@ def writeSplitTrack(channel, out): def mkHeader(count, tempo, Mtype): - return "MThd" + intToLong(6) + intToWord(Mtype) + \ - intToWord(count) + intToWord(tempo) + return "MThd" + intToLong(6) + intToWord(Mtype) + intToWord(count) + intToWord(tempo) """ Midi track class. All the midi creation is done here. @@ -188,7 +188,7 @@ class Mtrk: tr=self.miditrk lg=len(cmd) - if tr.has_key(offset): + if offset in tr: for i,a in enumerate(tr[offset]): if a[0:lg] == cmd: del tr[offset][i] @@ -221,11 +221,13 @@ class Mtrk: self.delDup(offset, cmd) self.addToTrack(offset, cmd + chr(0x02) + chr(n) + chr(mi) ) + def addMarker(self, offset, msg): """ Create a midi MARKER event.""" self.addToTrack(offset, chr(0xff) + chr(0x06) + intToVarNumber(len(msg)) + msg ) + def addText(self, offset, msg): """ Create a midi TextEvent.""" @@ -251,16 +253,25 @@ class Mtrk: self.addToTrack(offset, cmd + intToVarNumber(len(msg)) + msg ) - def addProgChange( self, offset, program): - """ Create a midi program change. + def addProgChange( self, offset, program, oldprg): + """ Create a midi program change (handles extended voicing). - program - midi program - - Returns - packed string + program - The MIDI program (voice) value + oldprg - existing MIDI program """ - self.addToTrack(offset, - chr(0xc0 | self.channel) + chr(program) ) + v1, lsb1, msb1 = MMA.midiC.voice2tup(oldprg) + v2, lsb2, msb2 = MMA.midiC.voice2tup(program) + + if msb1 != msb2: # only if CTRL32 has changed + self.addToTrack(offset, chr(0xb0 | self.channel) + chr(0x20) + chr(msb2) ) + + if lsb1 != lsb2: # only if CTRL0 has changed + self.addToTrack(offset, chr(0xb0 | self.channel) + chr(0x00) + chr(lsb2) ) + + # Always do voice change. Maybe not necessary, but let's be safe. + + self.addToTrack(offset, chr(0xc0 | self.channel) + chr(v2) ) def addGlis(self, offset, v): @@ -272,22 +283,17 @@ class Mtrk: """ if v == 0: - self.addToTrack(offset, - chr(0xb0 | self.channel) + chr(0x41) + chr(0x00) ) + self.addToTrack(offset, chr(0xb0 | self.channel) + chr(0x41) + chr(0x00) ) else: - self.addToTrack(offset, - chr(0xb0 | self.channel) + chr(0x41) + chr(0x7f) ) - self.addToTrack(offset, - chr(0xb0 | self.channel) + chr(0x05) + chr(v) ) - + self.addToTrack(offset, chr(0xb0 | self.channel) + chr(0x41) + chr(0x7f) ) + self.addToTrack(offset, chr(0xb0 | self.channel) + chr(0x05) + chr(v) ) def addPan(self, offset, v): """ Set the lsb of the pan setting.""" - self.addToTrack(offset, - chr(0xb0 | self.channel) + chr(0x0a) + chr(v) ) + self.addToTrack(offset, chr(0xb0 | self.channel) + chr(0x0a) + chr(v) ) def addCtl(self, offset, l): @@ -316,9 +322,9 @@ class Mtrk: def addTempo(self, offset, beats): """ Create a midi tempo meta event. - beats - beats per second + beats - beats per second - Return - packed midi string + Return - packed midi string """ cmd = chr(0xff) + chr(0x51) @@ -329,11 +335,26 @@ class Mtrk: def writeMidiTrack(self, out): """ Create/write the MIDI track. - We convert timing offsets to midi-deltas. + We convert timing offsets to midi-deltas. """ tr=self.miditrk + """ If the -1 flag is set we need to add a terminate + to the end of each track. This is done to make looping + software like seq24 happy. We do this by truncating all + data in the file past the current tick pointer and inserting + an all-notes-off at that position. + """ + + if gbl.endsync and self.channel>=0: + eof = gbl.tickOffset + for offset in tr.keys(): + if offset > eof: + del tr[offset] + self.addToTrack(eof, chr(0xb0 | self.channel) + chr(0x7b) + chr(0)) + + """ To every MIDI track we generate we add (if the -0 flag was set) an on/off beep at offset 0. This makes for easier sync in multi-tracks. @@ -360,19 +381,19 @@ class Mtrk: # Convert all events to MIDI deltas and store in # the track array/list - tdata=[] # empty track container - lastSts=None # Running status tracker + tdata = [] # empty track container + lastSts = None # Running status tracker for a in sorted(tr.keys()): delta = a-last for d in tr[a]: """ Running status check. For each packet compare - the first byte with the first byte of the previous - packet. If it is can be converted to running status - we strip out byte 0. Note that valid running status - byte are 0x80..0xef. 0xfx are system messages - and are note suitable for running status. + the first byte with the first byte of the previous + packet. If it is can be converted to running status + we strip out byte 0. Note that valid running status + byte are 0x80..0xef. 0xfx are system messages + and are note suitable for running status. """ if len(d) > 1: @@ -404,35 +425,34 @@ class Mtrk: def addPairToTrack(self, boffset, startRnd, duration, note, v, unify): """ Add a note on/off pair to a track. - boffset - offset into current bar - startRnd - rand val start adjustment - duration - note len - note - midi value of note - v - midi velocity - unify - if set attempt to unify/compress on/offs + boffset - offset into current bar + startRnd - rand val start adjustment + duration - note len + note - midi value of note + v - midi velocity + unify - if set attempt to unify/compress on/offs - This function tries its best to handle overlapping events. - Easy to show effect with a table of note ON/OFF pairs. Both - events are for the same note pitch. + This function tries its best to handle overlapping events. + Easy to show effect with a table of note ON/OFF pairs. Both + events are for the same note pitch. - Offsets | 200 | 300 | 320 | 420 - ---------|--------|--------|-------|-------- - Pair1 | on | | off | - Pair2 | | on | | off + Offsets | 200 | 300 | 320 | 420 + ---------|--------|--------|-------|-------- + Pair1 | on | | off | + Pair2 | | on | | off - The logic here will delete the OFF event at 320 and - insert a new OFF at 300. Result is that when playing - Pair1 will turn off at 300 followed by the same note - in Pair2 beginning sounded right after. Why the on/off? - Remember: Velocities may be different! + The logic here will delete the OFF event at 320 and + insert a new OFF at 300. Result is that when playing + Pair1 will turn off at 300 followed by the same note + in Pair2 beginning sounded right after. Why the on/off? + Remember: Velocities may be different! - However, if the unify flag is set we should end up with: - - Offsets | 200 | 300 | 320 | 420 - ---------|--------|--------|-------|-------- - Pair1 | on | | | - Pair2 | | | | off + However, if the unify flag is set we should end up with: + Offsets | 200 | 300 | 320 | 420 + ---------|--------|--------|-------|-------- + Pair1 | on | | | + Pair2 | | | | off """ @@ -442,31 +462,31 @@ class Mtrk: offOffset = onOffset + duration # ON/OFF events - - onEvent = chr(0x90 | self.channel) + chr(note) + chr(v) + + onEvent = chr(0x90 | self.channel) + chr(note) + chr(v) offEvent = onEvent[:-1] + chr(0) """ Check for overlap on last event set for this track and - do some ugly trickry. + do some ugly trickry. - - The noOnFlag is set if we don't want to have the main - routine add in the ON event. This is set when UNIFY is - set and we have an overlap. + - The noOnFlag is set if we don't want to have the main + routine add in the ON event. This is set when UNIFY is + set and we have an overlap. - - We set F to the stored event time for this note and, - if it's in the same event range as the current event - we loop though the saved events for this track. We are - looking for a NOTE OFF event. + - We set F to the stored event time for this note and, + if it's in the same event range as the current event + we loop though the saved events for this track. We are + looking for a NOTE OFF event. - - If we get a matching event we then delete it from the - track. This requires 2 statements: one for an event - list with only 1 event, a 2nd for multiple events. + - If we get a matching event we then delete it from the + track. This requires 2 statements: one for an event + list with only 1 event, a 2nd for multiple events. - - If UNIFY is NOT set we insert a NOTE OFF at the current - on time. This replaces the OFF we just deleted. + - If UNIFY is NOT set we insert a NOTE OFF at the current + on time. This replaces the OFF we just deleted. - - If UNIFY is SET we skip the above step, and we set the - noOnFlag so that the ON event isn't set. + - If UNIFY is SET we skip the above step, and we set the + noOnFlag so that the ON event isn't set. """ @@ -499,10 +519,10 @@ class Mtrk: def zapRangeTrack(self, start, end): """ Clear NoteOn events from track in range: start ... end. - This is called from the fermata function. + This is called from the fermata function. - We delete the entire event list (3 bytes) from the buffer. This - can result in empty directory enteries, but that isn't a problem. + We delete the entire event list (3 bytes) from the buffer. This + can result in empty directory enteries, but that isn't a problem. """ trk=self.miditrk @@ -517,14 +537,14 @@ class Mtrk: def addToTrack(self, offset, event): """ Add an event to a track. - MIDI data is saved as created in track structures. - Each track has a miditrk dictionary entry which used - the time offsets and keys and has the various events - as data. Each event is packed string of bytes and - the events are stored as a list in the order they are - created. Our storage looks like: + MIDI data is saved as created in track structures. + Each track has a miditrk dictionary entry which used + the time offsets and keys and has the various events + as data. Each event is a packed string of bytes and + the events are stored as a list in the order they are + created. Our storage looks like: - miditrk[123] = [event1, event2, ...] + miditrk[OFFSET_VALUE] = [event1, event2, ...] """ if offset<0: @@ -538,8 +558,6 @@ class Mtrk: tr[offset]=[event] - - class TimeSig: """ Track and set the current time signature. diff --git a/mma/MMA/midiC.py b/mma/MMA/midiC.py index 4fd4f3a..c3dd423 100644 --- a/mma/MMA/midiC.py +++ b/mma/MMA/midiC.py @@ -26,64 +26,101 @@ This module contains interface for MIDI constants and conversion routines. from MMA.common import * from MMA.miditables import * -def drumToValue(name): - """ Get the value of the drum tone (-1==error). """ - try: - v=int(name, 0) - except: - try: - v = upperDrumNames.index(name.upper()) + 27 - except ValueError: - error("Expecting a valid drum name or value for drum tone, not '%s'" % name) +def voice2tup(x): + """ Convert integer into 3 byte tuple: Voice, LSB, MSB. """ - if v <0 or v > 127: - error("Note in Drum Tone list must be 0..127, not %s" % v) + if x>0xffff: + msb = x >> 16 + x &= 0xffff + else: + msb = 0 + if x>0xff: + lsb = x >> 8 + x &= 0xff + else: + lsb = 0 + + return (x, lsb, msb) + + +def extVocStr(v): + + v = "%s.%s.%s" % voice2tup(v) + if v[-2:] == '.0': + v=v[:-2] + if v[-2:] == '.0': + v=v[:-2] return v +############################### + +def drumToValue(name): + """ Get the value of the drum tone (-1==error). + Note that this is quite different from instToValue() ... in that + case the caller does a bunch of validation stuff for controllers, etc. + """ + + try: # assuming that 'name' is an integer + i = int(name, 0) + if i>=0 and i<=127: + return int(name) + else: + return -1 + except: + try: + return drumInx[ name.upper() ] + except KeyError: + return -1 + + +def valueToDrum(val): + """ Get the name of the drum tone. """ + + try: + return drumNames[val] + except KeyError: + return str(val) def instToValue(name): """ Get the value of the instrument name (-1==error). """ try: - return upperVoiceNames.index(name.upper()) - except ValueError: + return voiceInx[name.upper()] + except KeyError: return -1 -def ctrlToValue(name): - """ Get the value of the controler name (-1==error). """ - - try: - return upperCtrlNames.index(name.upper()) - except ValueError: - return -1 def valueToInst(val): """ Get the name of the inst. (or 'ERR'). """ try: - return voiceNames[val] - except IndexError: - return "ERROR" + return voiceNames[val] + except KeyError: + try: + int(val) + except: + return "ERROR" + return extVocStr(val) -def valueToDrum(val): - """ Get the name of the drum tone. + - We return the NAME of the tone, or the original value if there is - no name associated with the value (only value 27 to 86 have names). - """ +def ctrlToValue(name): + """ Get the value of the controler name (-1==error). """ - if val<27 or val>86: - return str(val) - else: - return drumNames[val-27] + try: + return ctrlInx[name.upper()] + except keyError: + return -1 + + def valueToCtrl(val): """ Get the name of the controller (or 'ERR'). """ try: - return ctrlNames[val] - except IndexError: + return ctrlNames[val] + except KeyError: return "ERROR" diff --git a/mma/MMA/midiIn.py b/mma/MMA/midiIn.py index 5a9d7ee..6553a36 100644 --- a/mma/MMA/midiIn.py +++ b/mma/MMA/midiIn.py @@ -23,11 +23,15 @@ Bob van der Poel """ +import os + import MMA.midiM -from MMA.alloc import trackAlloc + import gbl from MMA.common import * -import os +from MMA.alloc import trackAlloc + + # The following 2 variables are global. A bit ugly :) @@ -149,7 +153,10 @@ def midiinc(ln): iend = 0xffffff for a in ln: - cmd, opt = a.split('=') + try: + cmd, opt = a.split('=') + except: + error("MidiInc expecting cmd=opt pairs, not '%s'." % a) cmd=cmd.upper() @@ -497,7 +504,7 @@ def midiinc(ln): t.clearPending() if t.voice[0] != t.ssvoice: - gbl.mtrks[t.channel].addProgChange( gbl.tickOffset, t.voice[0]) + gbl.mtrks[t.channel].addProgChange( gbl.tickOffset, t.voice[0], t.ssvoice) channel = t.channel track = gbl.mtrks[channel] diff --git a/mma/MMA/miditables.py b/mma/MMA/miditables.py index 238bd0f..c4a85e5 100644 --- a/mma/MMA/miditables.py +++ b/mma/MMA/miditables.py @@ -27,140 +27,252 @@ MIDI controllers. Having only the constants in this separate file permits to call this from other programs, mainly the mma doc creators. + + **** IMPORTANT *** IMPORTANT + + The tables *Names/*Inx MUST have matching keys/values. + The KEYS in the *Inx tables are the values from the + *Name tables in UPPERCASE. Be very careful making changes!!!!! + """ +# Standard GM drum tone names. + +drumNames={ + 27:'HighQ', 28:'Slap', 29:'ScratchPush', + 30:'ScratchPull', 31:'Sticks', 32:'SquareClick', + 33:'MetronomeClick', 34:'MetronomeBell', 35:'KickDrum2', + 36:'KickDrum1', 37:'SideKick', 38:'SnareDrum1', + 39:'HandClap', 40:'SnareDrum2', 41:'LowTom2', + 42:'ClosedHiHat', 43:'LowTom1', 44:'PedalHiHat', + 45:'MidTom2', 46:'OpenHiHat', 47:'MidTom1', + 48:'HighTom2', 49:'CrashCymbal1', 50:'HighTom1', + 51:'RideCymbal1', 52:'ChineseCymbal', 53:'RideBell', + 54:'Tambourine', 55:'SplashCymbal', 56:'CowBell', + 57:'CrashCymbal2', 58:'VibraSlap', 59:'RideCymbal2', + 60:'HighBongo', 61:'LowBongo', 62:'MuteHighConga', + 63:'OpenHighConga', 64:'LowConga', 65:'HighTimbale', + 66:'LowTimbale', 67:'HighAgogo', 68:'LowAgogo', + 69:'Cabasa', 70:'Maracas', 71:'ShortHiWhistle', + 72:'LongLowWhistle', 73:'ShortGuiro', 74:'LongGuiro', + 75:'Claves', 76:'HighWoodBlock', 77:'LowWoodBlock', + 78:'MuteCuica', 79:'OpenCuica', 80:'MuteTriangle', + 81:'OpenTriangle', 82:'Shaker', 83:'JingleBell', + 84:'Castanets', 85:'MuteSudro', 86:'OpenSudro'} + +drumInx={ + 'HIGHQ':27, 'SLAP':28, 'SCRATCHPUSH':29, + 'SCRATCHPULL':30, 'STICKS':31, 'SQUARECLICK':32, + 'METRONOMECLICK':33, 'METRONOMEBELL':34, 'KICKDRUM2':35, + 'KICKDRUM1':36, 'SIDEKICK':37, 'SNAREDRUM1':38, + 'HANDCLAP':39, 'SNAREDRUM2':40, 'LOWTOM2':41, + 'CLOSEDHIHAT':42, 'LOWTOM1':43, 'PEDALHIHAT':44, + 'MIDTOM2':45, 'OPENHIHAT':46, 'MIDTOM1':47, + 'HIGHTOM2':48, 'CRASHCYMBAL1':49, 'HIGHTOM1':50, + 'RIDECYMBAL1':51, 'CHINESECYMBAL':52, 'RIDEBELL':53, + 'TAMBOURINE':54, 'SPLASHCYMBAL':55, 'COWBELL':56, + 'CRASHCYMBAL2':57, 'VIBRASLAP':58, 'RIDECYMBAL2':59, + 'HIGHBONGO':60, 'LOWBONGO':61, 'MUTEHIGHCONGA':62, + 'OPENHIGHCONGA':63, 'LOWCONGA':64, 'HIGHTIMBALE':65, + 'LOWTIMBALE':66, 'HIGHAGOGO':67, 'LOWAGOGO':68, + 'CABASA':69, 'MARACAS':70, 'SHORTHIWHISTLE':71, + 'LONGLOWWHISTLE':72, 'SHORTGUIRO':73, 'LONGGUIRO':74, + 'CLAVES':75, 'HIGHWOODBLOCK':76, 'LOWWOODBLOCK':77, + 'MUTECUICA':78, 'OPENCUICA':79, 'MUTETRIANGLE':80, + 'OPENTRIANGLE':81, 'SHAKER':82, 'JINGLEBELL':83, + 'CASTANETS':84, 'MUTESUDRO':85, 'OPENSUDRO':86} -""" English names for midi instruments and drums. - These tables are used by the pattern classes to - convert inst/drum names to midi values and by the - doc routines to print tables. -""" - -# The drum names are valid for tones 27 to 87 - -drumNames=[ - 'HighQ', 'Slap', 'ScratchPush', 'ScratchPull', - 'Sticks', 'SquareClick', 'MetronomeClick', - 'MetronomeBell', 'KickDrum2', 'KickDrum1', - 'SideKick', 'SnareDrum1', 'HandClap', - 'SnareDrum2', 'LowTom2', 'ClosedHiHat', - 'LowTom1', 'PedalHiHat', 'MidTom2', 'OpenHiHat', - 'MidTom1', 'HighTom2', 'CrashCymbal1', - 'HighTom1', 'RideCymbal1', 'ChineseCymbal', - 'RideBell', 'Tambourine', 'SplashCymbal', - 'CowBell', 'CrashCymbal2', 'VibraSlap', - 'RideCymbal2', 'HighBongo', 'LowBongo', - 'MuteHighConga', 'OpenHighConga', 'LowConga', - 'HighTimbale', 'LowTimbale', 'HighAgogo', - 'LowAgogo', 'Cabasa', 'Maracas', - 'ShortHiWhistle', 'LongLowWhistle', 'ShortGuiro', - 'LongGuiro', 'Claves', 'HighWoodBlock', - 'LowWoodBlock', 'MuteCuica', 'OpenCuica', - 'MuteTriangle', 'OpenTriangle', 'Shaker', - 'JingleBell', 'Castanets', 'MuteSudro', - 'OpenSudro' ] - -upperDrumNames = [name.upper() for name in drumNames] +# Standard GM voice names. -voiceNames=[ - 'Piano1', 'Piano2','Piano3', - 'Honky-TonkPiano', 'RhodesPiano', 'EPiano', - 'HarpsiChord', 'Clavinet', 'Celesta', - 'Glockenspiel', 'MusicBox', 'Vibraphone', - 'Marimba', 'Xylophone', 'TubularBells', 'Santur', - 'Organ1', 'Organ2', 'Organ3', 'ChurchOrgan', - 'ReedOrgan', 'Accordion', 'Harmonica', - 'Bandoneon', 'NylonGuitar', 'SteelGuitar', - 'JazzGuitar', 'CleanGuitar', 'MutedGuitar', - 'OverDriveGuitar', 'DistortonGuitar', - 'GuitarHarmonics', 'AcousticBass', - 'FingeredBass', 'PickedBass', 'FretlessBass', - 'SlapBass1', 'SlapBass2', 'SynthBass1', - 'SynthBass2', 'Violin', 'Viola', 'Cello', - 'ContraBass', 'TremoloStrings', - 'PizzicatoString', 'OrchestralHarp', 'Timpani', - 'Strings', 'SlowStrings', 'SynthStrings1', - 'SynthStrings2', 'ChoirAahs', 'VoiceOohs', - 'SynthVox', 'OrchestraHit', 'Trumpet', - 'Trombone', 'Tuba', 'MutedTrumpet', 'FrenchHorn', - 'BrassSection', 'SynthBrass1', 'SynthBrass2', - 'SopranoSax', 'AltoSax', 'TenorSax', - 'BaritoneSax', 'Oboe', 'EnglishHorn', 'Bassoon', - 'Clarinet', 'Piccolo', 'Flute', 'Recorder', - 'PanFlute', 'BottleBlow', 'Shakuhachi', - 'Whistle', 'Ocarina', 'SquareWave', 'SawWave', - 'SynCalliope', 'ChifferLead', 'Charang', - 'SoloVoice', '5thSawWave', 'Bass&Lead', - 'Fantasia', 'WarmPad', 'PolySynth', 'SpaceVoice', - 'BowedGlass', 'MetalPad', 'HaloPad', 'SweepPad', - 'IceRain', 'SoundTrack', 'Crystal', 'Atmosphere', - 'Brightness', 'Goblins', 'EchoDrops', - 'StarTheme', 'Sitar', 'Banjo', 'Shamisen', - 'Koto', 'Kalimba', 'BagPipe', 'Fiddle', 'Shanai', - 'TinkleBell', 'AgogoBells', 'SteelDrums', - 'WoodBlock', 'TaikoDrum', 'MelodicTom1', - 'SynthDrum', 'ReverseCymbal', 'GuitarFretNoise', - 'BreathNoise', 'SeaShore', 'BirdTweet', - 'TelephoneRing', 'HelicopterBlade', - 'Applause/Noise', 'GunShot' ] +voiceNames={ + 0:'Piano1', 1:'Piano2', 2:'Piano3', + 3:'Honky-TonkPiano', 4:'RhodesPiano', 5:'EPiano', + 6:'HarpsiChord', 7:'Clavinet', 8:'Celesta', + 9:'Glockenspiel', 10:'MusicBox', 11:'Vibraphone', + 12:'Marimba', 13:'Xylophone', 14:'TubularBells', + 15:'Santur', 16:'Organ1', 17:'Organ2', + 18:'Organ3', 19:'ChurchOrgan', 20:'ReedOrgan', + 21:'Accordion', 22:'Harmonica', 23:'Bandoneon', + 24:'NylonGuitar', 25:'SteelGuitar', 26:'JazzGuitar', + 27:'CleanGuitar', 28:'MutedGuitar', 29:'OverDriveGuitar', + 30:'DistortonGuitar', 31:'GuitarHarmonics', 32:'AcousticBass', + 33:'FingeredBass', 34:'PickedBass', 35:'FretlessBass', + 36:'SlapBass1', 37:'SlapBass2', 38:'SynthBass1', + 39:'SynthBass2', 40:'Violin', 41:'Viola', + 42:'Cello', 43:'ContraBass', 44:'TremoloStrings', + 45:'PizzicatoString', 46:'OrchestralHarp', 47:'Timpani', + 48:'Strings', 49:'SlowStrings', 50:'SynthStrings1', + 51:'SynthStrings2', 52:'ChoirAahs', 53:'VoiceOohs', + 54:'SynthVox', 55:'OrchestraHit', 56:'Trumpet', + 57:'Trombone', 58:'Tuba', 59:'MutedTrumpet', + 60:'FrenchHorn', 61:'BrassSection', 62:'SynthBrass1', + 63:'SynthBrass2', 64:'SopranoSax', 65:'AltoSax', + 66:'TenorSax', 67:'BaritoneSax', 68:'Oboe', + 69:'EnglishHorn', 70:'Bassoon', 71:'Clarinet', + 72:'Piccolo', 73:'Flute', 74:'Recorder', + 75:'PanFlute', 76:'BottleBlow', 77:'Shakuhachi', + 78:'Whistle', 79:'Ocarina', 80:'SquareWave', + 81:'SawWave', 82:'SynCalliope', 83:'ChifferLead', + 84:'Charang', 85:'SoloVoice', 86:'5thSawWave', + 87:'Bass&Lead', 88:'Fantasia', 89:'WarmPad', + 90:'PolySynth', 91:'SpaceVoice', 92:'BowedGlass', + 93:'MetalPad', 94:'HaloPad', 95:'SweepPad', + 96:'IceRain', 97:'SoundTrack', 98:'Crystal', + 99:'Atmosphere', 100:'Brightness', 101:'Goblins', + 102:'EchoDrops', 103:'StarTheme', 104:'Sitar', + 105:'Banjo', 106:'Shamisen', 107:'Koto', + 108:'Kalimba', 109:'BagPipe', 110:'Fiddle', + 111:'Shanai', 112:'TinkleBell', 113:'AgogoBells', + 114:'SteelDrums', 115:'WoodBlock', 116:'TaikoDrum', + 117:'MelodicTom1', 118:'SynthDrum', 119:'ReverseCymbal', + 120:'GuitarFretNoise', 121:'BreathNoise', 122:'SeaShore', + 123:'BirdTweet', 124:'TelephoneRing', 125:'HelicopterBlade', + 126:'Applause/Noise', 127:'GunShot' } + +voiceInx={ + 'PIANO1':0, 'PIANO2':1, 'PIANO3':2, + 'HONKY-TONKPIANO':3, 'RHODESPIANO':4, 'EPIANO':5, + 'HARPSICHORD':6, 'CLAVINET':7, 'CELESTA':8, + 'GLOCKENSPIEL':9, 'MUSICBOX':10, 'VIBRAPHONE':11, + 'MARIMBA':12, 'XYLOPHONE':13, 'TUBULARBELLS':14, + 'SANTUR':15, 'ORGAN1':16, 'ORGAN2':17, + 'ORGAN3':18, 'CHURCHORGAN':19, 'REEDORGAN':20, + 'ACCORDION':21, 'HARMONICA':22, 'BANDONEON':23, + 'NYLONGUITAR':24, 'STEELGUITAR':25, 'JAZZGUITAR':26, + 'CLEANGUITAR':27, 'MUTEDGUITAR':28, 'OVERDRIVEGUITAR':29, + 'DISTORTONGUITAR':30, 'GUITARHARMONICS':31, 'ACOUSTICBASS':32, + 'FINGEREDBASS':33, 'PICKEDBASS':34, 'FRETLESSBASS':35, + 'SLAPBASS1':36, 'SLAPBASS2':37, 'SYNTHBASS1':38, + 'SYNTHBASS2':39, 'VIOLIN':40, 'VIOLA':41, + 'CELLO':42, 'CONTRABASS':43, 'TREMOLOSTRINGS':44, + 'PIZZICATOSTRING':45, 'ORCHESTRALHARP':46, 'TIMPANI':47, + 'STRINGS':48, 'SLOWSTRINGS':49, 'SYNTHSTRINGS1':50, + 'SYNTHSTRINGS2':51, 'CHOIRAAHS':52, 'VOICEOOHS':53, + 'SYNTHVOX':54, 'ORCHESTRAHIT':55, 'TRUMPET':56, + 'TROMBONE':57, 'TUBA':58, 'MUTEDTRUMPET':59, + 'FRENCHHORN':60, 'BRASSSECTION':61, 'SYNTHBRASS1':62, + 'SYNTHBRASS2':63, 'SOPRANOSAX':64, 'ALTOSAX':65, + 'TENORSAX':66, 'BARITONESAX':67, 'OBOE':68, + 'ENGLISHHORN':69, 'BASSOON':70, 'CLARINET':71, + 'PICCOLO':72, 'FLUTE':73, 'RECORDER':74, + 'PANFLUTE':75, 'BOTTLEBLOW':76, 'SHAKUHACHI':77, + 'WHISTLE':78, 'OCARINA':79, 'SQUAREWAVE':80, + 'SAWWAVE':81, 'SYNCALLIOPE':82, 'CHIFFERLEAD':83, + 'CHARANG':84, 'SOLOVOICE':85, '5THSAWWAVE':86, + 'BASS&LEAD':87, 'FANTASIA':88, 'WARMPAD':89, + 'POLYSYNTH':90, 'SPACEVOICE':91, 'BOWEDGLASS':92, + 'METALPAD':93, 'HALOPAD':94, 'SWEEPPAD':95, + 'ICERAIN':96, 'SOUNDTRACK':97, 'CRYSTAL':98, + 'ATMOSPHERE':99, 'BRIGHTNESS':100, 'GOBLINS':101, + 'ECHODROPS':102, 'STARTHEME':103, 'SITAR':104, + 'BANJO':105, 'SHAMISEN':106, 'KOTO':107, + 'KALIMBA':108, 'BAGPIPE':109, 'FIDDLE':110, + 'SHANAI':111, 'TINKLEBELL':112, 'AGOGOBELLS':113, + 'STEELDRUMS':114, 'WOODBLOCK':115, 'TAIKODRUM':116, + 'MELODICTOM1':117, 'SYNTHDRUM':118, 'REVERSECYMBAL':119, + 'GUITARFRETNOISE':120, 'BREATHNOISE':121, 'SEASHORE':122, + 'BIRDTWEET':123, 'TELEPHONERING':124, 'HELICOPTERBLADE':125, + 'APPLAUSE/NOISE':126, 'GUNSHOT':127 } -upperVoiceNames = [name.upper() for name in voiceNames] +# Controller names. Tables are borrowed from: +# http://www.midi.org/about-midi/table3.shtml -ctrlNames = [ - ### also see: http://www.midi.org/about-midi/table3.shtml +# 0-31 Double Precise Controllers MSB (14-bits, 16,384 values) +# 32-63 Double Precise Controllers LSB (14-bits, 16,384 values) +# 64-119 Single Precise Controllers (7-bits, 128 values) +# 120-127 Channel Mode Messages - ### 0-31 Double Precise Controllers - ### MSB (14-bits, 16,384 values) +ctrlNames = { + 0:'Bank', 1:'Modulation', 2:'Breath', + 3:'Ctrl3', 4:'Foot', 5:'Portamento', + 6:'Data', 7:'Volume', 8:'Balance', + 9:'Ctrl9', 10:'Pan', 11:'Expression', + 12:'Effect1', 13:'Effect2', 14:'Ctrl14', + 15:'Ctrl15', 16:'General1', 17:'General2', + 18:'General3', 19:'General4', 20:'Ctrl20', + 21:'Ctrl21', 22:'Ctrl22', 23:'Ctrl23', + 24:'Ctrl24', 25:'Ctrl25', 26:'Ctrl26', + 27:'Ctrl27', 28:'Ctrl28', 29:'Ctrl29', + 30:'Ctrl30', 31:'Ctrl31', 32:'BankLSB', + 33:'ModulationLSB', 34:'BreathLSB', 35:'Ctrl35', + 36:'FootLSB', 37:'PortamentoLSB', 38:'DataLSB', + 39:'VolumeLSB', 40:'BalanceLSB', 41:'Ctrl41', + 42:'PanLSB', 43:'ExpressionLSB', 44:'Effect1LSB', + 45:'Effect2LSB', 46:'Ctrl46', 47:'Ctrl47', + 48:'General1LSB', 49:'General2LSB', 50:'General3LSB', + 51:'General4LSB', 52:'Ctrl52', 53:'Ctrl53', + 54:'Ctrl54', 55:'Ctrl55', 56:'Ctrl56', + 57:'Ctrl57', 58:'Ctrl58', 59:'Ctrl59', + 60:'Ctrl60', 61:'Ctrl61', 62:'Ctrl62', + 63:'Ctrl63', 64:'Sustain', 65:'Portamento', + 66:'Sostenuto', 67:'SoftPedal', 68:'Legato', + 69:'Hold2', 70:'Variation', 71:'Resonance', + 72:'ReleaseTime', 73:'AttackTime', 74:'Brightness', + 75:'DecayTime', 76:'VibratoRate', 77:'VibratoDepth', + 78:'VibratoDelay', 79:'Ctrl79', 80:'General5', + 81:'General6', 82:'General7', 83:'General8', + 84:'PortamentoCtrl', 85:'Ctrl85', 86:'Ctrl86', + 87:'Ctrl87', 88:'Ctrl88', 89:'Ctrl89', + 90:'Ctrl90', 91:'Reverb', 92:'Tremolo', + 93:'Chorus', 94:'Detune', 95:'Phaser', + 96:'DataInc', 97:'DataDec', 98:'NonRegLSB', + 99:'NonRegMSB', 100:'RegParLSB', 101:'RegParMSB', + 102:'Ctrl102', 103:'Ctrl103', 104:'Ctrl104', + 105:'Ctrl105', 106:'Ctrl106', 107:'Ctrl107', + 108:'Ctrl108', 109:'Ctrl109', 110:'Ctrl110', + 111:'Ctrl111', 112:'Ctrl112', 113:'Ctrl113', + 114:'Ctrl114', 115:'Ctrl115', 116:'Ctrl116', + 117:'Ctrl117', 118:'Ctrl118', 119:'Ctrl119', + 120:'AllSoundsOff', 121:'ResetAll', 122:'LocalCtrl', + 123:'AllNotesOff', 124:'OmniOff', 125:'OmniOn', + 126:'PolyOff', 127:'PolyOn' } - 'Bank', 'Modulation', 'Breath', 'Ctrl3', - 'Foot', 'Portamento', 'Data', 'Volume', - 'Balance', 'Ctrl9', 'Pan', 'Expression', - 'Effect1', 'Effect2', 'Ctrl14', 'Ctrl15', - 'General1','General2','General3','General4', - 'Ctrl20', 'Ctrl21', 'Ctrl22', 'Ctrl23', - 'Ctrl24', 'Ctrl25', 'Ctrl26', 'Ctrl27', - 'Ctrl28', 'Ctrl29', 'Ctrl30', 'Ctrl31', - ### 32-63 Double Precise Controllers - ### LSB (14-bits, 16,384 values) - 'BankLSB', 'ModulationLSB', 'BreathLSB', - 'Ctrl35', 'FootLSB', 'PortamentoLSB', - 'DataLSB','VolumeLSB','BalanceLSB', - 'Ctrl41','PanLSB','ExpressionLSB', - 'Effect1LSB', 'Effect2LSB','Ctrl46', 'Ctrl47', - 'General1LSB','General2LSB', 'General3LSB', - 'General4LSB', 'Ctrl52','Ctrl53', 'Ctrl54', - 'Ctrl55', 'Ctrl56', 'Ctrl57', 'Ctrl58', - 'Ctrl59', 'Ctrl60', 'Ctrl61', 'Ctrl62', - 'Ctrl63', +ctrlInx = { + 'BANK':0, 'MODULATION':1, 'BREATH':2, + 'CTRL3':3, 'FOOT':4, 'PORTAMENTO':5, + 'DATA':6, 'VOLUME':7, 'BALANCE':8, + 'CTRL9':9, 'PAN':10, 'EXPRESSION':11, + 'EFFECT1':12, 'EFFECT2':13, 'CTRL14':14, + 'CTRL15':15, 'GENERAL1':16, 'GENERAL2':17, + 'GENERAL3':18, 'GENERAL4':19, 'CTRL20':20, + 'CTRL21':21, 'CTRL22':22, 'CTRL23':23, + 'CTRL24':24, 'CTRL25':25, 'CTRL26':26, + 'CTRL27':27, 'CTRL28':28, 'CTRL29':29, + 'CTRL30':30, 'CTRL31':31, 'BANKLSB':32, + 'MODULATIONLSB':33, 'BREATHLSB':34, 'CTRL35':35, + 'FOOTLSB':36, 'PORTAMENTOLSB':37, 'DATALSB':38, + 'VOLUMELSB':39, 'BALANCELSB':40, 'CTRL41':41, + 'PANLSB':42, 'EXPRESSIONLSB':43, 'EFFECT1LSB':44, + 'EFFECT2LSB':45, 'CTRL46':46, 'CTRL47':47, + 'GENERAL1LSB':48, 'GENERAL2LSB':49, 'GENERAL3LSB':50, + 'GENERAL4LSB':51, 'CTRL52':52, 'CTRL53':53, + 'CTRL54':54, 'CTRL55':55, 'CTRL56':56, + 'CTRL57':57, 'CTRL58':58, 'CTRL59':59, + 'CTRL60':60, 'CTRL61':61, 'CTRL62':62, + 'CTRL63':63, 'SUSTAIN':64, 'PORTAMENTO':65, + 'SOSTENUTO':66, 'SOFTPEDAL':67, 'LEGATO':68, + 'HOLD2':69, 'VARIATION':70, 'RESONANCE':71, + 'RELEASETIME':72, 'ATTACKTIME':73, 'BRIGHTNESS':74, + 'DECAYTIME':75, 'VIBRATORATE':76, 'VIBRATODEPTH':77, + 'VIBRATODELAY':78, 'CTRL79':79, 'GENERAL5':80, + 'GENERAL6':81, 'GENERAL7':82, 'GENERAL8':83, + 'PORTAMENTOCTRL':84, 'CTRL85':85, 'CTRL86':86, + 'CTRL87':87, 'CTRL88':88, 'CTRL89':89, + 'CTRL90':90, 'REVERB':91, 'TREMOLO':92, + 'CHORUS':93, 'DETUNE':94, 'PHASER':95, + 'DATAINC':96, 'DATADEC':97, 'NONREGLSB':98, + 'NONREGMSB':99, 'REGPARLSB':100, 'REGPARMSB':101, + 'CTRL102':102, 'CTRL103':103, 'CTRL104':104, + 'CTRL105':105, 'CTRL106':106, 'CTRL107':107, + 'CTRL108':108, 'CTRL109':109, 'CTRL110':110, + 'CTRL111':111, 'CTRL112':112, 'CTRL113':113, + 'CTRL114':114, 'CTRL115':115, 'CTRL116':116, + 'CTRL117':117, 'CTRL118':118, 'CTRL119':119, + 'ALLSOUNDSOFF':120, 'RESETALL':121, 'LOCALCTRL':122, + 'ALLNOTESOFF':123, 'OMNIOFF':124, 'OMNION':125, + 'POLYOFF':126, 'POLYON':127 } - ### 64-119 Single Precise Controllers - ### (7-bits, 128 values) - - 'Sustain', 'Portamento', 'Sostenuto', - 'SoftPedal', 'Legato', 'Hold2', 'Variation', - 'Resonance', 'ReleaseTime','AttackTime', 'Brightness', - 'DecayTime','VibratoRate','VibratoDepth', 'VibratoDelay', - 'Ctrl79','General5','General6','General7', - 'General8','PortamentoCtrl','Ctrl85','Ctrl86', - 'Ctrl87', 'Ctrl88', 'Ctrl89', 'Ctrl90', - 'Reverb', 'Tremolo', 'Chorus','Detune', - 'Phaser', 'DataInc','DataDec', - 'NonRegLSB', 'NonRegMSB', - 'RegParLSB', 'RegParMSB', - 'Ctrl102','Ctrl103','Ctrl104','Ctrl105', - 'Ctrl106','Ctrl107','Ctrl108','Ctrl109', - 'Ctrl110','Ctrl111','Ctrl112','Ctrl113', - 'Ctrl114','Ctrl115','Ctrl116','Ctrl117', - 'Ctrl118','Ctrl119', - - ### 120-127 Channel Mode Messages - - 'AllSoundsOff','ResetAll', - 'LocalCtrl','AllNotesOff', - 'OmniOff','OmniOn', 'PolyOff','PolyOn' ] - -upperCtrlNames = [name.upper() for name in ctrlNames] diff --git a/mma/MMA/notelen.py b/mma/MMA/notelen.py index 5649bfa..d58321d 100644 --- a/mma/MMA/notelen.py +++ b/mma/MMA/notelen.py @@ -23,6 +23,7 @@ Bob van der Poel """ + import gbl from MMA.common import * diff --git a/mma/MMA/options.py b/mma/MMA/options.py index f56b0d5..0ff9ac1 100644 --- a/mma/MMA/options.py +++ b/mma/MMA/options.py @@ -28,23 +28,22 @@ Bob van der Poel import getopt import sys -import gbl -from MMA.common import * import MMA.docs import MMA.parse -import MMA.alloc import MMA.chords -from MMA.macro import macros +import MMA.alloc +import MMA.volume +import gbl +from MMA.common import * +from MMA.macro import macros def opts(): """ Option parser. """ try: opts, args = getopt.gnu_getopt(sys.argv[1:], - "dpsS:ri:wneom:f:M:cgGvD:0", [] ) - - + "dpsS:ri:wneom:f:M:cgGvD:01PT:", [] ) except getopt.GetoptError: usage() @@ -110,24 +109,32 @@ def opts(): else: error("Only a '0' or '1' is permitted for the -M arg") + elif o == '-T': # set tracks to generate, mute all others + gbl.muteTracks = a.upper().split(',') + + elif o == '-D': if a == 'xl': - gbl.docs = 1 + gbl.createDocs = 1 elif a == 'xh': - gbl.docs = 2 + gbl.createDocs = 2 + + elif a == 'v': + gbl.createDocs = 3 elif a == 'k': - def pl(msg, lst): + def pl(msg, lst, adds): print msg, - for i in sorted(lst.keys()): + for i in sorted(lst.keys() + adds): print i, print "\n" - pl("Base track names:", MMA.alloc.trkClasses ) - pl("Commands:", MMA.parse.simpleFuncs) - pl("TrackCommands:", MMA.parse.trackFuncs) + pl("Base track names:", MMA.alloc.trkClasses, []) + pl("Commands:", MMA.parse.simpleFuncs, + ["BEGIN", "END",] ) + pl("TrackCommands:", MMA.parse.trackFuncs, []) print "Not complete ... subcommands, comments, chords..." sys.exit(0) @@ -138,14 +145,25 @@ def opts(): elif o == '-0': gbl.synctick = 1 + elif o == '-1': + gbl.endsync = 1 + + elif o == '-P': + gbl.playFile = 1 + else: usage() # unreachable?? - if args: - if gbl.infile: - usage("Only one input filename is permitted.") - gbl.infile = args.pop(0) + # we have processed all the args. Should just have a filename left + if len(args)>1: + usage("Only one input filename is permitted, %s given on command line." % len(args) ) + + if gbl.infile: + usage("Input filename already assigned ... should not happen.") + + if args: + gbl.infile = args[0] def usage(msg=''): """ Usage message. """ @@ -162,6 +180,7 @@ def usage(msg=''): " -Dk print list of MMA keywords", " -Dxl eXtract Latex doc blocks from file", " -Dxh eXtract HTML doc blocks from file", + " -Dv extract lots of info about the grooves/seqs in file", " -e show parsed/Expanded lines", " -f set output Filename", " -g update Groove dependency database", @@ -175,9 +194,11 @@ def usage(msg=''): " -r display Running progress", " -s display Sequence info during run", " -S Set macro 'var' to 'data'", + " -T Limit generation to specified tracks", " -v display Version number", " -w disable Warning messages", - " -0 create sync at start of all channel tracks" ] + " -0 create sync at start of all channel tracks", + " -1 create sync at end of all channel tracks" ] for a in txt: diff --git a/mma/MMA/parse.py b/mma/MMA/parse.py index e7756cb..bf7e90e 100644 --- a/mma/MMA/parse.py +++ b/mma/MMA/parse.py @@ -34,35 +34,39 @@ import random import copy import gbl +from MMA.common import * + import MMA.notelen import MMA.chords import MMA.file -import MMA.docs import MMA.midi import MMA.midiIn +import MMA.grooves +import MMA.docs import MMA.auto -from MMA.alloc import trackAlloc -from MMA.common import * import MMA.translate -from MMA.lyric import lyric import MMA.patSolo -from MMA.macro import macros import MMA.mdefine import MMA.volume -from MMA.pat import seqBump +import MMA.seqrnd +import MMA.patch + +import gbl + +from MMA.common import * +from MMA.lyric import lyric +from MMA.macro import macros +from MMA.alloc import trackAlloc lastChord = None # tracks last chord for "/ /" data lines. beginData = [] # Current data set by a BEGIN statement beginPoints = [] # since BEGINs can be nested, we need ptrs for backing out of BEGINs -seqRndWeight = [1] - -groovesList = None -groovesCount = 0 - gmagic = 9988 # magic name for groove saved with USE + + """ This table is passed to the track classes. It has an instance for each chord in the current bar. """ @@ -105,15 +109,14 @@ def parse(inpath): """ Process a mma input file. """ global beginData, lastChord - global groovesList, groovesCount - + gbl.inpath = inpath curline = None while 1: curline = inpath.read() - + if curline == None: MMA.docs.docDump() break @@ -130,18 +133,22 @@ def parse(inpath): encountered. The placement here is pretty deliberate. Variable expand comes - later so you can't macorize BEGIN ... I think this makes sense. + later so you can't macroize BEGIN ... I think this makes sense. + + The tests for 'begin', 'end' and the appending of the current + begin[] stuff have to be here, in this order. """ - key=l[0].upper() - if key == 'BEGIN': + action=l[0].upper() # 1st arg in line + + if action == 'BEGIN': if not l: error("Use: Begin STUFF") beginPoints.append(len(beginData)) beginData.extend(l[1:]) continue - if key == 'END': + if action == 'END': if len(l) > 1: error("No arguments permitted for END") if not beginData: @@ -151,9 +158,9 @@ def parse(inpath): if beginData: l = beginData + l + action = l[0].upper() - action = l[0].upper() - + if gbl.showExpand and action !='REPEAT': print l @@ -180,7 +187,7 @@ def parse(inpath): if len(l) < 2: error("Expecting argument after '%s'" % name) action = l[1].upper() - + if action in trackFuncs: trackFuncs[action](name, l[2:]) else: @@ -197,7 +204,7 @@ def parse(inpath): a line number on a line by itself it okay. """ - if l[0].isdigit(): + if action.isdigit(): # isdigit() matches '1', '1234' but not '1a'! l = l[1:] if not l: # ignore empty lines continue @@ -221,26 +228,28 @@ def parse(inpath): l = ' '.join(l) l = MMA.patSolo.extractSolo(l, rptcount) - """ Set lyrics from [stuff] in the current line or - stuff previously stored with LYRICS SET. + """ Set lyrics from [stuff] in the current line. + NOTE: lyric.extract() inserts previously created + data from LYRICS SET and inserts the chord names + if that flag is active. """ l, lyrics = lyric.extract(l, rptcount) + l = l.split() + """ At this point we have only chord info. A number of sanity checks are made: 1. Make sure there is some chord data, 2. Ensure the correct number of chords. """ - - l = l.split() - + if not l: error("Expecting music (chord) data. Even lines with\n" " lyrics or solos still need a chord") i = gbl.QperBar - len(l) - if i<0: + if i < 0: error("Too many chords in line. Max is %s, not %s" % (gbl.QperBar, len(l) ) ) if i: @@ -249,7 +258,7 @@ def parse(inpath): """ We now have a valid line. It'll look something like: - ['Cm', '/', 'z', 'F#'] + ['Cm', '/', 'z', 'F#'] or ['C', '/', '/', '/' ] For each bar we create a ctable structure. This is just a list of CTables, one for each beat division. @@ -275,19 +284,24 @@ def parse(inpath): # Create MIDI data for the bar - for rpt in range(rptcount): + for rpt in range(rptcount): # for each bar in the repeat count ( Cm * 3) + + """ Handle global (de)cresc by popping a new volume off stack. """ + if MMA.volume.futureVol: MMA.volume.volume = MMA.volume.futureVol.pop(0) + if MMA.volume.futureVol: + MMA.volume.nextVolume = MMA.volume.futureVol[0] + else: + MMA.volume.nextVolume = None - tmp = [] - for x, i in enumerate(seqRndWeight): - tmp.extend([x] * i) - if not len(tmp): - error("SeqRndWeight has generated an empty list") - randomSeq = random.choice(tmp) + + """ Set up for rnd seq. This may set the current seq point. If return + is >=0 then we're doing track rnd. + """ + + rsq, seqlist = MMA.seqrnd.setseq() - if gbl.seqRnd[0] == 1: - gbl.seqCount = randomSeq """ Process each track. It is important that the track classes are written so that the ctable passed to them IS NOT MODIFIED. @@ -296,16 +310,20 @@ def parse(inpath): """ for a in gbl.tnames.values(): - seqSave = gbl.seqCount - if a.name in gbl.seqRnd: - gbl.seqCount = randomSeq - + if rsq >= 0: + seqSave = gbl.seqCount + if a.name in seqlist: # for seqrnd with tracklist + gbl.seqCount = rsq + a.bar(ctable) ## process entire bar! - gbl.seqCount = seqSave + if rsq >= 0: + gbl.seqCount = seqSave # Adjust counters + gbl.totTime += float(gbl.QperBar) / gbl.tempo + gbl.barNum += 1 if gbl.barNum > gbl.maxBars: @@ -316,27 +334,7 @@ def parse(inpath): gbl.seqCount = (gbl.seqCount+1) % gbl.seqSize - """ Handle groove lists. If there is more than 1 entry - in the groove list, advance (circle). We don't have - to qualify grooves since they were verified when - this list was created. groovesList==None if there - is only one groove (or none). - """ - - if groovesList: - groovesCount += 1 - if groovesCount > len(groovesList)-1: - groovesCount = 0 - slot = groovesList[groovesCount] - - if slot != gbl.currentGroove: - grooveDo(slot) - - gbl.lastGroove = gbl.currentGroove - gbl.currentGroove = slot - - if gbl.debug: - print "Groove (list) setting restored from '%s'." % slot + MMA.grooves.nextGroove() # using groove list? Advance. # Enabled with the -r command line option @@ -519,7 +517,7 @@ def repeat(ln): while 1: if act in ('REPEATEND', 'ENDREPEAT'): if l: - l=macros.expand(l) + l = macros.expand(l) if len(l) == 2 and l[0].upper() == 'NOWARN': l=l[1:] warn=0 @@ -561,7 +559,7 @@ def repeat(ln): ending = 1 if l: - l=macros.expand(l) + l = macros.expand(l) if len(l) == 2 and l[0].upper() == 'NOWARN': warn=0 l=l[1:] @@ -701,6 +699,9 @@ def tempo(ln): print "Set future Tempo to %s over %s beats" % \ ( int(tempo), numbeats) + if gbl.tempo <=0: + error("Tempo setting must be greater than 0.") + def beatAdjust(ln): """ Delete or insert some beats into the sequence. @@ -717,6 +718,8 @@ def beatAdjust(ln): gbl.tickOffset += int(adj * gbl.BperQ) + gbl.totTime += adj / gbl.tempo # adjust total time + if gbl.debug: print "BeatAdjust: inserted %s at bar %s." % (adj, gbl.barNum + 1) @@ -803,205 +806,7 @@ def fermata(ln): % (start, end) -####################################### -# Groove stuff - -def grooveDefine(ln): - """ Define a groove. - - Current settings are assigned to a groove name. - """ - - if not len(ln): - error("Use: DefGroove Name") - - slot=ln[0].upper() - - # Slot names can't contain a '/' (reserved) or be an integer (used in groove select). - - if '/' in slot: - error("The '/' is not permitted in a groove name") - - if slot.isdigit(): - error("Invalid slot name '%s'. Cannot be only digits" % slot) - - grooveDefineDo(slot) - - if gbl.debug: - print "Groove settings saved to '%s'." % slot - - if gbl.makeGrvDefs: - MMA.auto.updateGrooveList(slot) - - if len(ln) > 1: - MMA.docs.docDefine(ln) - - -def grooveDefineDo(slot): - - for n in gbl.tnames.values(): - n.saveGroove(slot) - - gbl.settingsGroove[slot] = { - 'SEQSIZE': gbl.seqSize, - 'SEQRNDWT': seqRndWeight[:], - 'QPERBAR': gbl.QperBar, - 'SEQRND': gbl.seqRnd[:], - 'TIMESIG': MMA.midi.timeSig.get(), - '81': MMA.notelen.noteLenTable['81'], - '82': MMA.notelen.noteLenTable['82'], - 'SWINGMODE': gbl.swingMode , - 'SWINGSKEW': gbl.swingSkew, - 'VRATIO': (MMA.volume.vTRatio, MMA.volume.vMRatio)} - - -def groove(ln): - """ Select a previously defined groove. """ - - global groovesList, groovesCount - - if not ln: - error("Groove: needs agrument(s)") - - tmpList =[] - - if ln[0].isdigit(): - wh=stoi(ln[0]) - if wh<1: - error("Groove selection must be > 0, not '%s'" % wh) - ln=ln[1:] - else: - wh = None - - for slot in ln: - slot = slot.upper() - if slot == "/": - if len(tmpList): - slot=tmpList[-1] - else: - error("A previous groove name is needed before a '/'") - - if not slot in gbl.settingsGroove: - - if gbl.debug: - print "Groove '%s' not defined. Trying auto-load from libraries" \ - % slot - - l=MMA.auto.loadGrooveDir(slot) # name of the lib file with groove - - if l: - if gbl.debug: - print "Attempting to load groove '%s' from '%s'." \ - % (slot, l) - - usefile([os.path.join(gbl.autoLib, l)]) - - if not slot in gbl.settingsGroove: - error("Groove '%s' not found. Have libraries changed " - "since last 'mma -g' run?" % slot) - - else: - error("Groove '%s' could not be found in memory or library files" % slot ) - - tmpList.append(slot) - - if not len(tmpList): - error("Use: Groove [selection] Name [...]") - - """ If the first arg to list was an int() (ie: 3 groove1 groove2 grooveFoo) - we select from the list. After the selection, we reset the list to be - just the selected entry. This was, if there are multiple groove names without - a leading int() we process the list as groove list changing with each bar. - """ - - if wh: - wh = (wh-1) % len(tmpList) - tmpList=tmpList[wh:wh+1] - - slot=tmpList[0] - grooveDo(slot) - - groovesCount = 0 - if len(tmpList)==1: - groovesList=None - else: - groovesList=tmpList - - gbl.lastGroove = gbl.currentGroove - gbl.currentGroove = slot - if gbl.lastGroove == '': - gbl.lastGroove = slot - - if gbl.debug: - print "Groove settings restored from '%s'." % slot - -def grooveDo(slot): - """ This is separate from groove() so we can call it from - usefile() with a qualified name. """ - - global seqRndWeight - - oldSeqSize = gbl.seqSize - - g=gbl.settingsGroove[slot] - - gbl.seqSize = g['SEQSIZE'] - seqRndWeight = g['SEQRNDWT'] - gbl.QperBar = g['QPERBAR'] - gbl.seqRnd = g['SEQRND'] - MMA.midi.timeSig.set( *g['TIMESIG']) # passing tuple as 2 args. - MMA.notelen.noteLenTable['81'] = g['81'] - MMA.notelen.noteLenTable['82'] = g['82'] - gbl.swingMode = g['SWINGMODE'] - gbl.swingSkew = g['SWINGSKEW'] - MMA.volume.vTRatio, MMA.volume.vMRatio = g['VRATIO'] - - for n in gbl.tnames.values(): - n.restoreGroove(slot) - - """ This is important! Tracks NOT overwritten by saved grooves way - have the wrong sequence length. I don't see any easy way to hit - just the unchanged/unrestored tracks so we do them all. - Only done if a change in seqsize ... doesn't take long to be safe. - """ - - if oldSeqSize != gbl.seqSize: - for a in gbl.tnames.values(): - a.setSeqSize() - - seqRndWeight = MMA.pat.seqBump(seqRndWeight) - - gbl.seqCount = 0 - -def grooveClear(ln): - """ Delete all previously loaded grooves from memory.""" - - global groovesList, groovesCount - - if ln: - error("GrooveClear does not have any arguments.") - - groovesList = {} - groovesCount = 0 - - try: - a= gbl.settingsGroove[gmagic] - except: - a=None - - gbl.settingsGroove={} - - if a: - gbl.settingsGroove[gmagic]=a - - gbl.lastGroove = '' - gbl.currentGroove = '' - - - if gbl.debug: - print "All grooves deleted." - ####################################### # File and I/O @@ -1047,10 +852,9 @@ def usefile(ln): """ slot = gmagic - grooveDefineDo(slot) + MMA.grooves.grooveDefineDo(slot) parseFile(fn) - grooveDo(slot) - + MMA.grooves.grooveDo(slot) def mmastart(ln): if not ln: @@ -1099,9 +903,9 @@ def setAutoPath(ln): # To avoid conflicts, delete all existing grooves (current seq not effected) - gbl.settingsGroove = {} - gbl.lastGroove = '' - gbl.currentGroove = '' + MMA.grooves.glist = {} + MMA.grooves.lastGroove = '' + MMA.grooves.currentGroove = '' if gbl.debug: print "AutoLibPath set to", f @@ -1135,6 +939,20 @@ def setOutPath(ln): else: gbl.outPath = os.path.expanduser(ln[0]) + if gbl.debug: + print "OutPath set to", gbl.outPath + + +def setMidiPlayer(ln): + """ Set the MIDI file player (used with -P). """ + + if len(ln) != 1: + error("Use: MidiPlayer ") + + gbl.midiPlayer = ln[0] + + if gbl.debug: + print "MidiPlayer set to", gbl.MidiPlayer ####################################### @@ -1143,13 +961,14 @@ def setOutPath(ln): def seqsize(ln): """ Set the length of sequences. """ - global seqRndWeight - if len(ln) !=1: error("Usage 'SeqSize N'") n = stoi(ln[0], "Argument for SeqSize must be integer") + if n < 1: + error("SeqSize: sequence size must be 1 or greater, not '%s'." % n) + # Setting the sequence size always resets the seq point gbl.seqCount = 0 @@ -1164,7 +983,7 @@ def seqsize(ln): for a in gbl.tnames.values(): a.setSeqSize() - seqRndWeight = seqBump(seqRndWeight) + MMA.seqrnd.seqRndWeight = seqBump(MMA.seqrnd.seqRndWeight) if gbl.debug: print "Set SeqSize to ", n @@ -1193,9 +1012,9 @@ def seq(ln): gbl.seqCount = s-1 - if gbl.seqRnd[0] == 1: + if MMA.seqrnd.seqRnd[0] == 1: warning("SeqRnd has been disabled by a Seq command") - seqRnd = [0] + MMA.seqrnd.seqRnd = [0] def seqClear(ln): @@ -1209,67 +1028,9 @@ def seqClear(ln): n.clearSequence() MMA.volume.futureVol = [] - setSeqRndWeight(['1']) + MMA.seqrnd.setSeqRndWeight(['1']) -def setSeqRnd(ln): - """ Set random order for all tracks. """ - - emsg = "use [ON, OFF | TrackList ]" - if not ln: - error("SeqRnd:" + emsg) - - a=ln[0].upper() - - if a in ("ON", "1") and len(ln) == 1: - gbl.seqRnd = [1] - - elif a in ("OFF", "0") and len(ln) == 1: - gbl.seqRnd = [0] - - else: - gbl.seqRnd=[2] - for a in ln: - a = a.upper() - if not a in gbl.tnames: - error("SeqRnd: Track '%s' does not exist, %s" % (a, emsg)) - if a in gbl.seqRnd: - error("SeqRnd: Duplicate track '%s' specified, %s" % (a, emsg)) - gbl.seqRnd.append(a) - - if gbl.debug: - print "SeqRnd:", - if gbl.seqRnd[0] == 2: - for a in gbl.seqRnd[1:]: - print a, - print - else: - if gbl.seqRnd[0] == 1: - print "On" - else: - print "Off" - - -def setSeqRndWeight(ln): - """ Set global rnd weight. """ - - global seqRndWeight - - if not ln: - error("Use: RndWeight ") - - tmp = [] - for n in ln: - n = stoi(n) - if n < 0: error("RndWeight: Values must be 0 or greater") - tmp.append(n) - - seqRndWeight = seqBump(tmp) - - if gbl.debug: - print "RndWeight: ", - printList(seqRndWeight) - def restart(ln): """ Restart all tracks to almost-default condidions. """ @@ -1448,6 +1209,20 @@ def setTimeSig(ln): ####################################### # Misc +def synchronize(ln): + """ Set synchronization in the MIDI. A file mode for -0 and -1. """ + + if not ln: + error("SYNCHRONIZE: requires args END and/or START.") + + for a in ln: + if a.upper() == 'END': + gbl.endsync = 1 + elif a.upper() == 'START': + gbl.synctick = 1 + else: + error("SYNCHRONIZE: expecting END or START") + def rndseed(ln): """ Reseed the random number generator. """ @@ -1486,7 +1261,7 @@ def lnPrint(ln): def printActive(ln): """ Print a list of the active tracks. """ - print "Active tracks, groove:", gbl.currentGroove, ' '.join(ln) + print "Active tracks, groove:", MMA.grooves.currentGroove, ' '.join(ln) for a in sorted(gbl.tnames.keys()): f=gbl.tnames[a] @@ -1700,31 +1475,6 @@ def trackRestart(name, ln): gbl.tnames[name].restart() - -def trackGroove(name, ln): - """ Select a previously defined groove for a single track. """ - - if len(ln) != 1: - error("Use: %s Groove Name" % name) - - - slot = ln[0].upper() - - if not slot in gbl.settingsGroove: - error("Groove '%s' not defined" % slot) - - g=gbl.tnames[name] - g.restoreGroove(slot) - - if g.sequence == [None] * len(g.sequence): - warning("'%s' Track Groove has no sequence. Track name error?" % name) - - g.setSeqSize() - - if gbl.debug: - print "%s Groove settings restored from '%s'." % (name, slot) - - def trackRiff(name, ln): """ Set a riff for a track. """ @@ -1776,6 +1526,8 @@ def trackRvolume(name, ln): gbl.tnames[name].setRVolume(ln) +def trackSwell(name, ln): + gbl.tnames[name].setSwell(ln) def trackCresc(name, ln): gbl.tnames[name].setCresc(1, ln) @@ -2125,11 +1877,10 @@ def trackVoice(name, ln): def trackPan(name, ln): """ Set the Midi Pan value for a track.""" - if len(ln) != 1: - error("Use: %s PAN NN" % name) - - gbl.tnames[name].setPan(ln[0]) - + if len(ln)==1 or len(ln)==3: + gbl.tnames[name].setPan(ln) + else: + error("Use %s MidiPAN [Value] OR [Initvalue DestValue Beats]." % name) def trackOff(name, ln): """ Turn a track off """ @@ -2253,19 +2004,22 @@ def trackUnify(name, ln): simpleFuncs={ 'ADJUSTVOLUME': MMA.volume.adjvolume, + 'ALLGROOVES': MMA.grooves.allgrooves, 'ALLTRACKS': allTracks, 'AUTHOR': MMA.docs.docAuthor, 'AUTOSOLOTRACKS': MMA.patSolo.setAutoSolo, 'BEATADJUST': beatAdjust, 'CHANNELPREF': setChPref, + 'CHORDADJUST': MMA.chords.chordAdjust, 'COMMENT': comment, 'CRESC': MMA.volume.setCresc, 'CUT': cut, 'DEBUG': setDebug, 'DEC': macros.vardec, 'DECRESC': MMA.volume.setDecresc, + 'DEFALIAS': MMA.grooves.grooveAlias, 'DEFCHORD': MMA.chords.defChord, - 'DEFGROOVE': grooveDefine, + 'DEFGROOVE': MMA.grooves.grooveDefine, 'DELETE': deleteTrks, 'DOC': MMA.docs.docNote, 'DOCVAR': MMA.docs.docVars, @@ -2277,8 +2031,8 @@ simpleFuncs={ 'EOF': eof, 'FERMATA': fermata, 'GOTO': goto, - 'GROOVE': groove, - 'GROOVECLEAR': grooveClear, + 'GROOVE': MMA.grooves.groove, + 'GROOVECLEAR': MMA.grooves.grooveClear, 'IF': macros.varIF, 'IFEND': ifend, 'INC': macros.varinc, @@ -2297,7 +2051,7 @@ simpleFuncs={ 'MSET': macros.msetvar, 'MSETEND': endmset, 'NEWSET': macros.newsetvar, - 'CHORDADJUST': MMA.chords.chordAdjust, + 'PATCH': MMA.patch.patch, 'PRINT': lnPrint, 'PRINTACTIVE': printActive, 'PRINTCHORD': MMA.chords.printChord, @@ -2309,17 +2063,20 @@ simpleFuncs={ 'RNDSET': macros.rndvar, 'SEQ': seq, 'SEQCLEAR': seqClear, - 'SEQRND': setSeqRnd, - 'SEQRNDWEIGHT': setSeqRndWeight, + 'SEQRND': MMA.seqrnd.setSeqRnd, + 'SEQRNDWEIGHT': MMA.seqrnd.setSeqRndWeight, 'SEQSIZE': seqsize, 'SET': macros.setvar, 'SETAUTOLIBPATH': setAutoPath, 'SETINCPATH': setIncPath, 'SETLIBPATH': setLibPath, + 'SETMIDIPLAYER': setMidiPlayer, 'SETOUTPATH': setOutPath, 'SHOWVARS': macros.showvars, 'STACKVALUE': macros.stackValue, + 'SWELL': MMA.volume.setSwell, 'SWINGMODE': MMA.notelen.swingMode, + 'SYNCHRONIZE': synchronize, 'TEMPO': tempo, 'TIME': setTime, 'TIMESIG': setTimeSig, @@ -2350,7 +2107,7 @@ trackFuncs={ 'DRUMTYPE': trackDrumType, 'DUPROOT': trackDupRoot, 'FORCEOUT': trackForceOut, - 'GROOVE': trackGroove, + 'GROOVE': MMA.grooves.trackGroove, 'HARMONY': trackHarmony, 'HARMONYONLY': trackHarmonyOnly, 'HARMONYVOLUME': trackHarmonyVolume, @@ -2379,6 +2136,7 @@ trackFuncs={ 'SEQRND': trackSeqRnd, 'SEQUENCE': trackSequence, 'SEQRNDWEIGHT': trackSeqRndWeight, + 'SWELL': trackSwell, 'NOTESPAN': trackSpan, 'STRUM': trackStrum, 'TONE': trackTone, diff --git a/mma/MMA/pat.py b/mma/MMA/pat.py index 3a6791f..40768ee 100644 --- a/mma/MMA/pat.py +++ b/mma/MMA/pat.py @@ -28,34 +28,30 @@ import copy import random import math -import gbl -from MMA.common import * -from MMA.notelen import getNoteLen +import MMA.notelen import MMA.translate import MMA.midi import MMA.midiC -import MMA.alloc import MMA.mdefine import MMA.volume +import MMA.alloc +import MMA.seqrnd + +import gbl +from MMA.common import * + class Voicing: def __init__(self): self.mode = None - self.range = 12 - self.center = 4 - self.random = 0 - self.percent = 0 - self.bcount = 0 - self.dir = 0 + self.range = 12 + self.center = 4 + self.random = 0 + self.percent = 0 + self.bcount = 0 + self.dir = 0 -def seqBump(l): - """ Expand/contract an existing sequence list to the current seqSize.""" - - while len(l) < gbl.seqSize: - l += l - return l[:gbl.seqSize] - pats = {} # Storage for all pattern defines @@ -77,14 +73,14 @@ class PC: def __init__(self, nm): - self.inited = 0 - self.name = nm - self.channel = 0 - self.grooves = {} - self.saveVols = {} - self.ssvoice = -1 # Track the voice set for the track - self.smidiVoice = () # Track MIDIVoice cmds to avoid dups - self.midiSent = 0 # if set, MIDICLEAR invoked. + self.inited = 0 + self.name = nm + self.channel = 0 + self.grooves = {} + self.saveVols = {} + self.ssvoice = -1 # Track the voice set for the track + self.smidiVoice = () # Track MIDIVoice cmds to avoid dups + self.midiSent = 0 # if set, MIDICLEAR invoked. """ Midi commands like Pan, Glis, etc. are stacked until musical @@ -100,9 +96,13 @@ class PC: self.clearSequence() + self.nextVolume = None self.inited = 1 + if gbl.muteTracks and nm not in gbl.muteTracks: + self.disable = 1 + ########################################## ## These are called from process() to set options @@ -110,7 +110,7 @@ class PC: def setCompress(self, ln): """ set/unset the compress flag. """ - ln=self.lnExpand(ln, 'Compress') + ln = lnExpand(ln, '%s Compress' % self.name) tmp = [] @@ -140,7 +140,7 @@ class PC: def setRange(self, ln): """ set range. """ - ln=self.lnExpand(ln, 'Range') + ln = lnExpand(ln, '%s Range' % self.name) tmp = [] @@ -322,9 +322,9 @@ class PC: return """ Get name of track to share with and make sure it exists. - If not, trackAlloc() will create the track. Do some - sanity checks and ensure that the shared track has - a channel assigned. + If not, trackAlloc() will create the track. Do some + sanity checks and ensure that the shared track has + a channel assigned. """ sc = ln.upper() @@ -357,7 +357,6 @@ class PC: self.voice = gbl.tnames[sc].voice[:] self.octave = gbl.tnames[sc].octave[:] - # Update the avail. lists gbl.midiAssigns[self.channel].append(self.name) @@ -384,17 +383,56 @@ class PC: print "Set %s track name for MIDI to %s" % (self.name, n) def setPan(self, ln): - """ Set MIDI Pan for this track. """ + """ Set MIDI Pan for this track. Parse sends 1 or 3 args. """ + + if len(ln)==3: + beats = stof(ln[2]) + if beats < 1: + error("Beat value must be positive count, not '%s'." % beats) + initPan = stoi(ln[0], "Expecting integer value 0..127") + newPan = stoi(ln[1], "Expecting integer value 0..127") + else: + beats = 0 + initPan = 0 + newPan = stoi(ln[0], "Expecting integer value 0..127") - v = stoi(ln[0], "Expecting integer value 0..127") + ticks = beats * gbl.BperQ # convert beats to midi ticks - if v<0 or v>127: - error("PAN value must be 0..127") + if initPan<0 or initPan>127: + error("Initial MidiPAN value must be 0..127") - self.midiPending.append( ("PAN", gbl.tickOffset, v)) + if newPan<0 or newPan>127: + error("Final MidiPAN value must be 0..127") + if newPan0: + step = ticks/span + else: + beats=0 + + if beats: + v=initPan + off=gbl.tickOffset + for a in range(span+1): + self.midiPending.append( ("PAN", int(off), v)) + off+=step + v+=changer + + else: + self.midiPending.append( ("PAN", gbl.tickOffset, newPan)) + if gbl.debug: - print "Set %s MIDIPan to %s" % (self.name, v) + if beats: + print "Set %s MIDIPan from %s to %s over %s beats." % \ + (self.name, initPan, newPan, beats) + else: + print "Set %s MIDIPan to %s" % (self.name, newPan) @@ -428,8 +466,12 @@ class PC: def setOn(self): """ Turn ON track. """ - self.disable = 0 - self.ssvoice = -1 + if gbl.muteTracks and self.name not in gbl.muteTracks: + warning("Attempt to enable muted track %s ignored." % self.name) + + else: + self.disable = 0 + self.ssvoice = -1 if gbl.debug: print "%s Enabled" % self.name @@ -448,7 +490,7 @@ class PC: def setRVolume(self, ln): """ Set the volume randomizer for a track. """ - ln = self.lnExpand(ln, 'RVolume') + ln = lnExpand(ln, '%s RVolume' % self.name) tmp = [] for n in ln: @@ -466,7 +508,7 @@ class PC: self.rVolume = seqBump(tmp) if gbl.debug: - print "Set %s Rvolume to:" % self.name, + print "Set %s Rvolume to:" % self.name, for n in self.rVolume: print int(n * 100), print @@ -475,7 +517,7 @@ class PC: def setRSkip(self, ln): """ Set the note random skip factor for a track. """ - ln = self.lnExpand(ln, 'RSkip') + ln = lnExpand(ln, '%s RSkip' % self.name) tmp = [] for n in ln: @@ -498,7 +540,7 @@ class PC: def setRTime(self, ln): """ Set the timing randomizer for a track. """ - ln=self.lnExpand(ln, 'RTime') + ln = lnExpand(ln, '%s RTime' % self.name) tmp = [] for n in ln: @@ -538,7 +580,7 @@ class PC: def setRndWeight(self, ln): """ Set weighting factors for seqrnd. """ - ln = self.lnExpand(ln, "SeqRndWeight") + ln = lnExpand(ln, "%s SeqRndWeight" % self.name) tmp = [] for n in ln: @@ -556,7 +598,7 @@ class PC: def setDirection(self, ln): """ Set scale direction. """ - ln = self.lnExpand(ln, "Direction") + ln = lnExpand(ln, "%s Direction" % self.name) tmp = [] for n in ln: @@ -594,7 +636,7 @@ class PC: by one rotation for each value. """ - ln=self.lnExpand(ln, "Invert") + ln = lnExpand(ln, "%s Invert" % self.name) vwarn = 0 tmp = [] @@ -623,7 +665,7 @@ class PC: def setOctave(self, ln): """ Set the octave for a track. """ - ln=self.lnExpand(ln, 'Octave') + ln = lnExpand(ln, '%s Octave' % self.name) tmp = [] for n in ln: @@ -662,7 +704,7 @@ class PC: def setHarmony(self, ln): """ Set the harmony. """ - ln=self.lnExpand(ln, 'Harmony') + ln = lnExpand(ln, '%s Harmony' % self.name) tmp = [] for n in ln: @@ -686,7 +728,7 @@ class PC: """ Set the harmony only. """ - ln=self.lnExpand(ln, 'HarmonyOnly') + ln = lnExpand(ln, '%s HarmonyOnly' % self.name) tmp = [] for n in ln: @@ -710,7 +752,7 @@ class PC: def setHarmonyVolume(self, ln): """ Set harmony volume adjustment. """ - ln=self.lnExpand(ln, 'HarmonyOnly') + ln = lnExpand(ln, '%s HarmonyOnly' % self.name) tmp = [] for n in ln: @@ -766,24 +808,46 @@ class PC: def setVoice(self, ln): """ Set the voice for a track. - Note, this just sets flags, the voice is set in bar(). - ln[] is not nesc. set to the correct length. + Note, this just sets flags, the voice is set in bar(). + ln[] is not nesc. set to the correct length. + + the voice can be gm-string, user-def-string, or value. + A value can be xx.yy.vv, yy.vv or vv """ - ln=self.lnExpand(ln, 'Voice') + ln = lnExpand(ln, '%s Voice' % self.name) tmp = [] - + for n in ln: n = MMA.translate.vtable.get(n) - a=MMA.midiC.instToValue(n) + voc=MMA.midiC.instToValue(n) - if a < 0: - a=stoi(n, "Expecting a valid voice name or value, " - "not '%s'" % n) - if a <0 or a > 127: - error("Voice must be 0..127") - tmp.append( a ) + if voc < 0 and n[0].isalpha(): + error("Voice '%s' is not defined." % n) + if voc < 0: # not a valid name, assume vv.msb(ctrl0).lsb(ctrl32) value + nn = n.split('.') + if len(nn) > 3 or len(nn) < 1: + error("Expecting a voice value Prog.MSB.LSB, not '%s'" % n) + voc = 0 + if len(nn) > 2: + i = stoi(nn[2]) + if i<0 or i>127: + error("LSB must be 0..127, not '%s'" % i) + voc = i << 16 + if len(nn) > 1: + i = stoi(nn[1]) + if i<0 or i>127: + error("MSB must be 0..127, not '%s'" % i) + voc += i << 8 + + i = stoi(nn[0]) + if i<0 or i>127: + error("Program must be 0..127, not '%s'" % i) + voc += i + + tmp.append( voc ) + self.voice = seqBump(tmp) if self.channel and len(gbl.midiAssigns[self.channel])>1: @@ -794,11 +858,10 @@ class PC: warning("Track %s is shared with %s,\n" " changing voice may create conflict" % (a,self.name)) - if gbl.debug: print "Set %s Voice to:" % self.name, - for a in self.voice: - print MMA.midiC.valueToInst(a), + for i in self.voice: + print MMA.midiC.valueToInst(i), print @@ -828,7 +891,12 @@ class PC: gbl.mtrks[self.channel].addCtl(gbl.tickOffset, i[1]) self.midiSent = 0 + + def doChannelReset(self): + """ Reset the midi voicing to 'sane'. Called when track ended. """ + if self.ssvoice > 127: + gbl.mtrks[self.channel].addProgChange( gbl.tickOffset, 0, self.ssvoice) def setMidiSeq(self, ln): """ Set a midi sequence for a track. @@ -842,7 +910,7 @@ class PC: """ lnExpand() works here! The midi data has been converted to pseudo-macros already in the parser. """ - ln=self.lnExpand(ln, "MidiSeq") + ln = lnExpand(ln, "%s MidiSeq" % self.name) seq = [] for a in ln: @@ -875,7 +943,7 @@ class PC: """ lnExpand() works here! The midi data has been converted to pseudo-macros already in the parser. """ - ln = self.lnExpand(ln, 'MIDIVoice') + ln = lnExpand(ln, '%s MIDIVoice' % self.name) seq = [] for a in ln: @@ -916,7 +984,7 @@ class PC: ln[] not nesc. correct length """ - ln=self.lnExpand(ln, 'Volume') + ln = lnExpand(ln, '%s Volume' % self.name) tmp = [None] * len(ln) for i,n in enumerate(ln): @@ -944,6 +1012,9 @@ class PC: self.setVolume([ln[0]]) ln=ln[1:] + if len(ln) != 2: + error("Cresc expecting 2 or 3 args.") + vol = self.volume[0] if self.volume.count(vol) != len(self.volume): @@ -951,7 +1022,53 @@ class PC: self.futureVols = MMA.volume.fvolume(dir, vol, ln) + if gbl.debug: + print "Set %s Cresc to:" % self.name, + for a in self.futureVols: + print int(a*100), + print + + def setSwell(self, ln): + """ Set a swell (cresc<>decresc) for track. """ + + if len(ln) == 3: # 3 args, 1st is intial setting + self.setVolume([ln[0]]) + ln=ln[1:] + + if len(ln) != 2: + error("%s Swell expecting 2 or 3 args." % self.name) + + if self.volume.count(self.volume[0]) != len(self.volume): + warning("%s Swell being used with track with variable sequence volumes." \ + % self.name) + + count = stoi(ln[1]) + if count < 2: + error("%s Swell bar count must be 2 or greater." % self.name) + + count += 1 + c = int(count/2) + if count % 2: # even number of bars (we bumped count) + offset = 1 + c+=1 + else: # odd number + offset = 0 + c=str(c) + + self.futureVols = MMA.volume.fvolume(0 ,self.volume[0], + [ ln[0], c ] ) + + self.futureVols.extend(MMA.volume.fvolume(0, self.futureVols[-1], + [str(int(self.volume[0]*100)), c ] )[offset:] ) + + if gbl.debug: + print "Set %s Swell to:" % self.name, + for a in self.futureVols: + print int(a*100), + print + + def setMallet(self, ln): """ Mallet (repeat) settngs. """ @@ -962,7 +1079,7 @@ class PC: error("Each Mallet option must contain a '=', not '%s'" % l) if mode == 'RATE': - self.mallet = getNoteLen(val) + self.mallet = MMA.notelen.getNoteLen(val) elif mode == 'DECAY': val = stof(val, "Mallet Decay must be a value, not '%s'" % val) @@ -983,45 +1100,44 @@ class PC: tmp = [] - """ We can do "Track Accent 1 20 3 -10" or "Track Accent {1 20 3 -10}" - or even something like "Track Accent {1 20} / {/} {3 20}" - Note that the "/" can or not have {}s. + """ 2 ways to call this: + + Track Accent 1 20 3 -10 -- fix up by adding {} around entire option list, + Track Accent {1 20 3 -10} -- okay + Track Accent {1 20} / {/} {3 20} -- okay. + + At this point ln is a string. We extract each set of {}s and build a + new ln[]. + + Note that the "/" can or not have {}s. """ ln = ' '.join(ln) if not ln.startswith('{'): ln='{' + ln +"}" - # Convert string to list. One entry per seq. - l=[] - while ln: - if not ln.startswith("{"): - if ln[0]=='/': - l.append('/') - ln=ln[1:].strip() - else: - error("Unknown value in %s Accent: %s" % (self.name, ln[0])) + while ln: + if ln[0] == "/": # / not delimited with {} + ln = "{/}" + ln[1:] + + a,b = pextract(ln, "{", "}", 1) + ln=a.strip() + if len(b)==1 and b[0]=='/': # convert ['/'] to '/' for lnExpand() + l.append('/') else: - a,b = pextract(ln, "{", "}", 1) - ln=a.strip() - if len(b)==1 and b[0]=='/': - l.append('/') - else: - l.append(b[0].split()) - - - ln=self.lnExpand(l, 'Accent') - + l.append(b[0].split()) + + ln = lnExpand(l, '%s Accent' % self.name) for l in ln: tt=[] - if len(l)/2*2 != len(l): + if len(l)/2*2 != len(l): error("Use: %s Accent Beat Percentage [...]" % self.name) for b, v in zip(l[::2], l[1::2]): b=self.setBarOffset( b ) - v=stoi(v, "Bbeat offset must be a value, not '%s'" % v) + v=stoi(v, "Beat offset must be a value, not '%s'" % v) if v < -100 or v > 100: error("Velocity adjustment (as percentage) must " "be -100..100, not '%s'" % v) @@ -1044,7 +1160,7 @@ class PC: def setArtic(self, ln): """ Set the note articuation value. """ - ln=self.lnExpand(ln, 'Articulate') + ln = lnExpand(ln, '%s Articulate' % self.name) tmp = [] for n in ln: @@ -1067,7 +1183,7 @@ class PC: def setUnify(self, ln): """ Set unify. """ - ln = self.lnExpand(ln, "Unify") + ln = lnExpand(ln, "%s Unify" % self.name) tmp = [] for n in ln: @@ -1086,29 +1202,6 @@ class PC: printList(self.unify) - - def lnExpand(self, ln, cmd): - """ Validate and expand a list passed to a set command. """ - - if len(ln) > gbl.seqSize: - warning("%s list truncated to %s patterns" % (self.name, gbl.seqSize) ) - ln = ln[:gbl.seqSize] - - last = None - - for i,n in enumerate(ln): - if n == '/': - if not last: - error ("You cannot use a '/' as the first item " - "in a %s list" % cmd) - else: - ln[i] = last - else: - last = n - - return ln - - def copySettings(self, cp): """ Copy the voicing from a 2nd voice to the current one. """ @@ -1174,25 +1267,25 @@ class PC: 'HARMONYO': self.harmonyOnly[:], 'HARMONYV': self.harmonyVolume[:], 'INVERT': self.invert[:], - 'LIMIT': self.chordLimit, - 'RANGE': self.chordRange[:], + 'LIMIT': self.chordLimit, + 'RANGE': self.chordRange[:], 'OCTAVE': self.octave[:], - 'RSKIP': self.rSkip[:], - 'RTIME': self.rTime[:], - 'RVOLUME': self.rVolume[:], - 'SCALE': self.scaleType[:], - 'SEQ': self.sequence[:], + 'RSKIP': self.rSkip[:], + 'RTIME': self.rTime[:], + 'RVOLUME': self.rVolume[:], + 'SCALE': self.scaleType[:], + 'SEQ': self.sequence[:], 'SEQRND': self.seqRnd, - 'SEQRNDWT': self.seqRndWeight[:], - 'STRUM': self.strum[:], - 'VOICE': self.voice[:], + 'SEQRNDWT': self.seqRndWeight[:], + 'STRUM': self.strum[:], + 'VOICE': self.voice[:], 'VOLUME': self.volume[:], - 'UNIFY': self.unify[:], - 'MIDISEQ': self.midiSeq[:], - 'MIDIVOICE':self.midiVoice[:], - 'MIDICLEAR':self.midiClear[:], - 'SPAN': (self.spanStart, self.spanEnd), - 'MALLET': (self.mallet, self.malletDecay), + 'UNIFY': self.unify[:], + 'MIDISEQ': self.midiSeq[:], + 'MIDIVOICE': self.midiVoice[:], + 'MIDICLEAR': self.midiClear[:], + 'SPAN': (self.spanStart, self.spanEnd), + 'MALLET': (self.mallet, self.malletDecay), } @@ -1291,7 +1384,7 @@ class PC: """ - ln=self.lnExpand(ln, 'Sequence') + ln = lnExpand(ln, '%s Sequence' % self.name) tmp = [None] * len(ln) for i, n in enumerate(ln): @@ -1555,9 +1648,9 @@ class PC: plist.sort(patsort) if gbl.swingMode: - len8 = getNoteLen('8') - len81 = getNoteLen('81') - len82 = getNoteLen('82') + len8 = MMA.notelen.getNoteLen('8') + len81 = MMA.notelen.getNoteLen('81') + len82 = MMA.notelen.getNoteLen('82') onBeats = [ x * gbl.BperQ for x in range(gbl.QperBar)] offBeats = [ (x * gbl.BperQ + len8) for x in range(gbl.QperBar)] @@ -1574,19 +1667,26 @@ class PC: p.offset = onBeats[i] + len81 return plist - - + + def printPattern(self, pat): """ Print a pattern. Used by debugging code.""" - s=[] + print self.formatPattern(pat) + + def formatPattern(self, pat): + pp=[] + if not pat: + return ' z ' + for p in pat: - s.append(" %2.2f %2.0f" % (1+(p.offset/float(gbl.BperQ)), + s=[] + s.append("%.2f %.0f" % (1+(p.offset/float(gbl.BperQ)), p.duration)) if self.vtype == 'CHORD': for a in p.vol: - s.append( " %2.0f" % a) + s.append( "%.0f" % a) elif self.vtype == 'BASS': f=str(p.noteoffset+1) @@ -1601,21 +1701,20 @@ class PC: elif p.addoctave < 0: f+="-" * (p.addoctave/-12) - s.append( " %s %2.0f" % (f, p.vol ) ) + s.append( "%s %.0f" % (f, p.vol ) ) elif self.vtype == 'ARPEGGIO': - s.append( " %2.0f " % p.vol ) + s.append( "%.0f " % p.vol ) elif self.vtype == 'DRUM': - s.append(" %2.0f" % p.vol) + s.append("%.0f" % p.vol) elif self.vtype == 'WALK': - s.append(" %2.0f" % p.vol ) - - s.append(' ;') - s.append('\n') - s[-2]=' ' - print "".join(s) + s.append("%.0f" % p.vol ) + + pp.append(' '.join(s)) + + return "; ".join(pp) def insertVoice(self): @@ -1624,13 +1723,13 @@ class PC: sc = gbl.seqCount """ 1st pass for MIDIVOICE. There's a separate slot for - each bar in the sequence, plus the data can be sent - before or after 'voice' commands. This first loop - sends MIDIVOICE data with an offset of 0. Note, we - don't set the value for 'self.smidiVoice' until we - do this again, later. All this is needed since some - MIDIVOICE commands NEED to be sent BEFORE voice selection, - and others AFTER. + each bar in the sequence, plus the data can be sent + before or after 'voice' commands. This first loop + sends MIDIVOICE data with an offset of 0. Note, we + don't set the value for 'self.smidiVoice' until we + do this again, later. All this is needed since some + MIDIVOICE commands NEED to be sent BEFORE voice selection, + and others AFTER. """ if self.midiVoice: @@ -1644,18 +1743,20 @@ class PC: v=self.voice[sc] if v != self.ssvoice: - gbl.mtrks[self.channel].addProgChange( gbl.tickOffset, v) + + gbl.mtrks[self.channel].addProgChange( gbl.tickOffset, v, self.ssvoice) self.ssvoice = v # Mark ssvoice also in shared tracks for a in gbl.midiAssigns[self.channel]: - if gbl.tnames.has_key(a): + try: gbl.tnames[a].ssvoice = v + except KeyError: + pass - if gbl.debug: - print "Track %s Voice %s inserted" \ - % (self.name, MMA.midiC.valueToInst(v) ) + if gbl.debug: + print "Track %s Voice %s inserted" % (self.name,MMA.midiC.valueToInst(v) ) """ Our 2nd stab at MIDIVOICE. This time any sequences with offsets >0 are sent. AND the smidiVoice and midiSent @@ -1685,6 +1786,10 @@ class PC: if self.futureVols: self.volume = seqBump([self.futureVols.pop(0)]) + if self.futureVols: + self.nextVolume = self.futureVols[0] + else: + self.nextVolume = None # If track is off don't do anything else. @@ -1702,12 +1807,7 @@ class PC: """ if self.seqRnd: - tmp = [] - for x, i in enumerate(self.seqRndWeight): - tmp.extend([x] * i) - if not len(tmp): - error("SeqRndWeight has generated an empty list") - self.seq = random.choice(tmp) + self.seq = MMA.seqrnd.getrndseq(self.seqRndWeight) else: self.seq = gbl.seqCount @@ -1717,7 +1817,6 @@ class PC: if self.riff: pattern = self.riff.pop(0) - else: pattern = self.sequence[sc] @@ -1816,11 +1915,25 @@ class PC: a1 = self.volume[sc] if not a1: return 0 + + if self.nextVolume: # inter-bar cresc adjust + bt=beat + if bt<1: # might have negative offsets, cres code ignores + bt=0 + a1 += (self.nextVolume - a1) * bt / (gbl.BperQ * gbl.QperBar) + a1 *= MMA.volume.vTRatio a2 = MMA.volume.volume if not a2: return 0 + + if MMA.volume.nextVolume: # inter-bar cresc adjust + bt=beat + if bt<1: # might have negative offsets, cres code ignores + bt=0 + a2 += (MMA.volume.nextVolume - a2) * bt / (gbl.BperQ * gbl.QperBar) + a2 *= MMA.volume.vMRatio v *= ( a1 + a2 ) @@ -1895,12 +2008,11 @@ class PC: else: note = None - v=stof(v, "Value for %s bar offset must be integer/float" % self.name) v = (v-1) * gbl.BperQ if note: - v += getNoteLen(note) * sign + v += MMA.notelen.getNoteLen(note) * sign if v < 0: if v<-gbl.BperQ: @@ -1938,7 +2050,7 @@ class PC: if not velocity: return - + sc = self.seq rptr = self.mallet diff --git a/mma/MMA/patAria.py b/mma/MMA/patAria.py index 13aaedb..50adf3f 100644 --- a/mma/MMA/patAria.py +++ b/mma/MMA/patAria.py @@ -23,15 +23,15 @@ Bob van der Poel """ +import random +import MMA.notelen +import MMA.harmony import gbl -from MMA.notelen import getNoteLen from MMA.common import * -from MMA.harmony import harmonize -from MMA.pat import PC, seqBump +from MMA.pat import PC -import random class Aria(PC): """ Pattern class for an aria (auto-melody) track. """ @@ -70,7 +70,7 @@ class Aria(PC): a = struct() a.offset = self.setBarOffset(ev[0]) - a.duration = getNoteLen( ev[1] ) + a.duration = MMA.notelen.getNoteLen( ev[1] ) a.vol = stoi(ev[2], "Note volume in Aria definition not int") return a @@ -79,7 +79,7 @@ class Aria(PC): def setScaletype(self, ln): """ Set scale type. """ - ln = self.lnExpand(ln, "ScaleType") + ln = lnExpand(ln, "%s ScaleType" % self.name) tmp = [] for n in ln: @@ -213,7 +213,7 @@ class Aria(PC): if self.harmony[sc]: - h = harmonize(self.harmony[sc], note, ct.chord.noteList) + h = MMA.harmony.harmonize(self.harmony[sc], note, ct.chord.noteList) for n in h: self.sendNote( p.offset, diff --git a/mma/MMA/patArpeggio.py b/mma/MMA/patArpeggio.py index 4ca1a81..c66456f 100644 --- a/mma/MMA/patArpeggio.py +++ b/mma/MMA/patArpeggio.py @@ -25,14 +25,13 @@ Bob van der Poel import random +import MMA.notelen +import MMA.harmony + import gbl -from MMA.notelen import getNoteLen from MMA.common import * -from MMA.harmony import harmonize from MMA.pat import PC - - class Arpeggio(PC): """ Pattern class for an arpeggio track. """ @@ -52,7 +51,7 @@ class Arpeggio(PC): "for apreggio define, not '%s'" % ' '.join(ev) ) a.offset = self.setBarOffset(ev[0]) - a.duration = getNoteLen(ev[1]) + a.duration = MMA.notelen.getNoteLen(ev[1]) a.vol = stoi(ev[2], "Type error in Arpeggio definition") return a @@ -147,7 +146,7 @@ class Arpeggio(PC): if self.harmony[sc]: - h = harmonize(self.harmony[sc], note, ourChord) + h = MMA.harmony.harmonize(self.harmony[sc], note, ourChord) for n in h: self.sendNote( p.offset, diff --git a/mma/MMA/patBass.py b/mma/MMA/patBass.py index df8f253..4938083 100644 --- a/mma/MMA/patBass.py +++ b/mma/MMA/patBass.py @@ -24,11 +24,11 @@ Bob van der Poel """ +import MMA.notelen +import MMA.harmony import gbl -from MMA.notelen import getNoteLen from MMA.common import * -from MMA.harmony import harmonize from MMA.pat import PC @@ -51,7 +51,7 @@ class Bass(PC): a = struct() a.offset = self.setBarOffset(ev[0]) - a.duration = getNoteLen( ev[1] ) + a.duration = MMA.notelen.getNoteLen( ev[1] ) offset = ev[2] n=offset[0] @@ -119,7 +119,7 @@ class Bass(PC): if self.harmony[sc]: - h = harmonize(self.harmony[sc], note, ct.chord.noteList) + h = MMA.harmony.harmonize(self.harmony[sc], note, ct.chord.noteList) for n in h: self.sendNote( p.offset, diff --git a/mma/MMA/patChord.py b/mma/MMA/patChord.py index 4bec74f..38a9334 100644 --- a/mma/MMA/patChord.py +++ b/mma/MMA/patChord.py @@ -26,10 +26,12 @@ Bob van der Poel import random + +import MMA.notelen + import gbl -from MMA.notelen import getNoteLen from MMA.common import * -from MMA.pat import PC, seqBump +from MMA.pat import PC @@ -136,7 +138,7 @@ class Chord(PC): """ set/unset root duplication. Only for CHORDs """ - ln=self.lnExpand(ln, 'DupRoot') + ln = lnExpand(ln, '%s DupRoot' % self.name) tmp = [] for n in ln: @@ -157,7 +159,7 @@ class Chord(PC): def setStrum(self, ln): """ Set Strum time. """ - ln=self.lnExpand(ln, 'Strum') + ln = lnExpand(ln, '%s Strum' % self.name) tmp = [] for n in ln: @@ -187,7 +189,7 @@ class Chord(PC): a = struct() a.offset = self.setBarOffset(ev[0]) - a.duration = getNoteLen(ev[1]) + a.duration = MMA.notelen.getNoteLen(ev[1]) vv = ev[2:] if len(vv)>8: @@ -401,4 +403,3 @@ class Chord(PC): self.voicing.bcount -= 1 - diff --git a/mma/MMA/patDrum.py b/mma/MMA/patDrum.py index dd272ab..b14b207 100644 --- a/mma/MMA/patDrum.py +++ b/mma/MMA/patDrum.py @@ -23,12 +23,12 @@ Bob van der Poel """ +import MMA.notelen +import MMA.translate + import gbl from MMA.common import * -from MMA.notelen import getNoteLen -import MMA.translate -from MMA.pat import PC, seqBump - +from MMA.pat import PC class Drum(PC): """ Pattern class for a drum track. """ @@ -51,7 +51,7 @@ class Drum(PC): ln[] is not nesc. the right length. """ - ln=self.lnExpand(ln, 'Tone') + ln = lnExpand(ln, '%s Tone' % self.name) tmp = [] for n in ln: @@ -77,7 +77,7 @@ class Drum(PC): a = struct() a.offset = self.setBarOffset(ev[0]) - a.duration = getNoteLen(ev[1]) + a.duration = MMA.notelen.getNoteLen(ev[1]) a.vol = stoi(ev[2], "Type error in Drum volume") return a diff --git a/mma/MMA/patScale.py b/mma/MMA/patScale.py index 21e7701..e433a51 100644 --- a/mma/MMA/patScale.py +++ b/mma/MMA/patScale.py @@ -25,12 +25,12 @@ Bob van der Poel import random -from MMA.harmony import harmonize -from MMA.notelen import getNoteLen +import MMA.harmony +import MMA.notelen +from MMA.pat import PC + import gbl from MMA.common import * -from MMA.pat import PC, seqBump - class Scale(PC): """ Pattern class for a Scale track. """ @@ -60,7 +60,7 @@ class Scale(PC): a = struct() a.offset = self.setBarOffset(ev[0]) - a.duration = getNoteLen(ev[1]) + a.duration = MMA.notelen.getNoteLen(ev[1]) a.vol = stoi(ev[2], "Type error in Scale definition") @@ -69,7 +69,7 @@ class Scale(PC): def setScaletype(self, ln): """ Set scale type. """ - ln = self.lnExpand(ln, "ScaleType") + ln = lnExpand(ln, "%s ScaleType" % self.name) tmp = [] for n in ln: @@ -220,7 +220,7 @@ class Scale(PC): if self.harmony[sc]: ch = self.getChordInPos(p.offset, ctable).chord.noteList - h = harmonize(self.harmony[sc], note, ch) + h = MMA.harmony.harmonize(self.harmony[sc], note, ch) for n in h: self.sendNote( p.offset, diff --git a/mma/MMA/patSolo.py b/mma/MMA/patSolo.py index f3a32c9..c590262 100644 --- a/mma/MMA/patSolo.py +++ b/mma/MMA/patSolo.py @@ -23,14 +23,16 @@ Bob van der Poel """ +import MMA.notelen +import MMA.translate +import MMA.harmony +import MMA.volume +import MMA.alloc + import gbl from MMA.common import * -from MMA.notelen import getNoteLen -import MMA.translate -from MMA.harmony import harmonize from MMA.pat import PC -import MMA.alloc -import MMA.volume + class NoteList: @@ -79,9 +81,10 @@ class Melody(PC): if len(ln) > 1: error("Only 1 value permitted for Drum Tone in Solo tracks") - + + self.drumTone = MMA.translate.dtable.get(ln[0]) - + def getLine(self, pat, ctable): """ Extract a melodyline for solo/melody tracks. @@ -128,25 +131,25 @@ class Melody(PC): """ if gbl.swingMode: - len8 = getNoteLen('8') - len81 = getNoteLen('81') - len82 = getNoteLen('82') + len8 = MMA.notelen.getNoteLen('8') + len81 = MMA.notelen.getNoteLen('81') + len82 = MMA.notelen.getNoteLen('82') onBeats = [ x * gbl.BperQ for x in range(gbl.QperBar)] offBeats = [ (x * gbl.BperQ + len8) for x in range(gbl.QperBar)] - length = getNoteLen('4') # default note length + length = MMA.notelen.getNoteLen('4') # default note length lastc = '' # last parsed note velocity = 90 # intial/default velocity for solo notes notes={} # A dict of NoteList, keys == offset - + if self.drumType: isdrum = 1 lastc = str(self.drumTone) else: isdrum = None - + pat = pat.replace(' ', '').split(';')[:-1] # set initial offset into bar @@ -206,7 +209,7 @@ class Melody(PC): i+=1 if i: - l=getNoteLen(a[0:i]) + l=MMA.notelen.getNoteLen(a[0:i]) c=a[i:] else: l=length @@ -220,7 +223,6 @@ class Melody(PC): length = l # set defaults for next loop lastc = c - """ Convert the note part into a series of midi values Notes can be a single note, or a series of notes. And each note can be a letter a-g (or r), a '#,&,n' plus @@ -286,7 +288,7 @@ class Melody(PC): elif name == '*': v = self.drumTone else: - v = MMA.translate.dtable.get(name) + v = int(MMA.translate.dtable.get(name)) """ Swingmode -- This tests for successive 8ths on/off beat @@ -310,7 +312,7 @@ class Melody(PC): notes[offset] = NoteList(l) # add note event to note[] array - + notes[offset].nl.append(v) notes[offset].velocity.append(self.adjustVolume(velocity, offset)) @@ -336,7 +338,7 @@ class Melody(PC): def addHarmony(self, notes, ctable): """ Add harmony to solo notes. """ - + sc=self.seq harmony = self.harmony[sc] @@ -352,7 +354,7 @@ class Melody(PC): if tb.chordZ: continue - h = harmonize(harmony, nn.nl[0], tb.chord.bnoteList) + h = MMA.harmony.harmonize(harmony, nn.nl[0], tb.chord.bnoteList) """ If harmonyonly set then drop note, substitute harmony, else append harmony notes to chord. @@ -622,7 +624,7 @@ def extractSolo(ln, rptcount): """ for t in autoSoloTracks[1:]: - if gbl.tnames.has_key(t) and gbl.tnames[t].riff == [] \ + if t in gbl.tnames and gbl.tnames[t].riff == [] \ and max(gbl.tnames[t].harmonyOnly): gbl.tnames[t].setRiff( firstSolo[:] ) diff --git a/mma/MMA/patWalk.py b/mma/MMA/patWalk.py index 63fe4dc..6264cd0 100644 --- a/mma/MMA/patWalk.py +++ b/mma/MMA/patWalk.py @@ -26,13 +26,14 @@ Bob van der Poel import random -from MMA.harmony import harmonize -from MMA.notelen import getNoteLen + +import MMA.harmony +import MMA.notelen + import gbl from MMA.common import * from MMA.pat import PC - class Walk(PC): """ Pattern class for a walking bass track. """ @@ -52,7 +53,7 @@ class Walk(PC): a = struct() a.offset = self.setBarOffset(ev[0]) - a.duration = getNoteLen(ev[1]) + a.duration = MMA.notelen.getNoteLen(ev[1]) a.vol = stoi(ev[2], "Type error in Walking Bass definition") return a @@ -152,7 +153,7 @@ class Walk(PC): if self.harmony[sc]: ch = self.getChordInPos(p.offset, ctable).chord.noteList - h = harmonize(self.harmony[sc], note, ch) + h = MMA.harmony.harmonize(self.harmony[sc], note, ch) for n in h: self.sendNote( p.offset, diff --git a/mma/MMA/patch.py b/mma/MMA/patch.py new file mode 100644 index 0000000..5651b57 --- /dev/null +++ b/mma/MMA/patch.py @@ -0,0 +1,148 @@ +# patch.py + +""" +This module is an integeral part of the program +MMA - Musical Midi Accompaniment. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Bob van der Poel + +This module contains the various patch manger routines. + +""" + +from MMA.common import * +from MMA.miditables import * +import MMA.file +import MMA.midiC + +def patch(ln): + """ Main routine to manage midi patch names. """ + + for i,a in enumerate(ln): + + if a.count('=') == 1: + a,b = a.split('=') + else: + b='' + a=a.upper() + + if a == "LIST": + b=b.upper() + if b == "ALL": + plistall() + elif b == "EXT": + plistext() + elif b == "GM": + plistgm() + else: + error("Expecting All, EXT or GM argument for List") + + if a == "RENAME": + prename(ln[i+1:]) + break + + if a == 'SET': + patchset(ln[i+1:]) + break + + error("Unknown option for Patch: %s" % a) + +# Set a patch value=name + +def patchset(ln): + if not ln: + error("Patch Set expecting list of value pairs.") + + for a in ln: + + try: + v,n = a.split('=', 1) + except: + error("Patch Set expecting value=name pair, not: %s" % a) + + v=v.split('.') + if len(v) > 3 or len(v) < 1: + error("Patch Set: Expecting a voice value Prog.MSB.LSB." ) + + voc = 0 + if len(v) > 2: # ctrl32 + i = stoi(v[2], "Patch Set LSB expecting integer.") + if i<0 or i>127: + error("LSB must be 0..127, not '%s'." % i) + voc = i << 16 + + if len(v) > 1: # ctrl0 + i = stoi(v[1], "Patch Set MSB expecting integer.") + if i<0 or i>127: + error("MSB must be 0..127, not '%s'." % i) + voc += i << 8 + + i = stoi(v[0], "Patch Set Voice expecting integer.") + if i<0 or i>127: + error("Program must be 0..127, not '%s'." % i) + voc += i + + if voc in voiceNames: + warning("Patch Set duplicating voice name %s with %s=%s" % \ + (voiceNames[voc], n, MMA.midiC.extVocStr(voc) )) + if n.upper() in voiceInx: + warning("Patch Set duplicating voice value %s with %s=%s" % \ + (MMA.midiC.extVocStr(voiceInx[n.upper()]), + MMA.midiC.extVocStr(voc), n) ) + voiceNames[voc]=n + voiceInx[n.upper()]=voc + + + +# Rename + +def prename(ln): + if not ln: + error("Patch Rename expecting list of value pairs.") + + for a in ln: + if not a.count("=") == 1: + error("Patch Rename expecting oldname=newname pair") + + a,b = a.split("=") + + if not a.upper() in voiceInx: + error("Patch %s doen't exist, can't be renamed." % a) + + if b.upper() in voiceInx: + error("Patch name %s already exists" % b) + + v = voiceInx[a.upper()] + voiceNames[v]=b + del voiceInx[a.upper()] + voiceInx[b.upper()]=v + +# list funcs + +def plistgm(): + for v in sorted(voiceNames.keys()): + if v <= 127: + print "%s=%s" % (MMA.midiC.extVocStr(v), voiceNames[v] ) + +def plistall(): + plistgm() + plistext() + +def plistext(): + for v in sorted(voiceNames.keys()): + if v>127: + print "%s=%s" % (MMA.midiC.extVocStr(v), voiceNames[v]) diff --git a/mma/MMA/safe_eval.py b/mma/MMA/safe_eval.py new file mode 100644 index 0000000..ce15275 --- /dev/null +++ b/mma/MMA/safe_eval.py @@ -0,0 +1,48 @@ +# safe_eval.py + +""" +This module is an integeral part of the program +MMA - Musical Midi Accompaniment. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Bob van der Poel + +""" + +import re +from math import * + +from common import error + +safeCmds = [ 'ceil', 'fabs', 'floor', 'exp', 'log', 'log10', 'pow', + 'sqrt', 'acos', 'asin', 'atan', 'atan2', 'cos', 'hypot', + 'sin', 'tan', 'degrees', 'radians', 'cosh', 'sinh', + 'int', 'in', '.join', 'str', '.split', 'for' ] + +def safe_eval( expr ): + + toks = re.split( r'([a-zA-Z_\.]+|.)', expr ) + + for t in toks: + if len(t)>1 and t not in safeCmds: + error("Illegal/Unknown operator '%s' in $()." % t) + try: + return eval(expr) + except: + error("Illegal operation in '%s'." % expr) + + + diff --git a/mma/MMA/seqrnd.py b/mma/MMA/seqrnd.py new file mode 100644 index 0000000..78ef075 --- /dev/null +++ b/mma/MMA/seqrnd.py @@ -0,0 +1,155 @@ + +# seqrnd.py + +""" +This module is an integeral part of the program +MMA - Musical Midi Accompaniment. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Bob van der Poel + +""" + +import random + +from MMA.common import * + + +""" SeqRnd variable is a list. The first entry is a flag:(0, 1 or x): + 0 - not set + 1 - set + 2 - set for specific tracks, track list starts at position [1] +""" + +seqRnd = [0] # set if SEQRND has been set +seqRndWeight = [1] + + + +def setseq(): + """ Set up the seqrnd values, called from parse loop. + + + returns: + 0... a random sequence number, + -1 signals that rndseq is not enabled. + + There are three methods of rndseq. They depend on the first value + in the list seqRnd[]: + + [0] not enabled. + [1] random selection, keeps all tracks in sync. + [2] randomize selected tracks. + + The list seqRndWeight has at least the same number of entries in it + as there are in the sequence size. By default each will have + the same value of 1. A list of the valid sequence points is + generated (ie, if seqsize==4 tmp will be [0,1,2,3]). In addition + the weights of each entry in tmp[] is adjusted by the weights in + the seqrndweight[] list. + """ + + if seqRnd[0]: + r = getrndseq(seqRndWeight) + if seqRnd[0] == 1: + gbl.seqCount = r + r = -1 + else: + r = -1 + + return ( r, seqRnd[1:] ) + +def getrndseq(v): + tmp = [] + for x, i in enumerate(v): + tmp.extend([x] * i) + tmp=tmp[:gbl.seqSize] + + if not len(tmp): + error("SeqRndWeight has generated an empty list") + + return random.choice(tmp) + + +## Main parser routines + +def setSeqRnd(ln): + """ Set random order for all tracks. """ + + global seqRnd + + emsg = "use [ON, OFF or TrackList ]" + if not ln: + error("SeqRnd:" + emsg) + + a=ln[0].upper() + + if a in ("ON", "1") and len(ln) == 1: + seqRnd = [1] + + elif a in ("OFF", "0") and len(ln) == 1: + seqRnd = [0] + + else: + seqRnd=[2] + for a in ln: + a = a.upper() + if not a in gbl.tnames: + error("SeqRnd: Track '%s' does not exist, %s" % (a, emsg)) + if a in seqRnd: + error("SeqRnd: Duplicate track '%s' specified, %s" % (a, emsg)) + seqRnd.append(a) + + if gbl.debug: + print "SeqRnd:", + if seqRnd[0] == 2: + for a in seqRnd[1:]: + print a, + print + elif seqRnd[0] == 1: + print "On" + else: + print "Off" + +def getweights(ln, msg): + + ln = lnExpand(ln, msg) + + if not ln: + error("Use: %s " % msg) + + tmp = [] + for n in ln: + n = stoi(n) + if n < 0: error("%s: Values must be 0 or greater" % msg) + tmp.append(n) + + tmp = seqBump(tmp) + + if gbl.debug: + print "%s: " % msg, + printList(tmp) + + return tmp + + +def setSeqRndWeight(ln): + """ Set global rnd weight. """ + + global seqRndWeight + + seqRndWeight = getweights(ln, "SeqRndWeight") + diff --git a/mma/MMA/translate.py b/mma/MMA/translate.py index 7f4534a..03e45b2 100644 --- a/mma/MMA/translate.py +++ b/mma/MMA/translate.py @@ -26,11 +26,13 @@ This module handles voice name translations. """ -import gbl import MMA.midiC + +import gbl from MMA.common import * + """ Translation table for VOICE. This is ONLY used when a voice is set from the VOICE command. If a translation exists the translation is substituted. @@ -78,10 +80,9 @@ class Vtable: """ Return a translation or original. """ name=name.upper() - if self.table.has_key(name): + try: return self.table[name] - - else: + except KeyError: return name vtable=Vtable() # Create single class instance. @@ -123,24 +124,32 @@ class Dtable: error("Each translation pair must be in the format Voice=Alias") v,a = l.split('=') - v=MMA.midiC.drumToValue(v) - a=MMA.midiC.drumToValue(a) + v1=MMA.midiC.drumToValue(v) + if v1<0: + error("Drum Tone '%s' not defined." % v) + a1=MMA.midiC.drumToValue(a) + if a1<0: + error("Drum Tone '%s' not defined." % a) - self.table[v] = a + self.table[v1] = a1 if gbl.debug: print "DrumTone Translation: %s=%s" % \ (MMA.midiC.valueToDrum(v), MMA.midiC.valueToDrum(a)) def get(self, name): - """ Return a translation or original. """ + """ Return a translation or original. Note that this also does + validation of 'name'. It is called from patDrum and patSolo. + """ v=MMA.midiC.drumToValue(name) + + if v<0: + error("Drum Tone '%s' not defined." % name) - if self.table.has_key(v): + try: return self.table[v] - - else: + except KeyError: return v @@ -195,10 +204,10 @@ class VoiceVolTable: def get(self, v, vol): """ Return an adjusted value or original. """ - if self.table.has_key(v): + try: vol = int(vol * self.table[v]) - - return vol + except KeyError: + return vol voiceVolTable=VoiceVolTable() @@ -245,10 +254,10 @@ class DrumVolTable: def get(self, v, vol): """ Return an adjusted value or original. """ - if self.table.has_key(v): + try: vol = int(vol * self.table[v]) - - return vol + except KeyError: + return vol drumVolTable=DrumVolTable() diff --git a/mma/MMA/volume.py b/mma/MMA/volume.py index 3b3dbda..4958fc6 100644 --- a/mma/MMA/volume.py +++ b/mma/MMA/volume.py @@ -42,6 +42,9 @@ vols={ 'OFF': 0.00, 'PPPP': 0.05, 'PPP': 0.10, 'FF': 1.60, 'FFF': 1.80, 'FFFF': 2.00 } volume = vols['M'] # default global volume +nextVolume = None # main parser sets this to the next volume + # when future volumes are stacked. It's used + # by the volume adjust to smooth out (de)crescendos. lastVolume = volume futureVol = [] vTRatio = .6 @@ -141,14 +144,56 @@ def setVolume(ln): print "Volume: %s%%" % volume -# The next 2 are called from the parser. +# The next 3 are called from the parser. + def setCresc(ln): + """ Master Crescendo. """ + setCrescendo(1, ln) def setDecresc(ln): + """ Master Decrescendo (Diminuendo). """ setCrescendo(-1, ln) +def setSwell(ln): + """ Set a swell (cresc<>decresc). """ + + global futureVol, volume, lastVolume + + lastVolume = volume + + if len(ln) == 3: # 3 args, 1st is intial setting + setVolume([ln[0]]) + ln=ln[1:] + + if len(ln) != 2: + error("Swell expecting 2 or 3 args.") + + count = stoi(ln[1]) + if count < 2: + error("Swell bar count must be 2 or greater.") + + if count % 2: + c=(count+1)/2 + offset=1 + else: + c=count/2 + offset=0 + + c=str(c) + + futureVol = fvolume(0, volume, [ ln[0], c ] ) + futureVol.extend(fvolume(0, futureVol[-1], + [str(int(volume*100)), c ])[offset:]) + + + if gbl.debug: + print "Set Swell to:", + for a in futureVol: + print int(a*100), + print + def setCrescendo(dir, ln): """ Combined (de)cresc() """ @@ -165,7 +210,14 @@ def setCrescendo(dir, ln): ln=ln[1:] futureVol = fvolume(dir, volume, ln) + + if gbl.debug: + print "Set (De)Cresc to:", + for a in futureVol: + print int(a*100), + print + # Used by both the 2 funcs above and from TRACK.setCresc() @@ -173,14 +225,17 @@ def fvolume(dir, startvol, ln): """ Create a list of future vols. Called by (De)Cresc. """ # Get destination volume - + destvol = calcVolume(ln[0], startvol) bcount = stoi(ln[1], "Type error in bar count for (De)Cresc, '%s'" % ln[1] ) - + if bcount <= 0: error("Bar count for (De)Cresc must be postive") + # Test to see if (de)cresc is contrary to current settings. + # Using 'dir' of 0 will bypass this (used by SWELL). + if dir > 0 and destvol < startvol: warning("Cresc volume less than current setting" ) @@ -190,17 +245,17 @@ def fvolume(dir, startvol, ln): elif destvol == startvol: warning("(De)Cresc volume equal to current setting" ) - bcount -= 1 - step = ( destvol-startvol ) / bcount - + if bcount> 1: + bcount -= 1 + step = ( destvol-startvol ) / bcount volList=[startvol] - + for a in range(bcount-1): startvol += step volList.append( startvol) volList.append(destvol) - + return volList diff --git a/mma/cp-install b/mma/cp-install index 3ef1840..65b5c32 100755 --- a/mma/cp-install +++ b/mma/cp-install @@ -136,6 +136,9 @@ os.system("%s -G" % bin) print "Setting permissions on MMADIR database file for user update." os.system("chmod a+w " + dest+"/lib/stdlib/.mmaDB") +## man pages + +print "There are some man pages in %s/docs/man that you may wish to install." % dest - +print "Install complete. Have fun!" diff --git a/mma/docs/html/lib/index.html b/mma/docs/html/lib/index.html index 4371f88..6b5122e 100644 --- a/mma/docs/html/lib/index.html +++ b/mma/docs/html/lib/index.html @@ -84,6 +84,7 @@ information from the each library file:
  • stdlib/8beat.mma
  • stdlib/ballad.mma
  • stdlib/ballad128.mma
  • +
  • stdlib/ballad68.mma
  • stdlib/basicrock.mma
  • stdlib/beguine.mma
  • stdlib/bigband.mma
  • @@ -125,15 +126,20 @@ information from the each library file:
  • stdlib/polka.mma
  • stdlib/popballad.mma
  • stdlib/quickstep.mma
  • +
  • stdlib/rb-ballad.mma
  • stdlib/rb.mma
  • stdlib/rhumba.mma
  • stdlib/rock-128.mma
  • stdlib/rockballad.mma
  • +
  • stdlib/rockwaltz.mma
  • +
  • stdlib/salsa.mma
  • stdlib/samba.mma
  • +
  • stdlib/showtune.mma
  • stdlib/shuffleboggie.mma
  • stdlib/ska.mma
  • stdlib/slowblues.mma
  • stdlib/slowbolero.mma
  • +
  • stdlib/slowbroadway.mma
  • stdlib/slowcountry.mma
  • stdlib/slowjazz.mma
  • stdlib/softrock.mma
  • @@ -141,6 +147,7 @@ information from the each library file:
  • stdlib/son.mma
  • stdlib/swing.mma
  • stdlib/tango.mma
  • +
  • stdlib/trance.mma
  • stdlib/vienesewaltz.mma
  • stdlib/waltz.mma
  • stdlib/zydeco.mma
  • @@ -158,6 +165,8 @@ information from the each library file: @@ -168,4 +177,4 @@ information from the each library file:

    It is a part of the MMA distribution and is protected by the same copyrights as MMA (the GNU General Public License). -

    Created: Wed Mar 7 11:50:18 2007 \ No newline at end of file +

    Created: Sun Sep 28 11:30:06 2008 \ No newline at end of file diff --git a/mma/docs/html/lib/kara/K50s_rock.html b/mma/docs/html/lib/kara/K50s_rock.html index c6bc689..4ef6d02 100644 --- a/mma/docs/html/lib/kara/K50s_rock.html +++ b/mma/docs/html/lib/kara/K50s_rock.html @@ -1,4 +1,4 @@ - +

    K50S_Rock

    diff --git a/mma/docs/html/lib/kara/Kfunk1.html b/mma/docs/html/lib/kara/Kfunk1.html index 0892daf..cd99834 100644 --- a/mma/docs/html/lib/kara/Kfunk1.html +++ b/mma/docs/html/lib/kara/Kfunk1.html @@ -1,4 +1,4 @@ - +

    Kfunk1

    diff --git a/mma/docs/html/lib/kara/twi.html b/mma/docs/html/lib/kara/twi.html index fdf94e3..a4cf048 100644 --- a/mma/docs/html/lib/kara/twi.html +++ b/mma/docs/html/lib/kara/twi.html @@ -1,4 +1,4 @@ - +

    Twi

    diff --git a/mma/docs/html/lib/stdlib/50srock.html b/mma/docs/html/lib/stdlib/50srock.html index bcb1bd6..2f28f3c 100644 --- a/mma/docs/html/lib/stdlib/50srock.html +++ b/mma/docs/html/lib/stdlib/50srock.html @@ -1,4 +1,4 @@ - +

    50Srock

    diff --git a/mma/docs/html/lib/stdlib/60srock.html b/mma/docs/html/lib/stdlib/60srock.html index d214503..e29f0ec 100644 --- a/mma/docs/html/lib/stdlib/60srock.html +++ b/mma/docs/html/lib/stdlib/60srock.html @@ -1,4 +1,4 @@ - +

    60Srock

    @@ -8,6 +8,7 @@
  • 60sRock1
  • 60sRockSus
  • 60sRock1Sus +
  • 60sRockIntro
  • 60sRockEnd @@ -82,6 +83,23 @@ + + + + +
    +

    60sRockIntro

    + 4 bar intro. (4) +
    + + + + + + + +
    Chord CleanGuitar
    Chord-Straight CleanGuitar
    Drum-Kick KickDrum1
    Drum-Ohh OpenHiHat
    Drum-Snare SnareDrum2
    Walk FretlessBass
    +
    diff --git a/mma/docs/html/lib/stdlib/8beat.html b/mma/docs/html/lib/stdlib/8beat.html index b4f1355..84a5ac5 100644 --- a/mma/docs/html/lib/stdlib/8beat.html +++ b/mma/docs/html/lib/stdlib/8beat.html @@ -1,4 +1,4 @@ - +

    8Beat

    diff --git a/mma/docs/html/lib/stdlib/ballad.html b/mma/docs/html/lib/stdlib/ballad.html index 2fd9ed1..103fbbd 100644 --- a/mma/docs/html/lib/stdlib/ballad.html +++ b/mma/docs/html/lib/stdlib/ballad.html @@ -1,4 +1,4 @@ - +

    Ballad

    @@ -8,6 +8,7 @@
  • BalladSus
  • Ballad1
  • Ballad1Sus +
  • BalladFill
  • BalladIntro
  • BalladIntro1
  • BalladIntro2 @@ -116,6 +117,30 @@
  • + + + + +
    +

    BalladFill

    + 1 bar fill, good for endings. (1) +
    + + + + + + + + + + + + + + +
    Bass FretlessBass
    Chord Atmosphere
    Drum-Bongo LowBongo
    Drum-Cabasa Cabasa
    Drum-Cym RideCymbal1
    Drum-Hh PedalHiHat
    Drum-Hiconga MuteHighConga
    Drum-Kick KickDrum1
    Drum-Loconga LowConga
    Drum-Mutetri MuteTriangle
    Drum-Opentri OpenTriangle
    Drum-Shake Shaker
    Drum-Tamb Tambourine
    +
    diff --git a/mma/docs/html/lib/stdlib/ballad128.html b/mma/docs/html/lib/stdlib/ballad128.html index be13e34..d65a759 100644 --- a/mma/docs/html/lib/stdlib/ballad128.html +++ b/mma/docs/html/lib/stdlib/ballad128.html @@ -1,4 +1,4 @@ - +

    Ballad128

    @@ -31,7 +31,7 @@

    Ballad128Plus

    - Adds arpeggiated . (4) + Adds arpeggiated piano. (4)
    diff --git a/mma/docs/html/lib/stdlib/ballad68.html b/mma/docs/html/lib/stdlib/ballad68.html new file mode 100644 index 0000000..ab293f0 --- /dev/null +++ b/mma/docs/html/lib/stdlib/ballad68.html @@ -0,0 +1,125 @@ + + + +

    Ballad68

    +

    A 6/8 Ballad. Written for "Dedicated To The One I Love". This is written with 4 beats to the bar, so you'll probably need to multiply the "real" tempo by 2. Largely based on ballad128, so they should be somewhat compatible. +

    + +
    + + +
    +

    Ballad68

    + A rock ballad beat in 6/8. (4) +
    + + + + + +
    Bass AcousticBass
    Chord OrchestralHarp
    Drum-Kick SideKick
    Drum-Snare SnareDrum2
    +
    + + + + +
    +

    Ballad68Plus

    + Adds arpeggiated piano. (4) +
    + + + + + + +
    Arpeggio Piano1
    Bass AcousticBass
    Chord OrchestralHarp
    Drum-Kick SideKick
    Drum-Snare SnareDrum2
    +
    + + + + +
    +

    Ballad68Sus

    + Add in sustained TremoloStrings (4) +
    + + + + + + +
    Bass AcousticBass
    Chord OrchestralHarp
    Chord-Sus TremoloStrings
    Drum-Kick SideKick
    Drum-Snare SnareDrum2
    +
    + + + + +
    +

    Ballad68SusPlus

    + Sustained strings and apreggiating piano. (4) +
    + + + + + + + +
    Arpeggio Piano1
    Bass AcousticBass
    Chord OrchestralHarp
    Chord-Sus TremoloStrings
    Drum-Kick SideKick
    Drum-Snare SnareDrum2
    +
    + + + + +
    +

    Ballad68-44

    + A 4/4 fill bar. (1) +
    + + + + + +
    Bass AcousticBass
    Chord OrchestralHarp
    Drum-Kick SideKick
    Drum-Snare SnareDrum2
    +
    + + + + +
    +

    Ballad68Intro

    + This 4 bar intro with arpeggios. (4) +
    + + + + + +
    Arpeggio OrchestralHarp
    Bass AcousticBass
    Drum-Kick SideKick
    Drum-Snare SnareDrum2
    +
    + + + + +
    +

    Ballad68End

    + Simple 2 bar ending. (2) +
    + + + + + +
    Bass AcousticBass
    Chord OrchestralHarp
    Drum-Kick SideKick
    Drum-Snare SnareDrum2
    +
    + + diff --git a/mma/docs/html/lib/stdlib/basicrock.html b/mma/docs/html/lib/stdlib/basicrock.html index 0a918f9..6da4c2f 100644 --- a/mma/docs/html/lib/stdlib/basicrock.html +++ b/mma/docs/html/lib/stdlib/basicrock.html @@ -1,4 +1,4 @@ - +

    Basicrock

    diff --git a/mma/docs/html/lib/stdlib/beguine.html b/mma/docs/html/lib/stdlib/beguine.html index 5f092a1..dff4439 100644 --- a/mma/docs/html/lib/stdlib/beguine.html +++ b/mma/docs/html/lib/stdlib/beguine.html @@ -1,4 +1,4 @@ - +

    Beguine

    diff --git a/mma/docs/html/lib/stdlib/bigband.html b/mma/docs/html/lib/stdlib/bigband.html index fca82af..f173246 100644 --- a/mma/docs/html/lib/stdlib/bigband.html +++ b/mma/docs/html/lib/stdlib/bigband.html @@ -1,4 +1,4 @@ - +

    Bigband

    diff --git a/mma/docs/html/lib/stdlib/bluegrass.html b/mma/docs/html/lib/stdlib/bluegrass.html index 4b66cb2..282bd72 100644 --- a/mma/docs/html/lib/stdlib/bluegrass.html +++ b/mma/docs/html/lib/stdlib/bluegrass.html @@ -1,4 +1,4 @@ - +

    Bluegrass

    diff --git a/mma/docs/html/lib/stdlib/blues.html b/mma/docs/html/lib/stdlib/blues.html index 57b13e9..0245b6d 100644 --- a/mma/docs/html/lib/stdlib/blues.html +++ b/mma/docs/html/lib/stdlib/blues.html @@ -1,4 +1,4 @@ - +

    Blues

    diff --git a/mma/docs/html/lib/stdlib/boggiewoggie.html b/mma/docs/html/lib/stdlib/boggiewoggie.html index 22867c1..6b9b68f 100644 --- a/mma/docs/html/lib/stdlib/boggiewoggie.html +++ b/mma/docs/html/lib/stdlib/boggiewoggie.html @@ -1,4 +1,4 @@ - +

    Boggiewoggie

    diff --git a/mma/docs/html/lib/stdlib/bolero.html b/mma/docs/html/lib/stdlib/bolero.html index 2fa2af5..f410eaa 100644 --- a/mma/docs/html/lib/stdlib/bolero.html +++ b/mma/docs/html/lib/stdlib/bolero.html @@ -1,4 +1,4 @@ - +

    Bolero

    @@ -8,6 +8,10 @@
  • BoleroFill
  • BoleroSus
  • BoleroSusFill +
  • BoleroAlt +
  • BoleroAltSus +
  • BoleroAltFill +
  • BoleroAltSusFill
  • BoleroIntro
  • BoleroEnd
  • Bolero1 @@ -97,6 +101,90 @@
  • + + + + +
    +

    BoleroAlt

    + Arpeggiated guitars. (4) +
    + + + + + + + + + + +
    Arpeggio-Guitar NylonGuitar
    Bass FingeredBass
    Bass-Guitar NylonGuitar
    Chord SteelGuitar
    Drum-Claves Claves
    Drum-Hbongo HighBongo
    Drum-Kick KickDrum1
    Drum-Lbongo LowBongo
    Drum-Maraca Maracas
    +
    + + + + +
    +

    BoleroAltSus

    + Sustain with Arpeggiated guitars. (4) +
    + + + + + + + + + + + +
    Arpeggio-Guitar NylonGuitar
    Bass FingeredBass
    Bass-Guitar NylonGuitar
    Chord SteelGuitar
    Chord-Sus Strings
    Drum-Claves Claves
    Drum-Hbongo HighBongo
    Drum-Kick KickDrum1
    Drum-Lbongo LowBongo
    Drum-Maraca Maracas
    +
    + + + + +
    +

    BoleroAltFill

    + Arpeggiated flutes and guitars. (4) +
    + + + + + + + + + + + +
    Arpeggio Flute
    Arpeggio-Guitar NylonGuitar
    Bass FingeredBass
    Bass-Guitar NylonGuitar
    Chord SteelGuitar
    Drum-Claves Claves
    Drum-Hbongo HighBongo
    Drum-Kick KickDrum1
    Drum-Lbongo LowBongo
    Drum-Maraca Maracas
    +
    + + + + +
    +

    BoleroAltSusFill

    + Sustain with arpeggiated flutes and guitars. (4) +
    + + + + + + + + + + + + +
    Arpeggio Flute
    Arpeggio-Guitar NylonGuitar
    Bass FingeredBass
    Bass-Guitar NylonGuitar
    Chord SteelGuitar
    Chord-Sus Strings
    Drum-Claves Claves
    Drum-Hbongo HighBongo
    Drum-Kick KickDrum1
    Drum-Lbongo LowBongo
    Drum-Maraca Maracas
    +
    diff --git a/mma/docs/html/lib/stdlib/bossanova.html b/mma/docs/html/lib/stdlib/bossanova.html index 389c380..8391b56 100644 --- a/mma/docs/html/lib/stdlib/bossanova.html +++ b/mma/docs/html/lib/stdlib/bossanova.html @@ -1,4 +1,4 @@ - +

    Bossanova

    diff --git a/mma/docs/html/lib/stdlib/broadway.html b/mma/docs/html/lib/stdlib/broadway.html index 660778e..86b91ce 100644 --- a/mma/docs/html/lib/stdlib/broadway.html +++ b/mma/docs/html/lib/stdlib/broadway.html @@ -1,4 +1,4 @@ - +

    Broadway

    @@ -9,7 +9,7 @@
  • BroadwaySus
  • Broadway1Sus
  • BroadwayIntro -
  • BroadWayEnd +
  • BroadwayEnd @@ -110,10 +110,10 @@
  • - +
    -

    BroadWayEnd

    +

    BroadwayEnd

    A 2 bar ending reminiscent of a cha-cha. (2)
    diff --git a/mma/docs/html/lib/stdlib/calypso.html b/mma/docs/html/lib/stdlib/calypso.html index 057db9b..5f5c35b 100644 --- a/mma/docs/html/lib/stdlib/calypso.html +++ b/mma/docs/html/lib/stdlib/calypso.html @@ -1,4 +1,4 @@ - +

    Calypso

    diff --git a/mma/docs/html/lib/stdlib/chacha.html b/mma/docs/html/lib/stdlib/chacha.html index 31a836e..0e6288f 100644 --- a/mma/docs/html/lib/stdlib/chacha.html +++ b/mma/docs/html/lib/stdlib/chacha.html @@ -1,4 +1,4 @@ - +

    Chacha

    @@ -33,6 +33,7 @@
  • ChaChaFill
  • ChaCha1Fill
  • ChaChaIntro +
  • ChaChaIntro8
  • ChaChaEnd @@ -194,6 +195,28 @@
  • + + + + +
    +

    ChaChaIntro8

    + Same intro expanded to 8 bars. (8) +
    + + + + + + + + + + + + +
    Bass JazzGuitar
    Chord Piano1
    Drum-Clave Claves
    Drum-Hconga MuteHighConga
    Drum-Hh RideCymbal1
    Drum-Htom HighTom2
    Drum-Lconga LowConga
    Drum-Lguiro LongGuiro
    Drum-Mtom MidTom2
    Drum-Sguiro ShortGuiro
    Drum-Snare SnareDrum1
    +
    +
    diff --git a/mma/docs/html/lib/stdlib/countryblues.html b/mma/docs/html/lib/stdlib/countryblues.html index cc9335a..ac427a4 100644 --- a/mma/docs/html/lib/stdlib/countryblues.html +++ b/mma/docs/html/lib/stdlib/countryblues.html @@ -1,4 +1,4 @@ - +

    Countryblues

    diff --git a/mma/docs/html/lib/stdlib/countryswing.html b/mma/docs/html/lib/stdlib/countryswing.html index d86db61..9f0471a 100644 --- a/mma/docs/html/lib/stdlib/countryswing.html +++ b/mma/docs/html/lib/stdlib/countryswing.html @@ -1,4 +1,4 @@ - +

    Countryswing

    diff --git a/mma/docs/html/lib/stdlib/countrywaltz.html b/mma/docs/html/lib/stdlib/countrywaltz.html index 2c25923..516677c 100644 --- a/mma/docs/html/lib/stdlib/countrywaltz.html +++ b/mma/docs/html/lib/stdlib/countrywaltz.html @@ -1,4 +1,4 @@ - +

    Countrywaltz

    diff --git a/mma/docs/html/lib/stdlib/desert.html b/mma/docs/html/lib/stdlib/desert.html index 3711972..b7080a5 100644 --- a/mma/docs/html/lib/stdlib/desert.html +++ b/mma/docs/html/lib/stdlib/desert.html @@ -1,4 +1,4 @@ - +

    Desert

    diff --git a/mma/docs/html/lib/stdlib/dixie.html b/mma/docs/html/lib/stdlib/dixie.html index 87c13a9..9445019 100644 --- a/mma/docs/html/lib/stdlib/dixie.html +++ b/mma/docs/html/lib/stdlib/dixie.html @@ -1,4 +1,4 @@ - +

    Dixie

    diff --git a/mma/docs/html/lib/stdlib/dixiemarch.html b/mma/docs/html/lib/stdlib/dixiemarch.html index 6046849..50dcd04 100644 --- a/mma/docs/html/lib/stdlib/dixiemarch.html +++ b/mma/docs/html/lib/stdlib/dixiemarch.html @@ -1,4 +1,4 @@ - +

    Dixiemarch

    diff --git a/mma/docs/html/lib/stdlib/easyswing.html b/mma/docs/html/lib/stdlib/easyswing.html index 044fa04..e74c1b3 100644 --- a/mma/docs/html/lib/stdlib/easyswing.html +++ b/mma/docs/html/lib/stdlib/easyswing.html @@ -1,8 +1,8 @@ - +

    Easyswing

    -

    Soft guitar strumming. Great of tunes like "Beyond The Sea" and "Summertime". +

    Soft guitar strumming. Great for tunes like "Beyond The Sea" and "Summertime".

    Bass AcousticBass
    Chord JazzGuitar
    Drum-Hh OpenHiHat
    Drum-Kick KickDrum1
    Drum-Phh PedalHiHat
    Walk AcousticBass
    @@ -56,6 +57,7 @@ Chord JazzGuitar Chord-Sus TremoloStrings Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -73,6 +75,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -88,6 +91,7 @@ +
    Chord JazzGuitar
    Drum-Hh OpenHiHat
    Drum-Kick KickDrum1
    Drum-Phh PedalHiHat
    Walk AcousticBass
    @@ -104,6 +108,7 @@ Chord JazzGuitar Chord-Sus TremoloStrings Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -121,6 +126,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -137,6 +143,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -154,6 +161,7 @@ Chord JazzGuitar Chord-Sus TremoloStrings Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -171,6 +179,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -187,6 +196,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -204,6 +214,7 @@ Chord JazzGuitar Chord-Sus TremoloStrings Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -221,6 +232,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -237,6 +249,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -254,6 +267,7 @@ Chord JazzGuitar Chord-Sus TremoloStrings Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -271,6 +285,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -286,6 +301,7 @@ +
    Chord JazzGuitar
    Drum-Hh OpenHiHat
    Drum-Kick KickDrum1
    Drum-Phh PedalHiHat
    Walk AcousticBass
    @@ -302,6 +318,7 @@ Chord JazzGuitar Chord-Sus TremoloStrings Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -318,6 +335,7 @@ Arpeggio JazzGuitar Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass @@ -334,6 +352,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat @@ -349,6 +368,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat @@ -364,6 +384,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh RideCymbal1 + Drum-Kick KickDrum1 Drum-Phh PedalHiHat @@ -380,6 +401,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat @@ -395,6 +417,7 @@ Bass AcousticBass Chord JazzGuitar Drum-Hh OpenHiHat + Drum-Kick KickDrum1 Drum-Phh PedalHiHat Walk AcousticBass diff --git a/mma/docs/html/lib/stdlib/fastblues.html b/mma/docs/html/lib/stdlib/fastblues.html index a56c3d0..af5036f 100644 --- a/mma/docs/html/lib/stdlib/fastblues.html +++ b/mma/docs/html/lib/stdlib/fastblues.html @@ -1,4 +1,4 @@ - +

    Fastblues

    diff --git a/mma/docs/html/lib/stdlib/folk.html b/mma/docs/html/lib/stdlib/folk.html index e874938..153fdbf 100644 --- a/mma/docs/html/lib/stdlib/folk.html +++ b/mma/docs/html/lib/stdlib/folk.html @@ -1,4 +1,4 @@ - +

    Folk

    @@ -7,6 +7,8 @@
  • Folk
  • FolkWalk
  • FolkArticulated +
  • FolkSus +
  • FolkArticulatedSus
  • FolkIntro
  • FolkEnd @@ -54,6 +56,38 @@ + + + + +
    +

    FolkSus

    + Some nice harmonica chords with the guitar. (8) +
    + + + + + +
    Bass AcousticBass
    Chord NylonGuitar
    Chord-Sus Harmonica
    Drum-Tamb Tambourine
    +
    + + + + +
    +

    FolkArticulatedSus

    + Articulated version with harmonica. (8) +
    + + + + + + + +
    Arpeggio NylonGuitar
    Bass AcousticBass
    Chord NylonGuitar
    Chord-Sus Harmonica
    Drum-Tamb Tambourine
    Walk AcousticBass
    +
    diff --git a/mma/docs/html/lib/stdlib/foxtrot.html b/mma/docs/html/lib/stdlib/foxtrot.html index f170d45..b637b4e 100644 --- a/mma/docs/html/lib/stdlib/foxtrot.html +++ b/mma/docs/html/lib/stdlib/foxtrot.html @@ -1,8 +1,22 @@ - +

    Foxtrot

    Just about any old-fashioned dance piece can be set to a foxtrot. +

    + + + +
    +

    Variables

    +
    + + + + + +
    ArpeggioVoice Voice for the alternating apreggios in the Plus versions (Default=Piano1). Also used in Introduction and Ending.
    +

    - + @@ -22,6 +26,8 @@
  • ModernJazz1
  • ModernJazzSus
  • ModernJazz1Sus +
  • ModernJazz2 +
  • ModernJazz2Sus
  • ModernJazzIntro
  • ModernJazzEnd @@ -107,6 +113,49 @@
  • -

    FrenchWaltz2Sus

    +

    FrenchWaltz3Sus

    Viola counter melody and sustained strings. (8)
    diff --git a/mma/docs/html/lib/stdlib/guitarballad.html b/mma/docs/html/lib/stdlib/guitarballad.html index 0956967..00100f7 100644 --- a/mma/docs/html/lib/stdlib/guitarballad.html +++ b/mma/docs/html/lib/stdlib/guitarballad.html @@ -1,4 +1,4 @@ - +

    Guitarballad

    diff --git a/mma/docs/html/lib/stdlib/hillcountry.html b/mma/docs/html/lib/stdlib/hillcountry.html index b16b98b..01b6801 100644 --- a/mma/docs/html/lib/stdlib/hillcountry.html +++ b/mma/docs/html/lib/stdlib/hillcountry.html @@ -1,4 +1,4 @@ - +

    Hillcountry

    diff --git a/mma/docs/html/lib/stdlib/jazz-54.html b/mma/docs/html/lib/stdlib/jazz-54.html index 09c4cb1..e785da1 100644 --- a/mma/docs/html/lib/stdlib/jazz-54.html +++ b/mma/docs/html/lib/stdlib/jazz-54.html @@ -1,4 +1,4 @@ - +

    Jazz-54

    diff --git a/mma/docs/html/lib/stdlib/jazzguitar.html b/mma/docs/html/lib/stdlib/jazzguitar.html index fbbf721..a3b1bdd 100644 --- a/mma/docs/html/lib/stdlib/jazzguitar.html +++ b/mma/docs/html/lib/stdlib/jazzguitar.html @@ -1,4 +1,4 @@ - +

    Jazzguitar

    diff --git a/mma/docs/html/lib/stdlib/jazzwaltz.html b/mma/docs/html/lib/stdlib/jazzwaltz.html index e5f8efc..b58d3a0 100644 --- a/mma/docs/html/lib/stdlib/jazzwaltz.html +++ b/mma/docs/html/lib/stdlib/jazzwaltz.html @@ -1,4 +1,4 @@ - +

    Jazzwaltz

    diff --git a/mma/docs/html/lib/stdlib/jive.html b/mma/docs/html/lib/stdlib/jive.html index e152d44..ffca383 100644 --- a/mma/docs/html/lib/stdlib/jive.html +++ b/mma/docs/html/lib/stdlib/jive.html @@ -1,4 +1,4 @@ - +

    Jive

    @@ -17,6 +17,7 @@
  • Jive1Plus
  • Jive1SusPlus
  • JiveIntro +
  • JiveIntro8
  • JiveEnd @@ -95,7 +96,7 @@

    JivePlus

    - Add some additional apreggios. (4) + Add some additional arpeggios. (4)
    @@ -113,7 +114,7 @@

    JiveSusPlus

    - Apreggios plus strings. (4) + Arpeggios plus strings. (4)
    @@ -255,6 +256,24 @@
    + + + + +
    +

    JiveIntro8

    + 8 bar intro. (8) +
    + + + + + + + + +
    Bass AcousticBass
    Bass-Sax AltoSax
    Chord Piano2
    Drum-Clap SnareDrum1
    Drum-Hh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    +
    diff --git a/mma/docs/html/lib/stdlib/lfusion.html b/mma/docs/html/lib/stdlib/lfusion.html index d31dbef..4fe5fb6 100644 --- a/mma/docs/html/lib/stdlib/lfusion.html +++ b/mma/docs/html/lib/stdlib/lfusion.html @@ -1,4 +1,4 @@ - +

    Lfusion

    diff --git a/mma/docs/html/lib/stdlib/lighttango.html b/mma/docs/html/lib/stdlib/lighttango.html index 9a6e00b..3a8cc8d 100644 --- a/mma/docs/html/lib/stdlib/lighttango.html +++ b/mma/docs/html/lib/stdlib/lighttango.html @@ -1,4 +1,4 @@ - +

    Lighttango

    @@ -10,7 +10,9 @@
  • LightTango1Sus
  • LightTangoFill
  • LightTangoIntro +
  • LightTangoIntro1
  • LightTangoEnd +
  • LightTango4End @@ -133,6 +135,25 @@
  • + + + + +
    +

    LightTangoIntro1

    + Smoother version of basic introduction. (4) +
    + + + + + + + + + +
    Bass AcousticBass
    Chord-Guitar NylonGuitar
    Chord-Sus TremoloStrings
    Drum-Clave Claves
    Drum-Kick KickDrum1
    Drum-Phh PedalHiHat
    Drum-Snare SnareDrum1
    Drum-Tam Tambourine
    +
    @@ -150,5 +171,25 @@
    + + + + +
    +

    LightTango4End

    + Smoother 4 bar ending. (4) +
    + + + + + + + + + + +
    Bass AcousticBass
    Chord-Accordion Accordion
    Chord-Guitar NylonGuitar
    Chord-Sus TremoloStrings
    Drum-Clave Claves
    Drum-Kick KickDrum1
    Drum-Phh PedalHiHat
    Drum-Snare SnareDrum1
    Drum-Tam Tambourine
    +
    diff --git a/mma/docs/html/lib/stdlib/lullaby.html b/mma/docs/html/lib/stdlib/lullaby.html index 500a312..76418d5 100644 --- a/mma/docs/html/lib/stdlib/lullaby.html +++ b/mma/docs/html/lib/stdlib/lullaby.html @@ -1,4 +1,4 @@ - +

    Lullaby

    diff --git a/mma/docs/html/lib/stdlib/mambo.html b/mma/docs/html/lib/stdlib/mambo.html index e93a912..88ca454 100644 --- a/mma/docs/html/lib/stdlib/mambo.html +++ b/mma/docs/html/lib/stdlib/mambo.html @@ -1,4 +1,4 @@ - +

    Mambo

    diff --git a/mma/docs/html/lib/stdlib/march.html b/mma/docs/html/lib/stdlib/march.html index 74f1b67..c8b874f 100644 --- a/mma/docs/html/lib/stdlib/march.html +++ b/mma/docs/html/lib/stdlib/march.html @@ -1,4 +1,4 @@ - +

    March

    diff --git a/mma/docs/html/lib/stdlib/merengue.html b/mma/docs/html/lib/stdlib/merengue.html index d70d4a2..cddbfea 100644 --- a/mma/docs/html/lib/stdlib/merengue.html +++ b/mma/docs/html/lib/stdlib/merengue.html @@ -1,8 +1,22 @@ - +

    Merengue

    This is a very fast dance rhythm native to the Dominican Republic. The demo song for this ``Compadre Pedro Juan''. Note that you'll have to double up on the tempo for this to sound right. Patterns are from ``Latin Rhythms: Mystery Unraveled'' by Victor Lopez. +

    + + + +
    +

    Variables

    +
    + + + + + +
    BandoneonOctave The Octave setting for the bandoneon (default=6)
    +

    • Merengue
    • Merengue1 diff --git a/mma/docs/html/lib/stdlib/metronome.html b/mma/docs/html/lib/stdlib/metronome.html index 7b23275..8be6656 100644 --- a/mma/docs/html/lib/stdlib/metronome.html +++ b/mma/docs/html/lib/stdlib/metronome.html @@ -1,4 +1,4 @@ - +

      Metronome

      diff --git a/mma/docs/html/lib/stdlib/metronome3.html b/mma/docs/html/lib/stdlib/metronome3.html index 88d83cf..15be6db 100644 --- a/mma/docs/html/lib/stdlib/metronome3.html +++ b/mma/docs/html/lib/stdlib/metronome3.html @@ -1,4 +1,4 @@ - +

      Metronome3

      diff --git a/mma/docs/html/lib/stdlib/modernjazz.html b/mma/docs/html/lib/stdlib/modernjazz.html index b219429..32d64f8 100644 --- a/mma/docs/html/lib/stdlib/modernjazz.html +++ b/mma/docs/html/lib/stdlib/modernjazz.html @@ -1,4 +1,4 @@ - +

      Modernjazz

      @@ -11,8 +11,12 @@
  • - - + + + + + +
    ApreggioVoice Voice for the alternating apreggios in ModernJazz1 (Default=MutedTrumpet). Also used in Introduction and Ending. ArpeggioVoice Voice for the alternating arpeggios in ModernJazz1 and ModernJazz2 (plus the SUS versions of 1 and 2).
    (Default=MutedTrumpet). Also used in Introduction and Ending.
    + + + + +
    +

    ModernJazz2

    + A slower version of alternate-bar trumpet for faster tempos. (4) +
    + + + + + + + + + + + +
    Arpeggio MutedTrumpet
    Bass-Trp MutedTrumpet
    Chord-Guitar JazzGuitar
    Chord-Piano Piano2
    Drum-Kick KickDrum1
    Drum-Ohh OpenHiHat
    Drum-Phh PedalHiHat
    Drum-Ride RideCymbal1
    Drum-Side SnareDrum1
    Walk AcousticBass
    +
    + + + + +
    +

    ModernJazz2Sus

    + Slower alternate-bar trumpets with violins for faster tempos. (4) +
    + + + + + + + + + + + + +
    Arpeggio MutedTrumpet
    Bass-Trp MutedTrumpet
    Chord-Guitar JazzGuitar
    Chord-Piano Piano2
    Chord-Sus VoiceOohs
    Drum-Kick KickDrum1
    Drum-Ohh OpenHiHat
    Drum-Phh PedalHiHat
    Drum-Ride RideCymbal1
    Drum-Side SnareDrum1
    Walk AcousticBass
    +
    diff --git a/mma/docs/html/lib/stdlib/pianoballad.html b/mma/docs/html/lib/stdlib/pianoballad.html index 0c11e71..60a424b 100644 --- a/mma/docs/html/lib/stdlib/pianoballad.html +++ b/mma/docs/html/lib/stdlib/pianoballad.html @@ -1,4 +1,4 @@ - +

    Pianoballad

    diff --git a/mma/docs/html/lib/stdlib/polka.html b/mma/docs/html/lib/stdlib/polka.html index a405a37..ea312ed 100644 --- a/mma/docs/html/lib/stdlib/polka.html +++ b/mma/docs/html/lib/stdlib/polka.html @@ -1,4 +1,4 @@ - +

    Polka

    @@ -13,6 +13,7 @@
  • Polka1Arp
  • Polka1SusArp
  • PolkaIntro +
  • PolkaIntro8
  • PolkaEnd @@ -193,6 +194,24 @@
  • + + + + +
    +

    PolkaIntro8

    + Expanded version of PolkaIntro for 8 bars. (8) +
    + + + + + + + + +
    Bass Tuba
    Chord Accordion
    Chord-Guitar JazzGuitar
    Drum Slap
    Drum-Cym CrashCymbal1
    Drum-Hh ClosedHiHat
    Drum-Snare SnareDrum1
    +
    diff --git a/mma/docs/html/lib/stdlib/popballad.html b/mma/docs/html/lib/stdlib/popballad.html index 8f49e7d..3188da2 100644 --- a/mma/docs/html/lib/stdlib/popballad.html +++ b/mma/docs/html/lib/stdlib/popballad.html @@ -1,4 +1,4 @@ - +

    Popballad

    diff --git a/mma/docs/html/lib/stdlib/quickstep.html b/mma/docs/html/lib/stdlib/quickstep.html index 37a4615..c7eb8e7 100644 --- a/mma/docs/html/lib/stdlib/quickstep.html +++ b/mma/docs/html/lib/stdlib/quickstep.html @@ -1,4 +1,4 @@ - +

    Quickstep

    @@ -11,6 +11,7 @@
  • QuickStepDuh
  • QuickStepDuhSus
  • QuickStepIntro +
  • QuickStepIntro8
  • QuickStepEnd @@ -139,6 +140,23 @@
  • + + + + +
    +

    QuickStepIntro8

    + The 4 bar intro stretched to 8. (8) +
    + + + + + + + +
    Bass AcousticBass
    Chord-Guitar JazzGuitar
    Chord-Piano Piano2
    Drum-Closedhh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Openhh OpenHiHat
    +
    diff --git a/mma/docs/html/lib/stdlib/rb-ballad.html b/mma/docs/html/lib/stdlib/rb-ballad.html new file mode 100644 index 0000000..6eb2725 --- /dev/null +++ b/mma/docs/html/lib/stdlib/rb-ballad.html @@ -0,0 +1,91 @@ + + + +

    Rb-Ballad

    +

    Rythmn and Blues ballad. Based on the R&B style, just made softer and prettier. Done for "Mercy, Mercy, Mercy". +

    + + + + +
    +

    R&B-Ballad

    + Basic R&B Ballad. (4) +
    + + + + + + + + + + +
    Bass AcousticBass
    Chord Piano2
    Chord-Organ Organ1
    Drum-Clap HandClap
    Drum-Kick KickDrum1
    Drum-Ride RideCymbal1
    Drum-Snare SnareDrum2
    Drum-Tam Tambourine
    Walk AcousticBass
    +
    + + + + +
    +

    R&B-BalladSus

    + Change rhythmic organ to sustained chords. (4) +
    + + + + + + + + + + +
    Bass AcousticBass
    Chord Piano2
    Chord-Organ Organ1
    Drum-Clap HandClap
    Drum-Kick KickDrum1
    Drum-Ride RideCymbal1
    Drum-Snare SnareDrum2
    Drum-Tam Tambourine
    Walk AcousticBass
    +
    + + + + +
    +

    R&B-BalladIntro

    + A bit laid-back, 4 bar intro. (4) +
    + + + + + + + + + +
    Bass AcousticBass
    Chord Piano2
    Chord-Organ Organ1
    Drum-Clap HandClap
    Drum-Kick KickDrum1
    Drum-Ride RideCymbal1
    Drum-Snare SnareDrum2
    Drum-Tam Tambourine
    +
    + + + + +
    +

    R&B-BalladEnd

    + Two bar ending. (2) +
    + + + + + + + + + +
    Bass AcousticBass
    Chord Piano2
    Chord-Organ Organ1
    Drum-Clap HandClap
    Drum-Kick KickDrum1
    Drum-Ride RideCymbal1
    Drum-Snare SnareDrum2
    Drum-Tam Tambourine
    +
    + + diff --git a/mma/docs/html/lib/stdlib/rb.html b/mma/docs/html/lib/stdlib/rb.html index 9d0ee13..b36b31c 100644 --- a/mma/docs/html/lib/stdlib/rb.html +++ b/mma/docs/html/lib/stdlib/rb.html @@ -1,4 +1,4 @@ - +

    Rb

    diff --git a/mma/docs/html/lib/stdlib/rhumba.html b/mma/docs/html/lib/stdlib/rhumba.html index c4cd2d6..770dd38 100644 --- a/mma/docs/html/lib/stdlib/rhumba.html +++ b/mma/docs/html/lib/stdlib/rhumba.html @@ -1,4 +1,4 @@ - +

    Rhumba

    diff --git a/mma/docs/html/lib/stdlib/rock-128.html b/mma/docs/html/lib/stdlib/rock-128.html index fd2308c..967bc4b 100644 --- a/mma/docs/html/lib/stdlib/rock-128.html +++ b/mma/docs/html/lib/stdlib/rock-128.html @@ -1,4 +1,4 @@ - +

    Rock-128

    diff --git a/mma/docs/html/lib/stdlib/rockballad.html b/mma/docs/html/lib/stdlib/rockballad.html index e2576d5..b023fc6 100644 --- a/mma/docs/html/lib/stdlib/rockballad.html +++ b/mma/docs/html/lib/stdlib/rockballad.html @@ -1,4 +1,4 @@ - +

    Rockballad

    @@ -27,7 +27,9 @@
  • RockBalladFill
  • RockBallad1Fill
  • RockBalladVoice +
  • RockBallad1Voice
  • RockBalladIntro +
  • RockBalladSusIntro
  • RockBalladEnd
  • RockBalladEnd1 @@ -119,6 +121,24 @@
  • + + + + +
    +

    RockBallad1Voice

    + Cheese without 4th bar triplets. (4) +
    + + + + + + + + +
    Bass FretlessBass
    Chord JazzGuitar
    Chord-Sus ChoirAahs
    Drum ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Walk FretlessBass
    +
    - +
    @@ -132,7 +152,23 @@
    Drum ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Walk FretlessBass
    + + + + + +
    +

    RockBalladSusIntro

    + 4 bar intro with mostly strings. (4) +
    + + + + + + +
    Bass FretlessBass
    Chord JazzGuitar
    Chord-Sus ChoirAahs
    Drum ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    diff --git a/mma/docs/html/lib/stdlib/rockwaltz.html b/mma/docs/html/lib/stdlib/rockwaltz.html new file mode 100644 index 0000000..0054892 --- /dev/null +++ b/mma/docs/html/lib/stdlib/rockwaltz.html @@ -0,0 +1,263 @@ + + + +

    Rockwaltz

    +

    This is our basic 3/4 waltz with added guitars and a bit of raunch. +

    + + + + +
    +

    RockWaltz

    + Hold tight for this dance. (4) +
    + + + + + + + + +
    Bass PickedBass
    Chord CleanGuitar
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltzSus

    + Add strings to RockWaltz. (4) +
    + + + + + + + + + +
    Bass PickedBass
    Chord CleanGuitar
    Chord-Sus Strings
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltz1

    + Add piano apreggios to the RockWaltz. (4) +
    + + + + + + + + + + +
    Arpeggio CleanGuitar
    Bass PickedBass
    Chord CleanGuitar
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Scale CleanGuitar
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltz1Sus

    + RockWaltz with arpeggios and sustained strings. (4) +
    + + + + + + + + + + + +
    Arpeggio CleanGuitar
    Bass PickedBass
    Chord CleanGuitar
    Chord-Sus Strings
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Scale CleanGuitar
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltzWalk

    + Walking bass version of RockWaltz. (4) +
    + + + + + + + +
    Chord CleanGuitar
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltzWalkSus

    + Walking bass and sustained strings. (4) +
    + + + + + + + + +
    Chord CleanGuitar
    Chord-Sus Strings
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltz1Walk

    + Walking bass and arpeggios. (4) +
    + + + + + + + + + +
    Arpeggio CleanGuitar
    Chord CleanGuitar
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Scale CleanGuitar
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltz1WalkSus

    + Walking bass, arpeggios and sustained strings. (4) +
    + + + + + + + + + + +
    Arpeggio CleanGuitar
    Chord CleanGuitar
    Chord-Sus Strings
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Scale CleanGuitar
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltzIntro

    + RockWaltz intro with guitar chords. (4) +
    + + + + + + + + +
    Bass PickedBass
    Chord CleanGuitar
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltz1Intro

    + RockWaltz intro with arpeggios. (4) +
    + + + + + + + + +
    Arpeggio CleanGuitar
    Bass PickedBass
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltzIntro8

    + 8 bar RockWaltz intro with guitar chords. (8) +
    + + + + + + + + +
    Bass PickedBass
    Chord CleanGuitar
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltz1intro8

    + 8 bar RockWaltz intro with arpeggios. (8) +
    + + + + + + + + +
    Arpeggio Piano1
    Bass PickedBass
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk PickedBass
    +
    + + + + +
    +

    RockWaltzEnd

    + Simple 4 bar ending. (4) +
    + + + + + + + +
    Bass PickedBass
    Chord CleanGuitar
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    +
    + + diff --git a/mma/docs/html/lib/stdlib/salsa.html b/mma/docs/html/lib/stdlib/salsa.html new file mode 100644 index 0000000..f93d1f7 --- /dev/null +++ b/mma/docs/html/lib/stdlib/salsa.html @@ -0,0 +1,114 @@ + + + +

    Salsa

    +

    Salsa just means ``saucy'' or ``spicy'' and is based on son and rhumba patterns. This is created from scratch. I use it for a Peggy Lee styled version of the Cole Porter tune ``Always True To You In My Fashion.'' +

    + + + + +
    +

    Salsa

    + Basic Salsa pattern. (2) +
    + + + + + + + + + + +
    Bass JazzGuitar
    Chord Piano1
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Cowbell CowBell
    Drum-Lbell LowAgogo
    Drum-Lbongo LowBongo
    Drum-Lguiro LongGuiro
    Drum-Sguiro ShortGuiro
    +
    + + + + +
    +

    SalsaSus

    + Basic pattern with added strings. (2) +
    + + + + + + + + + + + +
    Bass JazzGuitar
    Chord Piano1
    Chord-Sus SynthStrings1
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Cowbell CowBell
    Drum-Lbell LowAgogo
    Drum-Lbongo LowBongo
    Drum-Lguiro LongGuiro
    Drum-Sguiro ShortGuiro
    +
    + + + + +
    +

    SalsaIntro

    + A 4 bar introduction. (4) +
    + + + + + + + + + + +
    Bass JazzGuitar
    Chord Piano1
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Cowbell CowBell
    Drum-Lbell LowAgogo
    Drum-Lbongo LowBongo
    Drum-Lguiro LongGuiro
    Drum-Sguiro ShortGuiro
    +
    + + + + +
    +

    SalsaFill

    + Straight, 1 bar fill. (1) +
    + + + + + + + + + +
    Bass JazzGuitar
    Chord Piano1
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Cowbell CowBell
    Drum-Lbell LowAgogo
    Drum-Lbongo LowBongo
    Drum-Sguiro ShortGuiro
    +
    + + + + +
    +

    SalsaEnd

    + Fast, 2 bar ending (2) +
    + + + + + + + + + + +
    Bass JazzGuitar
    Chord Piano1
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Cowbell CowBell
    Drum-Lbell LowAgogo
    Drum-Lbongo LowBongo
    Drum-Lguiro LongGuiro
    Drum-Sguiro ShortGuiro
    +
    + + diff --git a/mma/docs/html/lib/stdlib/samba.html b/mma/docs/html/lib/stdlib/samba.html index 30fa59a..801c48b 100644 --- a/mma/docs/html/lib/stdlib/samba.html +++ b/mma/docs/html/lib/stdlib/samba.html @@ -1,4 +1,4 @@ - +

    Samba

    @@ -37,7 +37,7 @@

    SambaFill

    - Adds a whistle to the sandard beat. (4) + Adds a whistle to the standard beat. (4)
    diff --git a/mma/docs/html/lib/stdlib/showtune.html b/mma/docs/html/lib/stdlib/showtune.html new file mode 100644 index 0000000..4818d29 --- /dev/null +++ b/mma/docs/html/lib/stdlib/showtune.html @@ -0,0 +1,168 @@ + + + +

    Showtune

    +

    An attempt for an orchestral backing for showtunes. I use this for ``I Loved You Once In Silence'' from ``Camelot''. Lots of strings and no drumkit. +

    +

    + + +
    +

    Variables

    +
    + + + + + + + + + +
    ExtraVoice Voice for the alternating arpeggios in ShowTune2 (Default=TubularBells).
    ExtraOctave Octave for ExtraVoice (Default=6).
    +
    + + + + + +
    +

    ShowTune

    + Basic track with strings. (4) +
    + + + + + +
    Bass-Guitar AcousticBass
    Bass-Timp Timpani
    Chord-Flute Flute
    Chord-String Strings
    +
    + + + + +
    +

    ShowTune1

    + Add in pizzicato strings. (4) +
    + + + + + + + +
    Arpeggio-Piz PizzicatoString
    Bass-Guitar AcousticBass
    Bass-Timp Timpani
    Chord-Flute Flute
    Chord-Piz PizzicatoString
    Chord-String Strings
    +
    + + + + +
    +

    ShowTune2

    + Basic version with extra ''stuff''. Set voice with ``ExtraVoice''. (4) +
    + + + + + + +
    Arpeggio-Extra TubularBells
    Bass-Guitar AcousticBass
    Bass-Timp Timpani
    Chord-Flute Flute
    Chord-String Strings
    +
    + + + + +
    +

    ShowTunePlus

    + Add trumpet arpeggios. (4) +
    + + + + + + + +
    Arpeggio-Horn FrenchHorn
    Arpeggio-Trumpet Trumpet
    Bass-Guitar AcousticBass
    Bass-Timp Timpani
    Chord-Flute Flute
    Chord-String Strings
    +
    + + + + +
    +

    ShowTune1Plus

    + Add trumpets and plucked strings. (4) +
    + + + + + + + + + +
    Arpeggio-Horn FrenchHorn
    Arpeggio-Piz PizzicatoString
    Arpeggio-Trumpet Trumpet
    Bass-Guitar AcousticBass
    Bass-Timp Timpani
    Chord-Flute Flute
    Chord-Piz PizzicatoString
    Chord-String Strings
    +
    + + + + +
    +

    ShowTune2Plus

    + Add trumpets and ``extra''. (4) +
    + + + + + + + + +
    Arpeggio-Extra TubularBells
    Arpeggio-Horn FrenchHorn
    Arpeggio-Trumpet Trumpet
    Bass-Guitar AcousticBass
    Bass-Timp Timpani
    Chord-Flute Flute
    Chord-String Strings
    +
    + + + + +
    +

    ShowTuneIntro

    + 4 bar intro with plucked strings. (4) +
    + + + + + + + +
    Arpeggio-Piz PizzicatoString
    Bass-Guitar AcousticBass
    Bass-Timp Timpani
    Chord-Flute Flute
    Chord-Piz PizzicatoString
    Chord-String Strings
    +
    + + + + +
    +

    ShowTuneEnd

    + A pretty dull ending. (2) +
    + + + + +
    Bass-Guitar AcousticBass
    Chord-Flute Flute
    Chord-String Strings
    +
    + + diff --git a/mma/docs/html/lib/stdlib/shuffleboggie.html b/mma/docs/html/lib/stdlib/shuffleboggie.html index f67ce1c..68ceee6 100644 --- a/mma/docs/html/lib/stdlib/shuffleboggie.html +++ b/mma/docs/html/lib/stdlib/shuffleboggie.html @@ -1,4 +1,4 @@ - +

    Shuffleboggie

    @@ -10,6 +10,7 @@
  • ShuffleBoggieIntro
  • ShuffleBoggieIntro4
  • ShuffleBoggieEnd +
  • ShuffleBoggieFill @@ -133,5 +134,24 @@
  • + + + + +
    +

    ShuffleBoggieFill

    + Single bar fill. (1) +
    + + + + + + + + + +
    Bass SlapBass1
    Chord-Guitar MutedGuitar
    Chord-Piano Piano2
    Chord-Sax TenorSax
    Drum-Clap HandClap
    Drum-Kick KickDrum1
    Drum-Ohh OpenHiHat
    Drum-Snare SnareDrum2
    +
    diff --git a/mma/docs/html/lib/stdlib/ska.html b/mma/docs/html/lib/stdlib/ska.html index e3d90c8..f9d4111 100644 --- a/mma/docs/html/lib/stdlib/ska.html +++ b/mma/docs/html/lib/stdlib/ska.html @@ -1,4 +1,4 @@ - +

    Ska

    diff --git a/mma/docs/html/lib/stdlib/slowblues.html b/mma/docs/html/lib/stdlib/slowblues.html index 3232060..079b724 100644 --- a/mma/docs/html/lib/stdlib/slowblues.html +++ b/mma/docs/html/lib/stdlib/slowblues.html @@ -1,4 +1,4 @@ - +

    Slowblues

    diff --git a/mma/docs/html/lib/stdlib/slowbolero.html b/mma/docs/html/lib/stdlib/slowbolero.html index 3d62f6f..72c8f66 100644 --- a/mma/docs/html/lib/stdlib/slowbolero.html +++ b/mma/docs/html/lib/stdlib/slowbolero.html @@ -1,4 +1,4 @@ - +

    Slowbolero

    diff --git a/mma/docs/html/lib/stdlib/slowbroadway.html b/mma/docs/html/lib/stdlib/slowbroadway.html new file mode 100644 index 0000000..a67beff --- /dev/null +++ b/mma/docs/html/lib/stdlib/slowbroadway.html @@ -0,0 +1,133 @@ + + + +

    Slowbroadway

    +

    This is slower version of the "broadway" rhythm. It works in 4/4 time and is voicing compatible. Written for an upbeat version of "Some Enchanted Evening". +

    + + + + +
    +

    SlowBroadway

    + A corny Broadway tune rhythm. (4) +
    + + + + + + + + + +
    Bass AcousticBass
    Chord-Gloc Glockenspiel
    Chord-Piz PizzicatoString
    Drum-Hih1 ClosedHiHat
    Drum-Hih2 ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    +
    + + + + +
    +

    SlowBroadway1

    + Add in arpegiating flute. (4) +
    + + + + + + + + + + +
    Arpeggio Flute
    Bass AcousticBass
    Chord-Gloc Glockenspiel
    Chord-Piz PizzicatoString
    Drum-Hih1 ClosedHiHat
    Drum-Hih2 ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    +
    + + + + +
    +

    SlowBroadwaySus

    + Add sustained strings. (4) +
    + + + + + + + + + + +
    Bass AcousticBass
    Chord-Gloc Glockenspiel
    Chord-Piz PizzicatoString
    Chord-Sus Strings
    Drum-Hih1 ClosedHiHat
    Drum-Hih2 ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    +
    + + + + +
    +

    SlowBroadway1Sus

    + Sustained strings and apregiating flute. (4) +
    + + + + + + + + + + + +
    Arpeggio Flute
    Bass AcousticBass
    Chord-Gloc Glockenspiel
    Chord-Piz PizzicatoString
    Chord-Sus Strings
    Drum-Hih1 ClosedHiHat
    Drum-Hih2 ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    +
    + + + + +
    +

    SlowBroadwayIntro

    + Simple 4 bar intro. (4) +
    + + + + + + + + + +
    Bass AcousticBass
    Chord-Gloc Glockenspiel
    Chord-Piz PizzicatoString
    Drum-Hih1 ClosedHiHat
    Drum-Hih2 ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    +
    + + + + +
    +

    SlowBroadwayEnd

    + A 2 bar ending. (2) +
    + + + + + + + + + +
    Bass AcousticBass
    Chord-Gloc Glockenspiel
    Chord-Piz PizzicatoString
    Drum-Hih1 ClosedHiHat
    Drum-Hih2 ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    +
    + + diff --git a/mma/docs/html/lib/stdlib/slowcountry.html b/mma/docs/html/lib/stdlib/slowcountry.html index 01080d2..9be3bea 100644 --- a/mma/docs/html/lib/stdlib/slowcountry.html +++ b/mma/docs/html/lib/stdlib/slowcountry.html @@ -1,4 +1,4 @@ - +

    Slowcountry

    diff --git a/mma/docs/html/lib/stdlib/slowjazz.html b/mma/docs/html/lib/stdlib/slowjazz.html index 42e9150..256e62c 100644 --- a/mma/docs/html/lib/stdlib/slowjazz.html +++ b/mma/docs/html/lib/stdlib/slowjazz.html @@ -1,4 +1,4 @@ - +

    Slowjazz

    @@ -14,6 +14,7 @@
  • SlowJazz1WalkSus
  • SlowJazz2
  • SlowJazz2Sus +
  • SlowJazzFill
  • SlowJazzIntro
  • SlowJazz1Intro
  • SlowJazz2Intro @@ -191,6 +192,21 @@ + + + + +
    +

    SlowJazzFill

    + One bar fill with a decending bass walk. (1) +
    + + + + + +
    Bass AcousticBass
    Chord Piano2
    Drum-Hh RideCymbal2
    Drum-Shake Shaker
    +
    diff --git a/mma/docs/html/lib/stdlib/softrock.html b/mma/docs/html/lib/stdlib/softrock.html index 2418439..6c27f14 100644 --- a/mma/docs/html/lib/stdlib/softrock.html +++ b/mma/docs/html/lib/stdlib/softrock.html @@ -1,4 +1,4 @@ - +

    Softrock

    diff --git a/mma/docs/html/lib/stdlib/softshoe.html b/mma/docs/html/lib/stdlib/softshoe.html index 6f6971c..6386094 100644 --- a/mma/docs/html/lib/stdlib/softshoe.html +++ b/mma/docs/html/lib/stdlib/softshoe.html @@ -1,4 +1,4 @@ - +

    Softshoe

    diff --git a/mma/docs/html/lib/stdlib/son.html b/mma/docs/html/lib/stdlib/son.html index 2e9574c..a5537f8 100644 --- a/mma/docs/html/lib/stdlib/son.html +++ b/mma/docs/html/lib/stdlib/son.html @@ -1,11 +1,31 @@ - +

    Son

    The Son or Son Montuno is a traditional Cuban rhythm. The song ``Alma De Mujer'' in the sample songs uses this. For the most part I've developed the patterns right from ``Latin Rhythms: Mystery Unraveled'' by Victor Lopez. +

    + + + +
    +

    Variables

    +
    + + + + + + + + + +
    ArpeggioVoice Voice for the alternating apreggios in the Plus versions (Default=Flute).
    ApreggioOctave Base octave for apreggios in Plus versions. (Default=6)
    +

    @@ -13,6 +33,7 @@

    Son

    +

    Aliases: Fill-Cc, Fill-Bb, Main-D, Fill-Dd, Main-B, Main-C, Main-A, Fill-Aa

    Our basic Son rhythm. (2)
    @@ -35,6 +56,7 @@

    SonSus

    +

    Aliases: Main-Asus, Main-Dsus, Main-Bsus, Main-Csus

    Son with sustained strings. (2)
    @@ -54,10 +76,58 @@
    + + + + +
    +

    SonPlus

    + Son with flute arpeggios (2) +
    + + + + + + + + + + + + + +
    Arpeggio Flute
    Bass JazzGuitar
    Chord Piano2
    Drum-Claves Claves
    Drum-Cymbal RideCymbal1
    Drum-Hbongo HighBongo
    Drum-Hconga OpenHighConga
    Drum-Lbongo LowBongo
    Drum-Lconga LowConga
    Drum-Lowtom LowTom1
    Drum-Maraca Maracas
    Drum-Sguiro ShortGuiro
    +
    + + + + +
    +

    SonSusPlus

    + Sustained with flute apreggios. (2) +
    + + + + + + + + + + + + + + +
    Arpeggio Flute
    Bass JazzGuitar
    Chord Piano2
    Chord-Sus Strings
    Drum-Claves Claves
    Drum-Cymbal RideCymbal1
    Drum-Hbongo HighBongo
    Drum-Hconga OpenHighConga
    Drum-Lbongo LowBongo
    Drum-Lconga LowConga
    Drum-Lowtom LowTom1
    Drum-Maraca Maracas
    Drum-Sguiro ShortGuiro
    +

    SonIntro

    +

    Aliases: Intro-B, Intro-C, Intro-A, Intro-D

    Boring, four bar introduction. (4)
    @@ -80,6 +150,7 @@

    SonEnd

    +

    Aliases: Ending-A, Ending-C, Ending-B, Ending-D

    Simple ending. (2)
    diff --git a/mma/docs/html/lib/stdlib/swing.html b/mma/docs/html/lib/stdlib/swing.html index 2929643..f641e8c 100644 --- a/mma/docs/html/lib/stdlib/swing.html +++ b/mma/docs/html/lib/stdlib/swing.html @@ -1,4 +1,4 @@ - +

    Swing

    diff --git a/mma/docs/html/lib/stdlib/tango.html b/mma/docs/html/lib/stdlib/tango.html index 6a7e6f8..3aaf004 100644 --- a/mma/docs/html/lib/stdlib/tango.html +++ b/mma/docs/html/lib/stdlib/tango.html @@ -1,4 +1,4 @@ - +

    Tango

    diff --git a/mma/docs/html/lib/stdlib/trance.html b/mma/docs/html/lib/stdlib/trance.html new file mode 100644 index 0000000..d638845 --- /dev/null +++ b/mma/docs/html/lib/stdlib/trance.html @@ -0,0 +1,203 @@ + + + +

    Trance

    +

    My first adventure in the great land of boring dance and techno beats. +

    + + + + +
    +

    Trance

    + A smooth techno beat. (4) +
    + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Gob Goblins
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + + + +
    +

    Trance1

    + Adds an annoying repetition to the beat. (4) +
    + + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Brass BrassSection
    Chord-Gob Goblins
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + + + +
    +

    Trance2

    + Changes repeating brass to 8ths and kills space sounds. (4) +
    + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Brass BrassSection
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + + + +
    +

    TranceBass1

    + Same as Trance, with long bass on 1,3. (4) +
    + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Gob Goblins
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + + + +
    +

    Trance1Bass1

    + Same as Trance1, with long bass on 1,3. (4) +
    + + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Brass BrassSection
    Chord-Gob Goblins
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + + + +
    +

    Trance2Bass1

    + Same as Trance2, with long bass on 1,3. (4) +
    + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Brass BrassSection
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + + + +
    +

    TranceIntro

    + Hypnotic intro? (4) +
    + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Gob Goblins
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + + + +
    +

    TranceEnd

    + Fading ending, nothing on beats 3/4 of final bar. (4) +
    + + + + + + + + + + + + + +
    Bass SynthBass1
    Chord-Gob Goblins
    Chord-Guitar NylonGuitar
    Chord-Warm WarmPad
    Drum-105 105
    Drum-Clap HandClap
    Drum-Hh PedalHiHat
    Drum-Kick KickDrum1
    Drum-Mutetri MuteTriangle
    Drum-Ohh OpenHiHat
    Drum-Opentri OpenTriangle
    Drum-Tam Tambourine
    +
    + + diff --git a/mma/docs/html/lib/stdlib/vienesewaltz.html b/mma/docs/html/lib/stdlib/vienesewaltz.html index 638793b..2b9670a 100644 --- a/mma/docs/html/lib/stdlib/vienesewaltz.html +++ b/mma/docs/html/lib/stdlib/vienesewaltz.html @@ -1,4 +1,4 @@ - +

    Vienesewaltz

    diff --git a/mma/docs/html/lib/stdlib/waltz.html b/mma/docs/html/lib/stdlib/waltz.html index 68127dd..b3a2365 100644 --- a/mma/docs/html/lib/stdlib/waltz.html +++ b/mma/docs/html/lib/stdlib/waltz.html @@ -1,4 +1,4 @@ - +

    Waltz

    @@ -14,6 +14,8 @@
  • Waltz1WalkSus
  • WaltzIntro
  • Waltz1Intro +
  • WaltzIntro8 +
  • Waltz1intro8
  • WaltzEnd @@ -204,6 +206,42 @@
  • + + + + +
    +

    WaltzIntro8

    + 8 bar waltz intro with piano chords. (8) +
    + + + + + + + + +
    Bass AcousticBass
    Chord Piano1
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk AcousticBass
    +
    + + + + +
    +

    Waltz1intro8

    + 8 bar wWaltz intro with piano arpeggios. (8) +
    + + + + + + + + +
    Arpeggio Piano1
    Bass AcousticBass
    Drum-Chh ClosedHiHat
    Drum-Kick KickDrum1
    Drum-Snare SnareDrum1
    Drum-Tri OpenTriangle
    Walk AcousticBass
    +
    - + - + - + @@ -203,7 +213,10 @@ for each time event:

    -In the above table the ``..'' notation indicates that the offset is +In the above table the ``$\Rightarrow$'' indicates that the offset is out-of-range and converted to the second value.

    @@ -216,7 +229,7 @@ Please note the following:

      -
    • ARIAs are not saved or modified by GROOVE commands. Well, almost +
    • ARIAs are not saved or modified by GROOVE commands. Well, almost ...the sequence size will be adjusted to match the new size from the groove. This might be unexpected: @@ -233,7 +246,7 @@ groove. This might be unexpected:
    • Process a few bars of music.
    • Load a new groove, but this time with a SEQSIZE of 2. Now, the - ARIA will be truncated. This behaviour is duplicated in other + ARIA will be truncated. This behavior is duplicated in other tracks as well, but it might be unexpected here.
    @@ -250,35 +263,38 @@ the entire sequence.

    You can make dramatic changes to your songs with a few simple tricks. Try modifying the DIRECTION settings just slightly; use -several patterns and SEQRND to generate less predicable +several patterns and SEQRND to generate less predictable patterns; use HARMONLYONLY with a different voice and pattern.

    Oh, and have fun!

    -


    + +

    + +

    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node12.html b/mma/docs/html/ref/node12.html index 95eb149..f1c8cd4 100644 --- a/mma/docs/html/ref/node12.html +++ b/mma/docs/html/ref/node12.html @@ -1,4 +1,4 @@ - + -Chord Voicing - +Randomizing + @@ -25,1283 +25,302 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next:Harmony - Up: Next: Chord Voicing + Up:Reference Manual - Previous: Previous: Automatic Melodies: Aria Tracks
    -
    +
    Subsections -
      -
    • Voicing - -
      -
    • ChordAdjust -
    • Compress -
    • DupRoot -
    • Invert -
    • Limit -
    • NoteSpan -
    • Range -
    • DefChord -
    • PrintChord -
    • Notes +

      - +
      -Chord Voicing +Randomizing

      -In music, a chord is simply defined as two more notes played -simultaneously. Now, this doesn't mean that you can play just any two -or three notes and get a chord which sounds nice--but whatever you do -get will be a chord of some type. And, to further confuse the unwary, -different arrangements of the same notes sound better (or worse) in -different musical situations. - -

      -As a simple example, consider a C major chord. Built on the first, -third and fifth notes of a C major scale it can be manipulated into a -variety of sounds: - -

      -

      - Lost Image - -
      - -

      -These are all C major chords ...but they all have a different -sound or color. The different forms a chord can take are called -``voicings''. Again, this manual is not intended to be a primer on -musical theory--that's a subject for which lots of lessons with your -favorite music teacher is recommended. You'll need a bit of -basic music theory if you want to understand how and why -MMA creates its tracks. - -

      -The different options in this chapter effect not only the way chords -are constructed, but also the way bass lines and other tracks are -formed. - -

      -There are generally two ways in -MMA to take care of voicings. - -

      - -

        -
      1. use -MMA 's extensive VOICING options, most likely with - the ''Optimal'' voicing algorithm, - -

        -

      2. -
      3. do everything by yourself with the commands INVERT and - COMPRESS. - -

        -

      4. -
      - -

      -The commands LIMIT and DUPROOT may be used independently -for both variants. +One criticism of computer generated music is that all to often it's +too predictable or mechanical sounding. Again, in +MMA we're not +trying to replace real, flesh and blood musicians, but applying some +randomization to the way in which tracks are generated can help bridge +the human--mechanical gap.

      -Voicing +RndSeed

      -The VOICING command is used to set the voicing mode and several -other options relating to the selected mode. The command needs to have -a CHORD track specified and a series of Option=Value pairs. For -example: +All of the random functions (RTIME, RSKIP, etc.) in + +MMA depend on the Python random module. Each time +MMA generates a track the values generated by the random functions will be +different. In most cases this is a ``good thing''; however, you may +want +MMA to use the same sequence of random values12.1 each time it generates a +track. Simple: just use:

    diff --git a/mma/docs/html/lib/stdlib/zydeco.html b/mma/docs/html/lib/stdlib/zydeco.html index 6a77458..cc57a57 100644 --- a/mma/docs/html/lib/stdlib/zydeco.html +++ b/mma/docs/html/lib/stdlib/zydeco.html @@ -1,4 +1,4 @@ - +

    Zydeco

    diff --git a/mma/docs/html/lib/yamaha/mambo.html b/mma/docs/html/lib/yamaha/mambo.html index da3d8e9..26bd016 100644 --- a/mma/docs/html/lib/yamaha/mambo.html +++ b/mma/docs/html/lib/yamaha/mambo.html @@ -1,4 +1,4 @@ - +

    Mambo

    diff --git a/mma/docs/html/lib/yamaha/quando-g.s280.html b/mma/docs/html/lib/yamaha/quando-g.s280.html index 83980ac..c21bd10 100644 --- a/mma/docs/html/lib/yamaha/quando-g.s280.html +++ b/mma/docs/html/lib/yamaha/quando-g.s280.html @@ -1,4 +1,4 @@ - +

    Quando-G.S280

    diff --git a/mma/docs/html/lib/yamaha/salsa1.html b/mma/docs/html/lib/yamaha/salsa1.html new file mode 100644 index 0000000..1971c5a --- /dev/null +++ b/mma/docs/html/lib/yamaha/salsa1.html @@ -0,0 +1,280 @@ + + + +

    Salsa1

    +

    Original file: sty/salsa1.sty ... insert your comments here! +

    + + + + +
    +

    Main-A

    + Auto-generated 'Main A' sty/salsa1.sty (4) +
    + + + + + + + + + + + + + +
    Bass-11 AcousticBass
    Chord-12 Piano1
    Drum-Cabasa Cabasa
    Drum-Cowbell CowBell
    Drum-Highbongo HighBongo
    Drum-Kickdrum1 KickDrum1
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    +
    + + + + +
    +

    Intro-A

    + Auto-generated 'Intro A' sty/salsa1.sty (2) +
    + + + + + + + + + + + + + +
    Bass-14 SlowStrings
    Chord-12 Piano1
    Chord-13 Vibraphone
    Drum-Cabasa Cabasa
    Drum-Hightimbale HighTimbale
    Drum-Lowagogo LowAgogo
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Lowtom1 LowTom1
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    +
    + + + + +
    +

    Fill-AA

    + Auto-generated 'Fill In AA' sty/salsa1.sty (1) +
    + + + + + + + + + + + + + + + +
    Bass-16 FretlessBass
    Chord-13 Vibraphone
    Drum-Closedhihat ClosedHiHat
    Drum-Crashcymbal1 CrashCymbal1
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Lowconga LowConga
    Drum-Lowtimbale LowTimbale
    Drum-Lowtom1 LowTom1
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Pedalhihat PedalHiHat
    Drum-Shortguiro ShortGuiro
    Drum-Snaredrum1 SnareDrum1
    +
    + + + + +
    +

    Fill-AB

    + Auto-generated 'Fill In AB' sty/salsa1.sty (1) +
    + + + + + + + + + + + + + + + + +
    Bass-15 BrassSection
    Bass-16 FretlessBass
    Chord-13 Vibraphone
    Drum-Closedhihat ClosedHiHat
    Drum-Crashcymbal1 CrashCymbal1
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Lowconga LowConga
    Drum-Lowtimbale LowTimbale
    Drum-Lowtom1 LowTom1
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Pedalhihat PedalHiHat
    Drum-Shortguiro ShortGuiro
    Drum-Snaredrum1 SnareDrum1
    +
    + + + + +
    +

    Ending-A

    + Auto-generated 'Ending A' sty/salsa1.sty (3) +
    + + + + + + + + + + + + + + + + +
    Bass-16 FretlessBass
    Chord-13 Vibraphone
    Drum-Cabasa Cabasa
    Drum-Closedhihat ClosedHiHat
    Drum-Cowbell CowBell
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Longlowwhistle LongLowWhistle
    Drum-Lowagogo LowAgogo
    Drum-Lowconga LowConga
    Drum-Lowtom1 LowTom1
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    +
    + + + + +
    +

    Main-B

    + Auto-generated 'Main B' sty/salsa1.sty (4) +
    + + + + + + + + + + + + + + + + + + +
    Bass-14 SlowStrings
    Bass-16 FretlessBass
    Chord-13 Vibraphone
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Highbongo HighBongo
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Lowagogo LowAgogo
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Lowtimbale LowTimbale
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    Drum-Ridecymbal1 RideCymbal1
    Drum-Snaredrum1 SnareDrum1
    +
    + + + + +
    +

    Intro-B

    + Auto-generated 'Intro B' sty/salsa1.sty (2) +
    + + + + + + + + + + + + +
    Bass-14 SlowStrings
    Chord-13 Vibraphone
    Drum-Cabasa Cabasa
    Drum-Hightimbale HighTimbale
    Drum-Lowagogo LowAgogo
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Lowtom1 LowTom1
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    +
    + + + + +
    +

    Fill-BB

    + Auto-generated 'Fill In BB' sty/salsa1.sty (1) +
    + + + + + + + + + + + + + + + + + + + + + +
    Bass-15 BrassSection
    Bass-16 FretlessBass
    Chord-13 Vibraphone
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Crashcymbal1 CrashCymbal1
    Drum-Highbongo HighBongo
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Lowagogo LowAgogo
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Lowtimbale LowTimbale
    Drum-Lowtom1 LowTom1
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    Drum-Ridecymbal1 RideCymbal1
    Drum-Shorthiwhistle ShortHiWhistle
    Drum-Snaredrum1 SnareDrum1
    +
    + + + + +
    +

    Fill-BA

    + Auto-generated 'Fill In BA' sty/salsa1.sty (1) +
    + + + + + + + + + + + + + + + + + + + + +
    Bass-16 FretlessBass
    Chord-13 Vibraphone
    Drum-Cabasa Cabasa
    Drum-Claves Claves
    Drum-Crashcymbal1 CrashCymbal1
    Drum-Highbongo HighBongo
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Lowagogo LowAgogo
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Lowtimbale LowTimbale
    Drum-Lowtom1 LowTom1
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    Drum-Ridecymbal1 RideCymbal1
    Drum-Shorthiwhistle ShortHiWhistle
    Drum-Snaredrum1 SnareDrum1
    +
    + + + + +
    +

    Ending-B

    + Auto-generated 'Ending B' sty/salsa1.sty (3) +
    + + + + + + + + + + + + + + + + + +
    Bass-15 BrassSection
    Bass-16 FretlessBass
    Chord-13 Vibraphone
    Drum-Cabasa Cabasa
    Drum-Closedhihat ClosedHiHat
    Drum-Cowbell CowBell
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Longlowwhistle LongLowWhistle
    Drum-Lowagogo LowAgogo
    Drum-Lowconga LowConga
    Drum-Lowtom1 LowTom1
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    +
    + + diff --git a/mma/docs/html/lib/yamaha/salsa2.html b/mma/docs/html/lib/yamaha/salsa2.html new file mode 100644 index 0000000..1e8e7b1 --- /dev/null +++ b/mma/docs/html/lib/yamaha/salsa2.html @@ -0,0 +1,268 @@ + + + +

    Salsa2

    +

    Original file: salsa2.sty ... insert your comments here! +

    + + + + +
    +

    Main-A

    + Auto-generated 'Main A' salsa2.sty (4) +
    + + + + + + + + + + + +
    Bass-11 AcousticBass
    Bass-14 BrassSection
    Chord-12 Piano1
    Drum-Cowbell CowBell
    Drum-Highbongo HighBongo
    Drum-Highwoodblock HighWoodBlock
    Drum-Lowagogo LowAgogo
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    +
    + + + + +
    +

    Intro-A

    + Auto-generated 'Intro A' salsa2.sty (4) +
    + + + + + + + + + + + + + + + +
    Bass-8 SynthBass2
    Bass-9 SlowStrings
    Chord-13 NylonGuitar
    Drum-Cowbell CowBell
    Drum-Highbongo HighBongo
    Drum-Longguiro LongGuiro
    Drum-Longlowwhistle LongLowWhistle
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Mutecuica MuteCuica
    Drum-Opencuica OpenCuica
    Drum-Openhighconga OpenHighConga
    Drum-Shortguiro ShortGuiro
    Drum-Shorthiwhistle ShortHiWhistle
    +
    + + + + +
    +

    Fill-AA

    + Auto-generated 'Fill In AA' salsa2.sty (1) +
    + + + + + + + + + + + +
    Bass-11 AcousticBass
    Chord-12 Piano1
    Drum-Cowbell CowBell
    Drum-Highbongo HighBongo
    Drum-Hightimbale HighTimbale
    Drum-Highwoodblock HighWoodBlock
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Splashcymbal SplashCymbal
    +
    + + + + +
    +

    Fill-AB

    + Auto-generated 'Fill In AB' salsa2.sty (1) +
    + + + + + + + + + + + + + + + +
    Bass-11 AcousticBass
    Chord-12 Piano1
    Chord-13 NylonGuitar
    Drum-Cabasa Cabasa
    Drum-Closedhihat ClosedHiHat
    Drum-Highbongo HighBongo
    Drum-Kickdrum2 KickDrum2
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Openhihat OpenHiHat
    Drum-Ridecymbal2 RideCymbal2
    Drum-Snaredrum2 SnareDrum2
    +
    + + + + +
    +

    Ending-A

    + Auto-generated 'Ending A' salsa2.sty (2) +
    + + + + + + + + + + +
    Bass-14 BrassSection
    Bass-8 SynthBass2
    Chord-15 Piano2
    Drum-Crashcymbal1 CrashCymbal1
    Drum-Highagogo HighAgogo
    Drum-Highbongo HighBongo
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Lowtom2 LowTom2
    +
    + + + + +
    +

    Main-B

    + Auto-generated 'Main B' salsa2.sty (4) +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Bass-14 BrassSection
    Bass-16 SlapBass1
    Chord-15 Piano2
    Drum-Cabasa Cabasa
    Drum-Closedhihat ClosedHiHat
    Drum-Cowbell CowBell
    Drum-Highagogo HighAgogo
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum2 KickDrum2
    Drum-Longguiro LongGuiro
    Drum-Lowconga LowConga
    Drum-Lowtom1 LowTom1
    Drum-Maracas Maracas
    Drum-Midtom1 MidTom1
    Drum-Mutehighconga MuteHighConga
    Drum-Mutetriangle MuteTriangle
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    Drum-Shaker Shaker
    Drum-Shortguiro ShortGuiro
    Drum-Sidekick SideKick
    Drum-Splashcymbal SplashCymbal
    +
    + + + + +
    +

    Intro-B

    + Auto-generated 'Intro B' salsa2.sty (4) +
    + + + + + + + + + + + + + + + + + + + +
    Bass-14 BrassSection
    Bass-8 SynthBass2
    Chord-12 Piano1
    Drum-Claves Claves
    Drum-Crashcymbal1 CrashCymbal1
    Drum-Highagogo HighAgogo
    Drum-Hightimbale HighTimbale
    Drum-Hightom1 HighTom1
    Drum-Kickdrum1 KickDrum1
    Drum-Lowagogo LowAgogo
    Drum-Lowtimbale LowTimbale
    Drum-Lowtom1 LowTom1
    Drum-Lowtom2 LowTom2
    Drum-Maracas Maracas
    Drum-Midtom1 MidTom1
    Drum-Mutetriangle MuteTriangle
    Drum-Opentriangle OpenTriangle
    Drum-Snaredrum1 SnareDrum1
    +
    + + + + +
    +

    Fill-BB

    + Auto-generated 'Fill In BB' salsa2.sty (1) +
    + + + + + + + + + + + + + + + + + + + + +
    Bass-14 BrassSection
    Bass-16 SlapBass1
    Chord-15 Piano2
    Drum-Cabasa Cabasa
    Drum-Closedhihat ClosedHiHat
    Drum-Cowbell CowBell
    Drum-Highagogo HighAgogo
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum2 KickDrum2
    Drum-Lowconga LowConga
    Drum-Lowtimbale LowTimbale
    Drum-Maracas Maracas
    Drum-Mutehighconga MuteHighConga
    Drum-Mutetriangle MuteTriangle
    Drum-Openhighconga OpenHighConga
    Drum-Pedalhihat PedalHiHat
    Drum-Shaker Shaker
    Drum-Shortguiro ShortGuiro
    Drum-Sidekick SideKick
    +
    + + + + +
    +

    Fill-BA

    + Auto-generated 'Fill In BA' salsa2.sty (1) +
    + + + + + + + + + + + + + + + +
    Bass-11 AcousticBass
    Chord-12 Piano1
    Chord-13 NylonGuitar
    Drum-Cabasa Cabasa
    Drum-Closedhihat ClosedHiHat
    Drum-Highbongo HighBongo
    Drum-Kickdrum2 KickDrum2
    Drum-Lowbongo LowBongo
    Drum-Lowconga LowConga
    Drum-Mutehighconga MuteHighConga
    Drum-Openhighconga OpenHighConga
    Drum-Openhihat OpenHiHat
    Drum-Ridecymbal2 RideCymbal2
    Drum-Snaredrum2 SnareDrum2
    +
    + + + + +
    +

    Ending-B

    + Auto-generated 'Ending B' salsa2.sty (2) +
    + + + + + + + + + + +
    Bass-14 BrassSection
    Bass-8 SynthBass2
    Chord-15 Piano2
    Drum-Crashcymbal1 CrashCymbal1
    Drum-Highagogo HighAgogo
    Drum-Highbongo HighBongo
    Drum-Hightimbale HighTimbale
    Drum-Kickdrum1 KickDrum1
    Drum-Lowtom2 LowTom2
    +
    + + diff --git a/mma/docs/html/lib/yamaha/w-rock.html b/mma/docs/html/lib/yamaha/w-rock.html index 7c83c1f..8173f86 100644 --- a/mma/docs/html/lib/yamaha/w-rock.html +++ b/mma/docs/html/lib/yamaha/w-rock.html @@ -1,4 +1,4 @@ - +

    W-Rock

    diff --git a/mma/docs/html/lib/yamaha/western.html b/mma/docs/html/lib/yamaha/western.html index b492cc6..9c8d4a9 100644 --- a/mma/docs/html/lib/yamaha/western.html +++ b/mma/docs/html/lib/yamaha/western.html @@ -1,4 +1,4 @@ - +

    Western

    diff --git a/mma/docs/html/ref/crossref.png b/mma/docs/html/ref/crossref.png deleted file mode 100644 index 7dd2dddf5ac24cb1297a9d565c41057cb7090e02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmeAS@N?(olHy`uVBq!ia0vp@Aj|@a!R<*>X0K7&N_)1@@}28%Z6=9 t-O~MHw|5t0`TuI#<-T9Me##YR_J!+(UN4n;@(5@ygQu&X%Q~loCIFb&G|K=0 diff --git a/mma/docs/html/ref/img1.png b/mma/docs/html/ref/img1.png index effeab0650648305e6d306ff0fd5f50e484c5733..388020bf7b5e984192cb3881a5e9ab47092c7563 100644 GIT binary patch delta 199 zcmV;&0672D0pkIXB!4YXOjJeP-QAg)nRj=0RaI5)?(Q=)GtA7)5fKrps;XvYX8-^H zL_|aY001H)BD=f0)OU+%00001bW%=J06^y0W&i*HWJyFpR0x@4SjDh{VHLvy1_g!* z42u>pEV{sO<^aR01t7F~0h9p}S+$B`l@Ej=7NZy zIdcX?LzHP@qfFM7KzPT%)aq9tO05fGF4PDh001EFQy#TQtBe2u002ovPDHLkV1in9 BPs;!R delta 184 zcmV;p07w7h0n`DIB!47OOjJeP-Q9P0ckb@)Gcz;H%*+uH5vr=Hh=_=0W@i8Y{{R30 zA|fK>57vAD0004WQchCJQ3^WDed09TkT259UzCXB*-tA!Qt7BG$1F$)5S4_V`j2PvPYT+ z^C2UFna3tDs0ce~>}1ejNLzle^NNAS>cxu}Ge$D`q%?InOqlfabb||5myQoRN5aCJ vL6>egl!R4?%!p6Ph+>;|-X-ihBO}AH8p~LdBkU+|9?S2K_HL$-?!C3 zim@cfFPOpM*^M+HN7vKEF@$4gaza8t0z)G!&kBcbM)ruUT(O$W%-6kgUP%>5GBQW5 fzVKx&Qg&a diff --git a/mma/docs/html/ref/img11.png b/mma/docs/html/ref/img11.png index 3b65b78da14a9d22c140b0b64565f6d6a86c8ef0..86809a91aad823f8eeb73d167d3ce1478282682d 100644 GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7V%)r1{VfpSPki!$;6XLpi_wMrY^8f$;0|hRM zeEb5W7)yfuf*Bm1-ADs+>^)r^LpWw8M;tV0Ok_RG)W)C?clCh5R7RI3i3FCU^-&E? zAk9mp13p{|2$5>}|KFZrN%-0*N2Z_h9RC;?JnP+icAcBH185Y3r>mdKI;Vst0BI*R AR{#J2 literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^JV30>!py+HsJiUfLLf&yz$e7@?%lgHXU;4yFAoh3 zefRF&nKNeu1qD~FTGi3fk(QSB|NnoWLM0_7quqZ`09lMBL4Lsu4$p3+0XZ?AE{-7_ zGm|5ZZjj;#XMD)i#_OA{Lv0mGUK zGpYTv8md^@0(J*zx@!w;bx##{5onEKSoY22O;g7G))cOZA`Bw)Cy2M4&OZgThr!d; K&t;ucLK6Usuu6&m diff --git a/mma/docs/html/ref/img12.png b/mma/docs/html/ref/img12.png index ac5ae8a83a9c3525d0949d9dd359aab1390f4683..5cd237cc6df13e86b113b2a2af1f6766959c52c7 100644 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^JV30>!py+HsJiUfLLf&az$e7@?%lgHXU;4yFMs#$ zow2d;nKNfPIy%zQ(*FPd@8aSDRHdY(WODhn50J%J666=m;PC858jut1>Eal|F*Er^ zLI%?zK82iw83zIwRHP+lHFz{GWbTk!u!7rXn~8#p!wTjVzRWGA3KmYxN^Shr3qNk= zSmB<)v9!_4(6eF1)I(ANjv}iVeb)M2XvnzkVASft#h{~*_!@p)8y&m z7{W2rw0ooAAp;)QtCugNvGhB5GryeNBq`CT+M>^@ufpma@Z)pF|XU?2i zUS1v=8v5?tyNQkx^$SH$7XhUiOM?7@862M7NCR@}JY5_^IA$il$VkY@On8xyk^Uls z<&rFq1J4rOh8@cr7cLZ5xyC2*?!|=&MwQuCyBe09nQ5%upd_2{(am5btJ+=V16dAQ z(pFgwDQqEsGx<8IW~ePtUH#BUZJlgDnz!3wFOAD97dL0K&A6$th%scZ(3u=2P5V&B gq<2xQOsB0G9#0P8T9xpj80ZuRPgg&ebxsLQ0QQAb`Tzg` literal 454 zcmV;%0XhDOP)%C5 zMs?oqXzC~o6o#K@l@3bAc`6Y&Nm`D-8hs{k!h9<2RR(Jsc(}!6;xT=~jDmygv2OrU z97_gGQI7AmVZM5ql@{jw>CTNwo07sM6KVw~|?6_u)pH04dyG$W?k zAV^-whYwfx-_f1%ciZC2S6FN$R?9_7AqJ}`|${>FNV{aU=@SU@J& z;eSSkW*gBB-d*gj1;D0hl=!AgVnk|NQ`bp^A{W4h5&6#Hsk>B98nlmJD5vTfmaP~G wqVVp}!&Yz1(d+u^?3CJeXWP<$i-qNU1HF7|P#fUffB*mh07*qoM6N<$f{NkB>i_@% diff --git a/mma/docs/html/ref/img14.png b/mma/docs/html/ref/img14.png index 763679b56436e40c6ec5f86755c1fa3cc2324ad7..f8d3b42f277c9a441bfd8d6698b3fb10b5d30743 100644 GIT binary patch delta 442 zcmV;r0Y(0*0?h+EiBL{Q4GJ0x0000DNk~Le0000d0000h1Oos70e(ol>i_@%Fi=cX zMcv)qnVFe)cXw4)RqpQYGcz-hI39n67G)g(0004WQchCqMO^y{oTT6ugv&L?n14giwM+L9CpW<_ za3H?ql1oa{Mev1t_ve@Yd++WnKv>9lmHYHo@6Aeum6rQshm~Pr1>!95hK7G^W#TL) z!LuUxu4=h=S!(L9GP#!C98-*F&N727Y2ZFrh8)JbhDZFfloD|BPNAz03!qRhdvElaf&)JP@Qs10sHhX{2uInJtPK)jrt)+4|V zxc@kRl;*;l&O7v3sSBf`xYl+sbnaT`fY%W3i&SM_c+fE5!o&tmg0q7hnP0&d1>6HC zBBHH&=F@r4 k-KFS(y|47&u-J{wFV!treo41C?*IS*07*qoM6N<$f*udeTL1t6 delta 278 zcmV+x0qOqD1F8ZziBL{Q4GJ0x0000DNk~Le0000S0000N1Oos70iELl@&Et;El^BU zMcv)qnVFe)cXw4)RqpQYkvkrL^+iM)00001bW%=J06^y0W&i*Ht4TybR2Y?QPrD7m zFckD09w8MgKq?r)WDS-`O-1FnNTQP?(J%lA3F+ArFalHX{0W$dSKPhxy?3?+AS?tU zv>+W2#4tXC05S|P+%+eLZe1EkCD4*Z$4rl@4|?EJgOBf1edlMEjIYd9alRSb_@GW9 zuvC3zin-4gdfE07*qoM6N<$f}mn>DgXcg diff --git a/mma/docs/html/ref/img15.png b/mma/docs/html/ref/img15.png index cde0d59f6f1e73a99a5a56f57f68eb48c49eea63..9496c9c376da6769aa8c0ab325b0919f4405d4b5 100644 GIT binary patch delta 279 zcmV+y0qFj%1FHf!iBL{Q4GJ0x0000DNk~Le0000S0000N1Oos70iELl@&Et;El^BU zMcv)qnVFe)cXw4)RqpQYkvkrL^+iM)00001bW%=J06^y0W&i*HtVu*cR2Y?Qjj;{F zFc3w(16@j_6x;}m;0hsDp`l8N7=bD}fuejz8Ni~2DidUcOu?P)fQh)`|9igkKLZ$8 zqgtCstqO=VpwuN~?Yzigmk$uj;G`(-vFel?Va8`Z#QN^fJ`rHW3*xv|PwwK>*Y{q% zxbjxtC&azw|Nr^f_{gDU8?col=w5^>UJ2v4(W8t>0X_f#002ovPDHLkV1hAMceVfk delta 410 zcmV;L0cHNH0<8l(iBL{Q4GJ0x0000DNk~Le0000=0000M1Oos70phhMSO5S3Fi=cX zMcv)qnVFe)cXw4)RqpQYGcz-hI39n67G)g(0004WQchC z4FU|icR$ZNX-o1fg%e;;A8=&mnFaT%n2Qu%%zy*W?7;E)LhHdN)*LH94-ct<} zi$;|Nvf!E#VyL!k!w_4)ok?=vHtyNGeph$y4%+nb5ag?z$?ox9^V5+ZOG~eR>1KwtZXTH+=*;E&FxC&fVOzU%Nrf`;E{UO{x3tVt@-+ z)L{WsQ?=(eNY$p=3D2_^Zm5kd+&%A3dg)c5!0a8*!^&gBp6+J9dR^-7C6KBO%DeS< zoZjuT``>o&-5a980tLHwv+h>jEx3Ej>HV)2K{jr9`)s%FtJ2+%?{#miHQU1t77)Lj zePH+Q@a}!KFLsAZBi!}(78WP%zq^{cek5KMW_(})06Dr!PPO{WyZ`_I07*qoM6N<$ Ef@NOB%m4rY diff --git a/mma/docs/html/ref/img16.png b/mma/docs/html/ref/img16.png index 3e020131b7274d2c6e9ac5ae36a0e9dd39a32828..a5d74abe0b4ae9c7ab9d17b46aab00a1e84b2a64 100644 GIT binary patch literal 445 zcmV;u0Yd(XP)S*bM>22l2HDA)#PZU&0p zg@Frj1-oG^>)i}n{`IQu+dX>|NNhH$ERY4)j1YqZur1p_tSvAhYoM6+-c52ltGTl` zc<*N4{nFc-V*@U|R1%Zky?ZrSY(HGc8;E}c#k$!y@w66j6?%cdv zVcTkN*4@?1fiC2(p63lQZ#KffZc5#E7Xw_tq7Dndt7;23F{&Uy39KqhHDNmU%8g5{ zq<1Q5Hx;Yy7Sh_?q{nG$&Ng-ToG8Ojm!v_el45o*-1d6+%5ASpcJJOfd-v|HN87V^ z?=}OOvNbzzlQhVz{Yq-Pm9$Q6d!)2mN=bU(?%kV|R5mIp?q9uocTl&e((FB&NbdT# n8jF)Q77^`wYOBJG4=exx@sc^l;1K})00000NkvXXu0mjfq?ySg literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^{6H+q!py+HD6?s%5RjuD;1l9{_wL=9GiR2UmxqRi zzI*rX%$YNSf`Y47tx8Kv`~UyHi;D|T;qKkLr#=Y*>1Qkn@(X5gcy=QV$cgrJaSY*@ znLOj9!R$meo+_g=b2y!~CDq=$JUYiBe8=I@6CMk3C!YpE?ZzV^{tAZG{1YzBF=2ES zn>&Lu{mjc2qZA`Wp6fHC5B9vAYAoI;F}ZC1oUPTWv-IBZFhqtVvAs6@Ap*39!PC{x JWt~$(698-gONIad diff --git a/mma/docs/html/ref/img17.png b/mma/docs/html/ref/img17.png index 2be0cf7df95113fa0b8165ca4eb17f867f96b182..1bb58b263895e583c8289de1d6018ca5f99e90bc 100644 GIT binary patch delta 157 zcmX@lc${&9QGIA=sIjr}s#U8xIy%zQ(*FPd@8aUZz`&rSq_lhY?rGHm5ZsM3>!K!rYVT{QkCJ&PWhE6qEg^3qi zyk(~}7*}a6;JGL(;Ff)y$zZYKqGYL#i^h`|Uvy>i6)zKGV<>tUc0gu_#&e+244$rj JF6*2Ung9%JIT8Q> delta 165 zcmV;W09yaY0nY)DGJo#w?lUtp%*@QHs;Y>Hh-PMH|Ns9)L_`1p03sqH&++uX00001 zbW%=J06^y0W&i*HR!KxbR0x@4n8^TvJ3(X&!_1jbG=&qv1|txmIWv=CW~mj7i$+Au z0ur5I?gSv=DU3rMjDRtWypJh^7$%Z4Cv<`sM`2P2X3jJRGaja&K4gie3kL%L58Gc; T$akb400000NkvXXu0mjf0pmV? diff --git a/mma/docs/html/ref/img18.png b/mma/docs/html/ref/img18.png index 02455238377884cbcdf2d525315e748aed725b87..56b94d8783fedbd1836e493e3cdaf1c0ff3fc4bd 100644 GIT binary patch delta 167 zcmV;Y09gO!0oMVLBo``BOjJeP-QAg)nRj=0RaI5)?(WRY%#lGDe;(_@7XSbN0d!JM zQvg8b*k%9#09#2!K~xBtW0=VRfjdFu42GFAp=j1j1RIP%#LAhR3^OgK!?SQ3H zIdvw(+?i8=tV&KC>R<$n!J(wu31Y->&YUX=WK7r!m71_+=1g9&8mFd0bX_ delta 201 zcmV;)05<>E0p$UZB!4haOjJeP-QAg)nRj=0RaI5)?(Q=)GtA7)5fKrps;Y>Hh-PMH z|Ns9)L_`1p03sqHySuxE7G)g(0004WQchCaR0K;&kI z-MgV^|89ouyAj;oyFtX(o!kt&ckF<1(TMF^yn(XWKvwr`AVTqaD-Lxq0?OES=FFJ` zU=gj|-r69>mb-Ve!BV?cZ`m&mWbD6t_wG$pUAPzkhI)5fTIr$p00000NkvXXu0mjf D#t~kB diff --git a/mma/docs/html/ref/img19.png b/mma/docs/html/ref/img19.png index 984411dfd917a6a4e566ad1faa449b2ecc4b5542..137b9ef4bbb5bfbbcbbdbfac197565995b41951a 100644 GIT binary patch delta 161 zcmV;S0ABx=0^|W9iBL{Q4GJ0x0000DNk~Le0000G0000L1Oos70m>Iccab4XcVbCI zK~xBtW7y3Afm=Z2W`^Cnp=keZhON61+}*oD#Gakp47)eNxoE`pE#3^fcVq)uzh?u9 z)4On}gAq{1wlinW8~}^V+U>0kW?WLu21{*Py=8+mkg-8`kqwXY O0000HCW6c*FCfl0RRxJALM*z!6E delta 255 zcmV=IRF3v0d!JMQvg8b*k%9#0G~-jK~yM_wT?jw!Y~j;XWMltm_xX* zP+`D(c?Nft4#+oGaOtKe@C@F@NoQzUsuUCZ<9g2XHS((^XqLPc9iL^PQW|9C<#I+~zsU`Sw5mFfU(OL8XIhKzRTF002ovPDHLk FV1h~8ZMy&f diff --git a/mma/docs/html/ref/img20.png b/mma/docs/html/ref/img20.png index ab5197d1cc93ab2cefcdf3d642368c3654f5bb1c..be63f09084b4ca70adbea5263fcecae036aafba1 100644 GIT binary patch delta 230 zcmVvtKWroVk->=1Rwzk_>Y< zsZO1VsuGC=8w6n^+c0ycCX}r_bAly|y=CG}&P9!2_9V^eGd(qZ!0g$aGo5CtY9jO^ gn}e6V8xA%A0I)EUNs*ZB(*OVf07*qoM6N<$f{|}re+4IE00000NkvXXu0mjfE{9zR diff --git a/mma/docs/html/ref/img21.png b/mma/docs/html/ref/img21.png index 34f8a5220f862fbbc77bd8eeb1303a928328080a..fe7d63485b18514d78f98d5bad04e85a3dbb77df 100644 GIT binary patch delta 247 zcmV9X{#oIs8fp;Ng)Iw)NmOPH~`_n$VKX0K=RfS zAbUa9s#T{L7I>{(r3JK6W%(*pl}IGmAP5`ThE+f}g4xT$RxP{*Wp4rsS7{i5*y~QM xTBIbU$T$ z_ik-%IJy5fi0s~`xSL_)YGv)+XezOqgCx9r6O75K4P)+bJiTc$#H2-9w>NEh4PrX( n-u-@)6I>gT33!-y;Q#;)KBVWG4{59M00000NkvXXu0mjfhd)K} delta 210 zcmV;@04@Lf0h9tEiBL{Q4GJ0x0000DNk~Le0000M0000N1Oos70gAzrJCPwwf09W= zK~xx(W7xfcVRr%ph}^)iA58APw3}h??cEH!cZ2W-hP`)zcrOs^Z2M0P+#Qrr0+elmGw# M07*qoM6N<$f?o<>g8%>k diff --git a/mma/docs/html/ref/img23.png b/mma/docs/html/ref/img23.png index d1a9663a506b4c7492f9ec0dd0a0b7712c5470cb..9b369ae4df51f9f61b28bed5c754448adc247648 100644 GIT binary patch delta 228 zcmV6T}(I>3BGLoXG{JTR6f-^6o^%|0I@Z)O2;4}dYZkN&D;XV zCNJH_q+zvWTbds{=9g}j9%8oM_knfFHt$T=!uIATTo%4T*Ot4){RD+wr^M}L)q e`ERLtqy>Ojl!cjrf$@~Mb2*TsHBnWse%pTcbwD;_ zNswPKgTu2MX+Tbtr;B3<$IRr2qYRD99aD4;uL=#=($bxHRgG$!wL=8Y>Hxgyhw1Vwqw<_bx9H1 zy*N+2Dmt)`&+UN39IsWI9eN_xg}z?W(8KD!Fo?TvP1IJwHOEe_Sj_D!&d0`ZUoXQv T;VgS9&?W{?S3j3^P6`+C<`+K1Eb8QnL)pF|XU?2i zUS9t0-8*Ar<1=T@Oth1zmt4^03RJ;Z666=m;PC858jus`>Eal|F*A9_$p)6?2507Q zx)!G!otfGB;M^QerDZ-_Qf63+pKBEoUT|d2Nr$8;l?fBpun4I?6uQwlGvL^j(A8mU zS-LaM%$doV_!@p6Y1&V7{W0#`Nr7>mhT2{?(w?* zE;oL2yZ6Dnd%Q~Da=xV9*eiI>Re4)JqmcC8#v|`zopr05SbbZ~y=R delta 213 zcmcc3_>xhlGr-TCmrII^fq{Y7)59eQNDBh7C<`+K1EcCy4No9PE5Ikj_3quf6ZPfl zfm|gerQN%CCnhc32jno81o;IsI6S+N2IS;=x;Tb#%uJ5h+Q8T)5ytdUOIRUWl*d>n z;^>AH(GEuEgpaNXMQ;zSU^Ni5;8YFMpO6%>HR-BeTWIL&hBd)Ct0$xya?W7PE`NVd zjn!~f=2a~@j_kv$Ldy@VX$@L^O^z*EVQ=+!xx^V$IZhXDVtD0VVce?lDH&)pgQu&X J%Q~loCIALxM;ibD diff --git a/mma/docs/html/ref/img26.png b/mma/docs/html/ref/img26.png index 3eafb960392731ba21c4815ce2ea44fe06e5a832..6edc561e239160ab784aed09af9171925ac01849 100644 GIT binary patch delta 218 zcmcc3_<~WVGr-TCmrII^fq{Y7)59eQNDBh7C<`+K1EcCy4No9PH^3*v_3quf6ZIwP z)6&xZ|Nrme;sO*`Qc~Kzdv~RRO97C>SQ6wH%;50sMjDWl>FMGa!Z9;BVrv6qmxLJ8 z$5pKk*R&+kB3MLXS(6S3MAV#J73?snQZeGJmWYs-P7I^UB8N4R3V)aTge#s-5;9=E zmMbXIA~kh;R;bvFtx4Bcm2N+s(ek4MMztWxpUoCheu&Te5D3Vry|Oqor%=k zaAHX)_o@Ru#_6XH1a)r-+u1Ckpt?Dr^kEW%CERLtqy>Ojl!cjrf$@~Mb2*TsHBnW*J}oWn|Ns9k zE-pZU-Me=m3n~FgF_r}R1v5B2yO9Ru#Cy6phH%VGjyTHD$nEe%sx5T&f{eFXZCB$s z-mMB%Nc!5P(-x{7c4$Y&kyoq^NpFJ`3bT19+}JABZY9B(s&gSQXc|+u#@eW8)-;)* tTiny4mTWzx&V7PGGtlv>L~A!A!=0xYO9PqZ%z$<=c)I$ztaD0e0svydLL&eG delta 247 zcmcc3*u$jS8Q|y6%O%Cdz`(%k>ERLtq{V<(oQ0WzfwAl0Bx@i?ccQ9%eMd*f|NsA8 zTwH(xN=iz*cklM>be#$0FqQ=Q1v5B2yO9Ru^m@8DhDc0Jj@a6e=*z@B!DT`7YKd!e zqKSKxds!!zd(S_WH-LU}u)wxsxqI|(?=Wo%^5Xj*-54r_3?Si?%w z_tZ^@D1UZslV|9QWe?1RnG)Uv2b8^A)w(?4jqK`KoBiaOHizGdy1M(- ul_-Pi+-sW_gt{*gsG4~8;Ay*N28IItP5znpZSDYF#^CAd=d#Wzp$P!dQCpJ$ diff --git a/mma/docs/html/ref/img28.png b/mma/docs/html/ref/img28.png new file mode 100644 index 0000000000000000000000000000000000000000..b8584aba2ecf31a5f9dc1ff5309b7253881bd21c GIT binary patch literal 275 zcmV+u0qp*XP)7*_3Cvr39#U6RStRj4YF zNU%W=HnI(?R%t=mN~;#`g0W96>Gs+*5zJnswTg{P%NNXEcdjW(-#_0tN#UQ!} ziyR1m$RZ$Fyd2CfTV9S3$3hmMldd3=1H@idjvyf-P+2Ux2r`i61eqlo;t*y*#&W2r nG00000NkvXXu0mjfw+u*! delta 194 zcmV;z06qWJ0p0B~DZ&T^lgllU)JmKr+FX*E0KMPA?!cO9i~s-t07*qoM6N<$f*SWy0{{R3 diff --git a/mma/docs/html/ref/img4.png b/mma/docs/html/ref/img4.png index 0bde52fa440d45014509b606cc0c63585ed5ef8b..4e2975282966e843b3cc4db378150a7cc8f9aeb7 100644 GIT binary patch delta 179 zcmV;k08Ib90nY)DB!3=IOjJeP-Q9P0ckb@)Gcz-0W@i8Y|3pMYnVFd)A|kuHyLK}& zyZ`_I0d!JMQvg8b*k%9#0AEQ&K~xx(V+ajk2n=8dg(Dy=1(Ts59!M$_4VOa1Bhkgd z7zh|bE5T%Fs33?Ghp=&y0jOjum<%uliv$_LNr*@)hI%5&P%Qk+0Jo_K(IDYcgo1z$ hbWs$w1k5Fe2>=ZrZ!r+0){X!G002ovPDHLkV1h|FL5=_b delta 160 zcmV;R0AK&l0lWc_B!3l9OjJeg?(TPYcbS=)Gcz;)|NlfpL?R+0ilDHj00001bW%=J z06^y0W&i*HRY^oaR2Y?GaB*O8a$s diff --git a/mma/docs/html/ref/img5.png b/mma/docs/html/ref/img5.png index 845f3e6c67e5f4b5486e1030111b22003512aca0..9cd4df52cef391c7e3e380afc172c2a852744a8f 100644 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^5!py+H$UpPJJRnCsz$e7@?%liP<>jHFq3_n-xPCQVHaPfPi4)FlY~OJ zmZUse6}mdiiABAs(p#ZuvY=L=kE0>W)W!py+HsJiUfLLf&yz$e7@?%lgHXU;4yFAoh3 zefRF&nKNfrtyR delta 161 zcmV;S0AByy0m1>07bFw}0{{R4JlXNI0000dP)t-s-QC@pnVENYckb@)Gcz;H%*>HN z6>_#12u%P000DGTPE!Ct=GbNc002ozL_t&tnPcc+XkY+g5Nz4N(9r-w%?%7a4N!JR zM+XpBFm%kC0c9iMb|7wmvR8Fr%7X!rl3p1B;jI8uO%@=^rXvGM2~G+Ce_%mLwHgZJ P00000NkvXXu0mjfkEuAg diff --git a/mma/docs/html/ref/img7.png b/mma/docs/html/ref/img7.png index 03b6063d91497beeb1be87a09d3c1fae3766acea..251dd5cce081022106db6130e5f18336cecf4479 100644 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^JU}eQ!py+HSST2DS!^$W9LAC$zhDN3XE)M-oG4Eh z#}JO0$umwGG%~h07QA9?n<*?&md`NJ!6cJu3Zu|WOW_V{$uzh1Et>=@PN^vH9-8OS zTz3A*g!_A|%{$r(E^oDQobvq6+yqa3Z-J*4n~T((IPPjsXbXd< LtDnm{r-UW|)Z8_3}&4;^g}1#9h@-Pwm^ExII)WegR3;ePy6j;;#Sz002ovPDHLkV1jvO BXv_cr diff --git a/mma/docs/html/ref/img8.png b/mma/docs/html/ref/img8.png index 5126e6046ce1746de8ee7af1c96d74a7c640a02c..18f82dbf18029e6c30afff12af852520ae7df582 100644 GIT binary patch literal 268 zcmV+n0rUQeP)x} literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^d_XMB!py+HsH!Pw2;`^)_=LFLy?b}&%$eoo<)NXW z#>U2H&YbD!=txUT`~UwxP>GU~((c{6x!X>y0CE^hg8YIR9G=}s19HMWT^vI=W+uN# zXmH>axOwoxhUSHf8C#^p7+4Ry;WH3qRGFo<;Lc3rbiW4A1D$CC52rAwM5rXh?9lOH z=SWy+Ijg*&;RV}NCxdv^6}gNN`z)C}@A_~sFf2Rk{@MD$S5=@D44$rjF6*2UngE3n BME?K) diff --git a/mma/docs/html/ref/index.html b/mma/docs/html/ref/index.html index c7b8d6e..13d5c0a 100644 --- a/mma/docs/html/ref/index.html +++ b/mma/docs/html/ref/index.html @@ -1,4 +1,4 @@ - + - + next - up previous
    - Next: Next: Overview and Introduction - Up: Up: Main MMA Reference
    -
    +

    @@ -53,12 +54,12 @@ original version by: Nikos Drakos, CBLU, University of Leeds ALT="LOST LOGO">

    -Reference Manual -

    +Reference Manual +

    Bob van der Poel

    Wynndel, BC, Canada

    -

    March 7, 2007

    +

    September 28, 2008

    @@ -68,580 +69,616 @@ original version by: Nikos Drakos, CBLU, University of Leeds -

    @@ -53,12 +54,12 @@ original version by: Nikos Drakos, CBLU, University of Leeds ALT="LOST LOGO">

    -Reference Manual -

    +Reference Manual +

    Bob van der Poel

    Wynndel, BC, Canada

    -

    March 7, 2007

    +

    September 28, 2008

    @@ -68,580 +69,616 @@ original version by: Nikos Drakos, CBLU, University of Leeds -

    Subsections - @@ -85,11 +86,11 @@ Overview and Introduction

    -Musical MIDI Accompaniment, +Musical MIDI Accompaniment, MMA ,1.1 generates standard + HREF="#foot192">1.1 generates standard MIDI1.2 files which can be used as a backup track for a soloist. + HREF="#foot193">1.2 files which can be used as a backup track for a soloist. It was written especially for me--I am an aspiring saxophonist and wanted a program to ``play'' the piano and drums so I could practice my jazz solos. With @@ -140,7 +141,7 @@ The current version of this package is maintained at: http://www.mellowood.ca/mma/.

    -This document reflects version 1.1 +This document reflects version 1.4 of MMA .

    @@ -148,11 +149,11 @@ This document reflects version 1.1

    -
    This program +
    This program has recently changed its status from beta to a 1.x version. I have done everything I can to ensure that the program functions - as advertised, but I assume no responsibilty for anything - it does to your computer or data.
    + as advertised, but I assume no responsibility for anything + it does to your computer or data.

    @@ -196,7 +197,7 @@ About this Manual This manual was written by the program author--and this is always a very bad idea. But, having no volunteers, the choice is no manual at all or my bad perspectives.1.3 + HREF="#foot232">1.3

    MMA is a large and complex program. It really does need a manual; @@ -229,7 +230,7 @@ Typographic Conventions

    -

  • Important stuff is emphasized: important. +
  • Important stuff is emphasized: important.

  • @@ -237,7 +238,7 @@ Typographic Conventions HREF="http://www.mellowood.ca/mma/index.html">http://www.mellowood.ca/mma/index.html

    -

  • Filenames are set in bold typewriter font: filename.mma +
  • Filenames are set in bold typewriter font: filename.mma

  • @@ -276,15 +277,15 @@ Typographic Conventions

    -LATEX and HTML +LATEX and HTML

    -The manual has been prepared with the LATEX typesetting system. +The manual has been prepared with the LATEX typesetting system. Currently, there are two versions available: the primary version is a PDF file intended for printing or on-screen display (generated with dvipdf); the secondary version is in HTML (transformed with -LATEX2HTML) for electronic viewing. If other formats are needed +LATEX2HTML) for electronic viewing. If other formats are needed ...please offer to volunteer.

    @@ -311,7 +312,7 @@ reading:

    -

  • Various README files in the distribution. +
  • Various README files in the distribution.

  • @@ -352,7 +353,7 @@ many others are available for Linux systems. For Windows and Mac systems I'm sure there are many, many choices.

    -You'll need a text editor like vi, emacs, etc. to create +You'll need a text editor like vi, emacs, etc. to create input files. Don't use a word processor!

    @@ -363,7 +364,7 @@ input files. Don't use a word processor!

    • The executable Python script, mma1.4, must somewhere in your + HREF="#foot347">1.4, must somewhere in your path. For users running Windows or Mac, please check MMA website for details on how to install on these systems. @@ -371,36 +372,36 @@ input files. Don't use a word processor!

    • A number of Python modules. These should all be installed under - the directory /usr/local/share/mma/MMA. See the enclosed file - INSTALL for some additional commentary. + the directory /usr/local/share/mma/MMA. See the enclosed file + INSTALL for some additional commentary.

    • A number of library files defining standard rhythms. These should all be installed under the directory - /usr/local/share/mma/lib/stdlib. + /usr/local/share/mma/lib/stdlib.

    -The scripts cp-install or ln-install will install +The scripts cp-install or ln-install will install MMA properly on most Linux systems. Both scripts assume that main script is to be installed in -/usr/local/bin and the support files in -/usr/local/share/mma. If you want an alternate location, you +/usr/local/bin and the support files in +/usr/local/share/mma. If you want an alternate location, you can edit the paths in the script. The only supported alternate to use -is /usr/share/mma. +is /usr/share/mma.

    -The difference between the two scripts is that ln-install creates -symbolic links to the current location; cp-install copies the files. +The difference between the two scripts is that ln-install creates +symbolic links to the current location; cp-install copies the files. Which to use it up to you, but if you have unpacked the distribution in a stable location it is probably easier to use the link version.

    -In addition, you can run +In addition, you can run MMA from the directory created by the untar. This is not recommended, but will show some of MMA 's @@ -409,7 +410,8 @@ stuff. In this case you'll have to execute the program file

    You should be ``root'' (or at least, you need write permissions in -/usr/local/) to run either install script. +/usr/local/) to run either install script. Use the ``su'' or +``sudo'' command for this.

    If you want to install @@ -457,7 +459,7 @@ To create a MIDI file you need to:

    will invoke MMA and, assuming no errors are found, create a MIDI - file myfile.mid. + file myfile.mid.

    @@ -483,7 +485,7 @@ An input file consists of the following information:

    1. MMA directives. These include TEMPO, TIME, - VOLUME, etc. Directives. + VOLUME, etc. Directives.

    2. @@ -517,7 +519,7 @@ Comments

      Proper indentation, white space and comments are a -good thing--and you really should use them. But, in most cases +good thing--and you really should use them. But, in most cases MMA really doesn't care: @@ -542,11 +544,11 @@ Proper indentation, white space and comments are a

      Each line is initially parsed for comments. A comment is anything following a ``//'' (2 forward slashes).1.5 + HREF="#foot315">1.5

      Comments are stripped from the input stream. Lines starting with the COMMENT directive are also ignored. See the -comment discussion for details. +comment discussion for details.

      @@ -651,7 +653,7 @@ of the chord or drum note can occur anywhere in the bar). To make the input files look more musical, MMA supports REPEATs and REPEATENDINGs. However, complexities like -D.S. and Coda are not internally supported (but can be +D.S. and Coda are not internally supported (but can be created by using the GOTO command).

      @@ -711,13 +713,13 @@ The only exceptions are the names for chords, notes in SOLOs, and filenames. In keeping with standard chord notation, chord names are in mixed case; this is detailed in Musical Data. Filenames are covered in -Paths and Filenames. +Paths and Filenames.



      Footnotes

      ...,1.1
      + HREF="node1.html#tex2html1">1.1
      Musical MIDI Accompaniment and the short form MMA in the distinctive script are @@ -728,13 +730,13 @@ are in mixed case; this is detailed in Musical
      ... MIDI1.2
      + HREF="node1.html#tex2html2">1.2
      MIDI is an acronym for Musical Instrument Digital Interface.
      ... perspectives.1.3
      + HREF="node1.html#tex2html4">1.3
      The problem, all humor aside, is that the viewpoints of a program's author and user are quite different. The two ``see'' problems and solutions differently, and for @@ -742,41 +744,42 @@ a user manual the programmer's view is not the best.
      ...mma1.4
      + HREF="node1.html#tex2html7">1.4
      In the distribution this is mma.py. It is renamed to save a few keystrokes when entering the command.
      ... slashes).1.5
      + HREF="node1.html#tex2html9">1.5
      The first choice for a comment character was a single ``#'', but that sign is used for ``sharps'' in chord notation.
      -

      + +
      bob -2007-03-07 +2008-09-28
      diff --git a/mma/docs/html/ref/node10.html b/mma/docs/html/ref/node10.html index 62b8326..56aeea5 100644 --- a/mma/docs/html/ref/node10.html +++ b/mma/docs/html/ref/node10.html @@ -1,4 +1,4 @@ - + - + next - up - previous
      - Next: Next: Automatic Melodies: Aria Tracks - Up: Up: Reference Manual - Previous: Previous: Lyrics
      -
      +
    Subsections - @@ -130,7 +131,7 @@ in a song file: Melody Voice TenorSax
    Groove Blues -
    ... musical data
    +
    ...musical data
    @@ -211,7 +212,7 @@ The notes in a SOLO or MELODY track are specified series of ``chords''. Each chord can be a single note, or several notes (all with the same duration). Each chord in the bar is delimited with a single semicolon.10.1 + HREF="#foot4273">10.1

    Each chord can have several parts. All missing parts will default to the value in the previous chord. The various parts of a chord must be @@ -230,7 +231,7 @@ specified in the order given in the following table.

    Pitch
    The note in standard musical notation. The lowercase letters ``a'' to ``g'' are recognized as well as ``r'' to specify a - rest (please note the exception for Drum Solo Tracks, + rest (please note the exception for Drum Solo Tracks, here).

    @@ -240,7 +241,7 @@ specified in the order given in the following table. (sharp), ``&'' (flat) or ``n'' (natural). Please note that an accidental will override the current KEYSIG for the current bar (just like in real musical notation). Unlike standard musical - notation the accidental will apply to similarly named notes + notation the accidental will apply to similarly named notes in different octaves.

    @@ -263,21 +264,23 @@ Please note that when you specify a chord in

    Volume
    A volume can be specified. The volume is a string like - ``ff'' surrounded by ``$< >$'' brackets. For example, to set the + ALT="$< >$">'' brackets. For example, to set the volume of a chord to ``very loud'', you could use the string - $<$ffff$<$ffff$>$ in the chord specification - (here) Of course, it is + ALT="$>$"> in the chord specification + (here) Of course, it is probably easier to set accented beats with the ACCENT - directive (here). + directive (here). A volume setting + applies to all the notes in the current chord and will be in effect + for the duration of the current bar.

    @@ -293,10 +296,10 @@ Please note that when you specify a chord in
    Null
    You can set a ``ignore'' or ``do nothing'' chord with the - simple notation ``$< >$''. If this is the only item in the chord + ALT="$< >$">''. If this is the only item in the chord then that chord will be ignored This means that no tones will be generated, and the offset into the bar will not be changed. The use of the notation is mainly for tilde notation with notes held over @@ -315,7 +318,7 @@ space and tab characters (which are ignored by
    - Solo Notation + Solo Notation
    @@ -531,8 +534,8 @@ The argument consists of a single digit ``0'' to ``7'' followed by a As an alternate, you can use a musical name like ``F'' or ``G#''.

    -The optional keywords ``Major'' or ``Minor'' (these can be abreviated -to ``Maj'' or ``Min'' ... and case doesn't count) can be added to this +The optional keywords ``Major'' or ``Minor'' (these can be abbreviated +to ``Maj'' or ``Min'' ...and case doesn't count) can be added to this command. This will accomplish two things:

    @@ -552,7 +555,7 @@ command. This will accomplish two things:

    Setting the key signature effects the notes used in SOLO or MELODY tracks and sets a MIDI Key Signature event.10.2 + HREF="#foot4278">10.2

    To summarize, the following are all valid KEYSIG directives: @@ -587,8 +590,8 @@ of ``{ }'' expressions in a chord line. They will be assigned to the tracks specified in the AUTOSOLOTRACKS directive.

    -By default, four tracks are assigned: Solo, Solo-1, -Solo-2, and Solo-3. This order can be changed: +By default, four tracks are assigned: Solo, Solo-1, +Solo-2, and Solo-3. This order can be changed:

    @@ -634,14 +637,14 @@ Of course, some voicing is also set ...and a chord line:

    -The note data {4a;b;c;d;} will be set to the Solo-1 +The note data {4a;b;c;d;} will be set to the Solo-1 track. But, if you've not set any other note data by way of -RIFF commands to Solo-2 and Solo-3, the note data +RIFF commands to Solo-2 and Solo-3, the note data will also be copied to these two tracks. Note that the track -Solo-4 is unaffected since it is not a +Solo-4 is unaffected since it is not a HARMONYONLY track. This feature can be very useful in creating harmony lines with the harmonies going to different instruments. The -supplied file egs/harmony.mma shows an example. +supplied file egs/harmony.mma shows an example.

    @@ -665,7 +668,7 @@ first thing to do is to set a track as a drum solo type:

    This will create a new SOLO track with the name -Solo-MyDrums and set its ``Drum'' flag. If the track already +Solo-MyDrums and set its ``Drum'' flag. If the track already exists and has data in it, the command will fail. The MIDI channel 10 is automatically assigned to all tracks created in this manner. You cannot change a ``drum'' track back to a normal track. @@ -752,10 +755,10 @@ the following example:
      Tone LowWoodBlock
    End -
       ... +
       ...
    Solo-Block Riff 4r; SnareDrum; * ; ; -
       ... +
       ...
    Solo-Block Riff 4;;;; @@ -770,8 +773,8 @@ on each beat.



    Footnotes

    -
    ... semicolon.10.1
    +
    ... semicolon.10.1
    I have borrowed heavily from the notation program MUP for the syntax used here. For notation I highly recommend MUP and use it for most of my notation tasks, including @@ -780,36 +783,37 @@ on each beat. HREF="http://www.Arkkra.com/">http://www.Arkkra.com/.
    -
    ... event.10.2
    +
    ... event.10.2
    For the most part, MIDI Key Signature events are ignored by playback - programs. However, they may be used in other MIDI programs + programs. However, they may be used in other MIDI programs which handle notation.
    -

    + +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node11.html b/mma/docs/html/ref/node11.html index d19506e..90e80e9 100644 --- a/mma/docs/html/ref/node11.html +++ b/mma/docs/html/ref/node11.html @@ -1,4 +1,4 @@ - + - + next - up - previous
    - Next: Chord Voicing - Up: Next: Randomizing + Up: Reference Manual - Previous: Previous: Solo and Melody Tracks
    -
    +

    @@ -80,7 +81,7 @@ melody.

    It might serve to look at the sample song files enclosed in this -package in the directory egs/aria. Compile and play them. Not too bad? +package in the directory egs/aria. Compile and play them. Not too bad?

    Just like other track, you can create as many ARIAs as you @@ -176,15 +177,24 @@ for each time event:

    e
    43 .. 03 $\Rightarrow$ 0 c
    54 .. 04 $\Rightarrow$ 0 c
    6-2 .. 2-2 $\Rightarrow$ 2 g
    7
    - Chord-Piano Voicing Mode=Optimal Rmove=10 Range=9 + RndSeed 123.56

    -In the following sections all the options available will be covered. +at the top of your song file. You can use any value you want: it +really doesn't make any difference, but different values will generate +different sequences.

    - -

    -Voicing Mode -

    +You can also use this with no value, in which case Python uses its own +value (see the Python manual for details). Essentially, using no value +undoes the effect which permits the mixing of random and not-so-random +sections in the same song.

    -The easiest way to deal with chord voicings is via the -VOICING MODE=XX option. - -

    -When choosing the inversion of a chord to play an accompanist will -take into consideration the style of the piece and the chord -sequences. In a general sense, this is referred to as ``voicing''. - -

    -A large number of the library files have been written to take -advantage of the following voicing commands. However, not all styles -of music take well to the concept. And, don't forget about the other -commands since they are useful in manipulating bass lines, as well as -other chord tracks (e.g., sustained strings). - -

    - -MMA has a variety of sophisticated, intelligent -algorithms12.1 to deal with voicing. - -

    -As a general rule you should not use the INVERT and -COMPRESS commands in conjunction with the VOICING -command. If you do, you may create beautiful sounds. But, the results -are more likely to be less-than-pleasing. Use of voicing and other -combinations will display various warning messages. - -

    -The main command to enable voicings is: +One interesting use of RNDSEED could be to ensure that a +repeated section is identical: simply start the section with something +like:

    -
    - Chord Voicing Mode=Type - -
    - -

    -As mentioned above, this command can only be applied to CHORD -tracks. Also note that this effects all bars in the sequence ... -you cannot have different voicings for different bars in the sequence -(attempting to do this would make no sense). - -

    -The following MODE types are available: - -

    -

    -
    Optimal
    -
    A basic algorithm which automatically chooses the best - sounding voicing depending on the voicing played before. Always try - this option before anything else. It might work just fine without - further work. - -

    -The idea behind this algorithm is to keep voicings in a sequence - close together. A pianist leaves his or her fingers where they are, - if they still fit the next chord. Then, the notes closest to the - fingers are selected for the next chord. This way characteristic - notes are emphasized. - -

    -

    -
    Root
    -
    This Option may for example be used to turn off - VOICING within a song. VOICING MODE=ROOT means nothing - else than doing nothing, leaving all chords in root position. - -

    -

    -
    None
    -
    This is the same as the ROOT option. - -

    -

    -
    Invert
    -
    Rather than basing the inversion selection on an - analysis of past chords, this method quite stupidly tries to keep - chords around the base point of ``C'' by inverting ``G'' and ``A'' - chords upward and ``D'', ``E'' and ``F'' downward. The chords are - also compressed. Certainly not an ideal algorithm, but it can be - used to add variety in a piece. - -

    -

    -
    Compressed
    -
    Does the same as the stand-alone COMPRESS - command. Like ROOT, it is only added to be used in some parts - of a song where VOICING MODE=OPTIMAL is used. - -

    -

    -
    - -

    - -

    -Voicing Range -

    - -

    -To get wider or closer voicings, you may define a range for the -voicings. This can be adjusted with the RANGE option: - -

    - - - -
    - Chord-Guitar Voicing Mode=Optimal Range=12 - -
    - -

    -In most cases the default value of 12 should work just fine. But, you -may want to fine tune ...it's all up to you. This command only -effects chords created with MODE=OPTIMAL. - -

    - -

    -Voicing Center -

    - -

    -Just minimizing the Euclidean distance between chords doesn't do the -trick as there could be runaway progressions that let the voicings -drift up or down infinitely. - -

    -When a chord is ``voiced'' or moved to a new position, a ``center -point'' must be used as a base. By default, the fourth degree of the -scale corresponding to the chord is a reasonable choice. However, you -can change this with: - -

    - - - -
    - Chord-1 Voicing Center=<value> - -
    - -

    -The value in this command can be any number in the range 0 to -12. Try different values. The color of your whole song might change. - -

    -Note that the value is the note in the scale, not a chord-note position. - -

    -This command only effects chords created with MODE=OPTIMAL. - -

    - -

    -Voicing Move -

    - -

    -To intensify a chord progression you may want to have ascending or -descending movement of voicings. This option, in conjunction with the -DIR optional (see below) sets the number of bars over which a -movement is done. - -

    -For the MOVE option to have any effect you must also set the -direction to either -1 or 1. Be careful that you don't force the chord -too high or low on the scale. Use of this command in a REPEAT -section can cause unexpected results. For this reason you should -include a SEQ command at the beginning of repeated sections of -your songs. - -

    -In most cases the use of this command is limited to a section of a -song, its use is not recommended in groove files. You might want to do -something like this in a song: - -

    - - -
    - ..select groove with voicing + Repeat
    -chords.. -
    -Chord-Piano Voicing Move=5 Dir=1 -
    -more chords.. -
    -Chord-Piano Voicing Move=5 Dir=-1 -
    -more chords..
    +RndSeed 8 +
    ...chords

    - -

    -Voicing Dir -

    - -

    -This option is used in conjunction with the MOVE option to set -the direction (-1 or 1) of the movement. +It is highly recommended that you do not use this command in +library files.

    -

    -Voicing Rmove -

    +

    +
    +RSkip +

    -As an alternate to movement in a specified direction, random movement -can add some color and variety to your songs. The command option is -quite useful (and safe to use) in groove files. The argument for this -option is a percentage value specifying the frequency to apply a move -in a random direction. - -

    -For example: +To aid in creating syncopated sounding patterns, you can use the +RSKIP directive to randomly silence or skip notes. The command +takes a value in the range 0 to 99. The ``0'' argument disables +skipping. For example:

    -
    - Chord-3 Voicing Mode=Optimal Rmove=20 - -
    - -

    -would cause a movement (randomly up or down) in 20% of the bars. As -noted earlier, using explicit movement instructions can move the chord -into an undesirable range or even ``off the keyboard''; however, the -algorithm used in RMOVE has a sanity check to ensure that the chord -center position remains, approximately, in a two octave range. - -

    - -

    + Begin Drum +
        Define D1 1 0 90 +
        Define D8 D1 * 8 +
        Sequence D8 +
        Tone OpenHiHat +
        RSkip 40
    -ChordAdjust -

    - -

    -The actual notes used in a chord are derived from a table which -contains the notes for each variation of a ``C'' chord--this data is -converted to the desired chord by adding or subtracting a constant -value according to the following table: - -

    -

    - - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    G$\flat$-6
    G-5
    G$\sharp$-4
    A$\flat$-4
    A-3
    A$\sharp$-2
    B$\flat$-2
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    B-1
    C$\flat$-1
    B$\sharp$0
    C0
    C$\sharp$1
    D$\flat$1
    D2
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - -
    D$\sharp$3
    E$\flat$3
    E4
    F$\flat$4
    E$\sharp$5
    F5
    F$\sharp$6
    -
    - - -
    - -
    - -

    -This means that when -MMA encounters an ``Am'' chord it adjusts the -notes in the chord table down by 3 MIDI values; an ``F'' chord is -adjusted 5 MIDI values up. This also means that ``A'' chords will -sound lower than ``F'' chords. - -

    -In most cases this works just fine; but, there are times when the -``F'' chord might sound better lower than the ``A''. You can -force a single chord by prefacing it with a single ``-'' or ``+'' -, details here. But, if the -entire song needs adjustment you can use CHORDADJUST -command to raise or lower selected chord pitches: - -

    - - -
    - ChordAdjust E=-1 F=-1 Bb=1 +End

    -Each item in the command consists of a pitch (``B$\flat$'', ``C'', -etc.) an ``='' and an octave specifier (-1, 0 or 1). The pitch values -are case sensitive and must be in upper case; there must not be -a space on either side of the ``=''. +In this case a drum pattern has been defined to hit short +``OpenHiHat'' notes 8 per bar. The RSKIP argument of ``40'' +causes the note to be NOT sounded (randomly) only 40% of the time.

    -To a large extent the need for octave adjustments depends on the chord -range of a song. For example, the supplied song ``A Day In The Life Of -A Fool'' needs all ``E'' and ``F'' chords to be adjusted down an -octave. +Using a value of ``10'' will cause notes to be skipped 10% of the +time (they are played 90% of the time), ``90'' means to skip the +notes 90% of the time, etc.

    -The value ``0'' will reset the adjustment to the original value; -setting a value a second time has no effect. - -

    - -

    -
    -Compress -

    - -

    -When -MMA grabs the notes for a chord, the notes are spread out from -the root position. This means that if you specify a ``C13'' you will -have an ``A'' nearly 2 octaves above the root note as part of the -chord. Depending on your instrumentation, pattern, and the chord -structure of your piece, notes outside of the ``normal'' single octave -range for a chord may sound strange. - -

    - - - -
    - Chord Compress 1 - -
    - -

    -Forces -MMA to put all chord notes in a single octave range. - -

    -This command is only effective in CHORD and ARPEGGIO -tracks. A warning message is printed if it is used in other contexts. - -

    -Notes: COMPRESS takes any value between 1 and 5 as arguments -(however, some values will have no effect as detailed above). You can -specify a different COMPRESS for each bar in a sequence. +You can specify a different RSKIP for each bar in a sequence. Repeated values can be represented with a ``/'':

    - Chord Compress 1 / 0 / + Scale RSkip 40 90 / 40

    -To restore to its default (off) setting, use a ``0'' as the argument. - -

    -For a similar command, with different results, see the LIMIT -command (here). +If you use the RSKIP in a chord track, the entire chord +will not be silenced. The option will be applied to the +individual notes of each chord. This may or may not be what you are +after. You cannot use this option to generate entire chords randomly. +For this effect you need to create several chord patterns and select +them with SEQRND.

    -

    +


    -DupRoot +RTime +

    + +

    +One of the biggest problem with computer generated drum and rhythm +tracks is that, unlike real musicians, the beats are precise and ``on +the beat''. The RTIME directive attempts to solve this. + +

    +The command can be applied to all tracks. + +

    + + + +
    + Drum-4 Rtime 4 + +
    + +

    +The value passed to the RTIME directive is the number of MIDI ticks +with which to vary the start time of the notes. For example, if you +specify ``5'' the start times will vary from -5 to +5 ticks) on each +note for the specified track. There are 192 MIDI ticks in each quarter +note. + +

    +Any value from 0 to 100 can be used; however values in the range 0 to +10 are most commonly used. Exercise caution in using large values! + +

    +You can specify a different RTIME for each bar in a sequence. +Repeated values can be represented with a ``/'': + +

    + + + +
    + Chord RTime 4 10 / 4 + +
    + +

    +RTIME is guaranteed never to start a note before the start of a +bar. + +

    + +

    +Other Randomizing Commands

    -To add a bit of fullness to chords, it is quite common of keyboard -players to duplicate the root tone of a chord into a lower (or higher) -octave. This is accomplished in -MMA with the command: - -

    - - - -
    - DupRoot -1 1 -1 1 - -
    - -

    -The command determines whether or not the root tone of a chord is -duplicated in another octave. By default notes are not added. A value -of -1 will add a note one octave lower than the root note, -2 will add -the tone 2 octaves lower, etc. Similarly, the value of 1 will add a -note one octave higher than the root tone, etc. - -

    -Only the values -9 to 9 are permitted. - -

    -The volume used for the generated note is an adjusted average of the -notes in the chord. This volume is always less than the chord -notes--which is probably what you want. If you want a loud bass note, -create a second track (probably a BASS track) with the -appropriate pattern. - -

    -Different values can be used in each bar of the sequence. - -

    -The option is reset to 0 after all SEQUENCE or SEQCLEAR -commands. - -

    -The DUPROOT command is only valid in CHORD tracks. - -

    - -

    -
    -Invert -

    - -

    -By default -MMA uses chords in the root position. By example, the -notes of a C major chord are C, E and G. Chords can be inverted -(something musicians do all the time). Sticking with the C major -chord, the first inversion shifts the root note up an octave and the -chord becomes E, G and C. The second inversion is G, C and E. - -

    - -MMA extends the concept of inversion a bit by permitting the shift -to be to the left or right, and the number of shifts is not limited. -So, you could shift a chord up several octaves by using large invert -values.12.2 -

    -Inversions apply to each bar of a sequence. So, the following is a good example: - -

    - - - -
    - SeqSize 4 -
    -Chord-1 Sequence STR1 -
    -Chord-1 Invert 0 1 0 1
    - -
    - -

    -Here the sequence pattern size is set to 4 bars and the pattern -for each bar in the Chord-1 track is set to ``STR1''. Without the next line, -this would result in a rather boring, repeating pattern. But, the -Invert command forces the chord to be in the root position for the -first bar, the first inversion for the second, etc. - -

    -You can use a negative Invert value: - -

    - - - -
    - Chord-1 Invert -1 - -
    - -

    -In this case the C major chord becomes G, C and E. - -

    -Note that using fewer Invert arguments than the current sequence size -is permitted. -MMA simply expands the number of arguments to the -current sequence size. You may use a ``/'' for a repeated value. - -

    -A SEQUENCE or CLEARSEQ command resets INVERT to 0. - -

    -This command on has an effect in CHORD and ARPEGGIO -tracks. And, frankly, ARPEGGIOs sound a bit odd with -inversions. - -

    -If you use a large value for INVERT you can force the notes out -of the normal MIDI range. In this case the lowest or highest possible -MIDI note value will be used. - -

    - -

    -
    -Limit -

    - -

    -If you use ``jazz'' chords in your piece, some people might not like -the results. To some folks, chords like 11th, 13th, and variations -have a dissonant sound. And, sometimes they are in a chart, but don't -really make sense. The LIMIT command can be used to set the -number of notes of a chord used. - -

    -For example: - -

    - - - -
    - Chord Limit 4 - -
    - -

    -will limit any chords used in the CHORD track to the first 4 -notes of a chord. So, if you have a C11 chord which is C, E, G, -B$\flat$, D, and F, the chord will be truncated to C, E, G and -B$\flat$. - -

    -This command only applies to CHORD and ARPEGGIO tracks. -It can be set for other tracks, but the setting will have no effect. - -

    -Notes: LIMIT takes any value between 0 and 8 as an argument. -The ``0'' argument will disable the command. This command applies to -all chords in the sequence--only one value can be given in the -command. - -

    -To restore to its default (off) setting, use a ``0'' as the argument. - -

    -For a similar command, with different results, see the COMPRESS -command (here). - -

    - -

    -
    -NoteSpan -

    - -

    -Many instruments have a limited range. For example, the bass section -of an accordion is limited to a single octave12.3To emulate these sounds it is a simple matter of limiting -MMA 's -output to match the instrument. For example, in the ``frenchwaltz'' -file you will find the directive: - -

    - - - -
    - Chord NoteSpan 48 59 - -
    - -

    -which forces all CHORD tones to the single octave represented -by the MIDI values 48 though 59. - -

    -This command is applied over other voicing commands like OCTAVE -and RANGE and even TRANSPOSE. Notes will still be -calculated with respect to these settings, but then they'll be forced -into the limited NOTESPAN. - -

    -NOTESPAN expects two arguments: The first is the range start, the -second the range end (first and last notes to use). The values are -MIDI tones and must be in the range 0 to 127. The first value must be -less than the second, and the range must represent at least one full -octave (12 notes). It can be applied to all tracks except DRUM. - -

    - -

    -
    -Range -

    - -

    -For ARPEGGIO and SCALE tracks you can specify the number -of octaves used. The effects of the RANGE command is slightly -different between the two. - -

    -SCALE: Scale tracks, by default, create three octave scales. -The RANGE value will modify this to the number of octaves -specified. For example: - -

    - - - -
    - Scale Range 1 - -
    - -

    -will force the scales to one octave. A value of 4 would create 4 -octave scales, etc. - -

    -You can use fractional values when specifying RANGE. For example: - -

    - - - -
    - Scale Range .3 - -
    - -

    -will create a scale of 2 notes.12.4 And, - -

    - - - -
    - Scale Range 1.5 - -
    - -

    -will create a scale of 10 notes. Now, this gets a bit more confusing for you if -you have set SCALETYPE CHROMATIC. In this case a RANGE 1 would -generate 12 notes, and RANGE 1.5 18. - -

    -Partial scales are useful in generating special effects. - -

    -ARPEGGIO: Normally, arpeggios use a single octave.12.5The RANGE command specifies the number of octaves12.6 to use. A fractional value can be used; the exact result -depends on the number of notes in the current chord. - -

    -In all cases the values of ``0'' and ''1'' have the same effect. - -

    -For both SCALE and ARPEGGIO there will always be a minimum of -two notes in the sequence. - -

    - -

    -
    -DefChord -

    - -

    - -MMA comes with a large number of chord types already defined. In -most cases, the supplied set (see this list) is sufficient for all the ``modern'' or -``pop'' charts normally encountered. However, there are those times -when you want to do something else, or something different. - -

    -You can define additional chord types at any time, or redefine -existing chord types. The DEFCHORD command makes no distinction -between a new chord type or a redefinition, with the exception that a -warning message is printed for the later. - -

    -The syntax of the command is quite strict: - -

    - - - -
    - DefChord NAME (NoteList) (ScaleList) - -
    - -

    -where: +In addition to the above, the following commands should be examined:

      -
    • Name can be any string, but cannot contain a ``/'', ``>'' or - space. It is case sensitive. Examples of valid names include - ``dim'', ``NO3'' and ``foo-12-xx''. +
    • Aria tracks + have a ``r'' option for the movement direction.

    • -
    • NoteList is a comma separated list of note offsets - (actually MIDI note values), all of which are enclosed in a set of - ``()''s. There must be at least 2 note offsets and no more than 8 - and all values must be in the range 0 to 24. Using an existing chord - type, a ``7'' chord would be defined with (0, 4, 7, 10). In the case - of a C7 chord, this translates to the notes (c, e, g, b$\flat$). +
    • The track Direction command has a ``random'' option for playing scales, + arpeggios, and other tracks.

    • -
    • ScaleList is a list of note offsets (again, MIDI note - values), all of which are enclosed in a set of ``()''s. There must - be exactly 7 values in the list and all values must be in the range - 0 to 24. Following on the C7 example above, the scale list would be - (0, 2, 4, 5, 7, 9, 10) or the notes (c, d, e, f, g, a, b$\flat$). +
    • RVOLUME makes random adjustments to the volume of each note. + +

      +

    • +
    • The VOICING command has an RMOVE option. + +

      +

    • +
    • RNDSET + lets you set a variable to a random value. + +

      +

    • +
    • SeqRnd + enables randomization of sequences; this randomization can be + fine-tuned with the SeqRndWeight command.

    -Some examples might clarify. First, assume that you have a section of -your piece which has a major chord, but you only want the root and -fifth to sound for the chords and you want the arpeggios and bass -notes to only use the root. You could create new patterns, but -it's just as easy to create a new chord type. - -

    - - - -
    - DefChord 15 (0,4) (0, 0, 0, 0, 0, 0, 0) -
    -15 C / G / -
    -16 C15 / G15
    - -
    - -

    -In this case a normal Major chords will be used in line 15. In line 16 -the new ``15'' will be used. Note the trick in the scale: by setting -all the offsets to ``0'' only the root note is available to the -WALK and BASS tracks. - -

    -Sometimes you'll see a new chord type that -MMA doesn't know. You -could write the author and ask him to add this new type, but if it is -something quite odd or rare, it might be easier to define it in your -song. Let's pretend that you've encountered a ``Cmaj12'' A reasonable -guess is that this is a major 7 with an added 12th (just the 5th up an -octave). You could change the ``maj12'' part of the chord to a ``M7'' -or ``maj7'' and it should sound fine. But: - -

    - - - -
    - DefChord maj12 (0, 4, 7, 11, 19) (0, 2, 4, 5, 7, 9, 11) - -
    - -

    -is much more fun. Note a few details: - -

    - -

      -
    • The name ``maj12'' can be used with any chord. You can have - ``Cmaj12'' or G$\flat$maj12''. - -

      -

    • -
    • ``maj12'' a case sensitive name. The name ``Maj12'' is quite - different (and unknown). - -

      -

    • -
    • A better name might be ``maj(add12)''. - -

      -

    • -
    • The note and scale offsets are MIDI values. They are easy to - figure if you think of the chord as a ``C''. Just count off notes - from ``C'' on a keyboard (C is note 0). - -

      -

    • -
    • Do Not include a chord name (ie: C or B$\flat$) in the - definition. Just the type. - -

      -

    • -
    - -

    -The final example handles a minor problem in -MMA and ``diminished'' -chords. In most of the music the author of -MMA encounters, the -marking ``dim'' on a chord usually means a ``diminished 7th''. So, -when -MMA initializes it creates a copy of the ``dim7'' and calls it -``dim''. But, some people think that ``dim'' should reference a -``diminished triad''. It's pretty easy to change this by creating a -new definition for ``dim'': - -

    - - - -
    - DefChord dim (0, 3, 6) (0, 2, 3, 5, 6, 8, 9 ) - -
    - -

    -In this example the scale notes use the same notes as those in a -``dim7''. You might want to change the B$\flat{}\flat$ (9) to B$\flat$ -(10) or B (11). If you really disagree with the choice to make a dim7 -the default you could even put this in a mmarc file. - -

    -It is even easier to use the non-standard notation ``dim3'' to specify -a diminished triad. - -

    - -

    -PrintChord -

    - -

    -This command can be used to make the create of custom chords a bit -simpler. Simply pass one or more chord types after the command and -they will be displayed on your terminal. Example: - -

    - - - -
    - PrintChord m M7 dim - -
    - -

    -in a file should display: - -

    - - - -
    - m : (0, 3, 7) (0, 2, 3, 5, 7, 9, 11) Minor triad. -
    -M7 : (0, 4, 7, 11) (0, 2, 4, 5, 7, 9, 11) Major 7th. -
    -dim : (0, 3, 6, 9) (0, 2, 3, 5, 6, 8, 9) Diminished. -MMA assumes a - diminished 7th.
    - -
    - -

    -From this you can cut and paste, change the chord or scale and insert -the data into a DEFCHORD command. - -

    - -

    -Notes -

    - -

    - -MMA makes other adjustments on-the-fly to your chords. This is done -to make the resulting sounds ``more musical'' ...to keep life -interesting, the definition of ``more musical'' is quite elusive. The -following notes will try to list some of the more common adjustments -made ``behind your back''. - -

    - -

      -
    • Just before the notes (MIDI events) for a chord are generated - the first and last notes in the chord are compared. If they are a - separated by a half-step (or 1 MIDI value) or an octave plus - half-step, the volume of the first note is halved. This happens in - chords such as a Major-7th or Flat-9th. If the adjustment is - not done the dissonance between the two tones overwhelms the ear. - -

      -

    • -


    Footnotes

    -
    ... -algorithms12.1
    -
    Great thanks are due to Alain Brenzikofer who not - only pressured me into including the VOICING options, but - wrote a great deal of the actual code. +
    ... values12.1
    +
    Yes, + this is a contradiction of terms.
    -
    ... -values.12.2
    -
    The term ``shift'' is used here, but that's not - quite what -MMA does. The order of the notes in the internal buffer - stays the same, just the octave for the notes is changed. So, if the - chord notes are ``C E G'' with the MIDI values ``0, 4, 7'' an invert - of 1 would change the notes to ``C$^{2}$ E G'' and the MIDI values - to ``12, 4, 7''. - -
    -
    ... octave12.3
    -
    Some accordions - have ``freebass'' switches which overcomes this, but that is the - exception. - -
    -
    ... notes.12.4
    -
    Simple math here: take the number of notes in a scale (7) and -multiply by .3. Take the integer result as the number of notes. - -
    -
    ... octave.12.5
    -
    Not quite true: they -use whatever notes are in the chord, which might exceed an octave span. - -
    -
    ... octaves12.6
    -
    Again, not quite true: the -command just duplicates the arpeggio notes the number of times specified in the -RANGE setting. - -
    -

    + +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node13.html b/mma/docs/html/ref/node13.html index 6976eb3..6a589a6 100644 --- a/mma/docs/html/ref/node13.html +++ b/mma/docs/html/ref/node13.html @@ -1,4 +1,4 @@ - + -Harmony - +Chord Voicing + @@ -25,320 +25,1287 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next: Tempo and Timing - Up: Next: Harmony + Up: Reference Manual - Previous: Chord Voicing -
    + Previous: Randomizing
    +
    Subsections +

    - +
    -Harmony +Chord Voicing +

    + +

    +In music, a chord is simply defined as two more notes played +simultaneously. Now, this doesn't mean that you can play just any two +or three notes and get a chord which sounds nice--but whatever you do +get will be a chord of some type. And, to further confuse the unwary, +different arrangements of the same notes sound better (or worse) in +different musical situations. + +

    +As a simple example, consider a C major chord. Built on the first, +third and fifth notes of a C major scale it can be manipulated into a +variety of sounds: + +

    +

    + Lost Image + +
    + +

    +These are all C major chords ...but they all have a different +sound or color. The different forms a chord can take are called +``voicings''. Again, this manual is not intended to be a primer on +musical theory--that's a subject for which lots of lessons with your +favorite music teacher is recommended. You'll need a bit of +basic music theory if you want to understand how and why +MMA creates its tracks. + +

    +The different options in this chapter effect not only the way chords +are constructed, but also the way bass lines and other tracks are +formed. + +

    +There are generally two ways in +MMA to take care of voicings. + +

    + +

      +
    1. use +MMA 's extensive VOICING options, most likely with + the ''Optimal'' voicing algorithm, + +

      +

    2. +
    3. do everything by yourself with the commands INVERT and + COMPRESS. + +

      +

    4. +
    + +

    +The commands LIMIT and DUPROOT may be used independently +for both variants. + +

    + +

    +Voicing +

    + +

    +The VOICING command is used to set the voicing mode and several +other options relating to the selected mode. The command needs to have +a CHORD track specified and a series of Option=Value pairs. For +example: + +

    + + + +
    + Chord-Piano Voicing Mode=Optimal Rmove=10 Range=9 + +
    + +

    +In the following sections all the options available will be covered. + +

    + +

    +Voicing Mode +

    + +

    +The easiest way to deal with chord voicings is via the +VOICING MODE=XX option. + +

    +When choosing the inversion of a chord to play an accompanist will +take into consideration the style of the piece and the chord +sequences. In a general sense, this is referred to as ``voicing''. + +

    +A large number of the library files have been written to take +advantage of the following voicing commands. However, not all styles +of music take well to the concept. And, don't forget about the other +commands since they are useful in manipulating bass lines, as well as +other chord tracks (e.g., sustained strings). + +

    + +MMA has a variety of sophisticated, intelligent +algorithms13.1 to deal with voicing. + +

    +As a general rule you should not use the INVERT and +COMPRESS commands in conjunction with the VOICING +command. If you do, you may create beautiful sounds. But, the results +are more likely to be less-than-pleasing. Use of voicing and other +combinations will display various warning messages. + +

    +The main command to enable voicings is: + +

    + + + +
    + Chord Voicing Mode=Type + +
    + +

    +As mentioned above, this command can only be applied to CHORD +tracks. Also note that this effects all bars in the sequence ... +you cannot have different voicings for different bars in the sequence +(attempting to do this would make no sense). + +

    +The following MODE types are available: + +

    +

    +
    Optimal
    +
    A basic algorithm which automatically chooses the best + sounding voicing depending on the voicing played before. Always try + this option before anything else. It might work just fine without + further work. + +

    +The idea behind this algorithm is to keep voicings in a sequence + close together. A pianist leaves his or her fingers where they are, + if they still fit the next chord. Then, the notes closest to the + fingers are selected for the next chord. This way characteristic + notes are emphasized. + +

    +

    +
    Root
    +
    This Option may for example be used to turn off + VOICING within a song. VOICING MODE=ROOT means nothing + else than doing nothing, leaving all chords in root position. + +

    +

    +
    None
    +
    This is the same as the ROOT option. + +

    +

    +
    Invert
    +
    Rather than basing the inversion selection on an + analysis of past chords, this method quite stupidly tries to keep + chords around the base point of ``C'' by inverting ``G'' and ``A'' + chords upward and ``D'', ``E'' and ``F'' downward. The chords are + also compressed. Certainly not an ideal algorithm, but it can be + used to add variety in a piece. + +

    +

    +
    Compressed
    +
    Does the same as the stand-alone COMPRESS + command. Like ROOT, it is only added to be used in some parts + of a song where VOICING MODE=OPTIMAL is used. + +

    +

    +
    + +

    + +

    +Voicing Range +

    + +

    +To get wider or closer voicings, you may define a range for the +voicings. This can be adjusted with the RANGE option: + +

    + + + +
    + Chord-Guitar Voicing Mode=Optimal Range=12 + +
    + +

    +In most cases the default value of 12 should work just fine. But, you +may want to fine tune ...it's all up to you. This command only +effects chords created with MODE=OPTIMAL. + +

    + +

    +Voicing Center +

    + +

    +Just minimizing the Euclidean distance between chords doesn't do the +trick as there could be runaway progressions that let the voicings +drift up or down infinitely. + +

    +When a chord is ``voiced'' or moved to a new position, a ``center +point'' must be used as a base. By default, the fourth degree of the +scale corresponding to the chord is a reasonable choice. However, you +can change this with: + +

    + + + +
    + Chord-1 Voicing Center=<value> + +
    + +

    +The value in this command can be any number in the range 0 to +12. Try different values. The color of your whole song might change. + +

    +Note that the value is the note in the scale, not a chord-note position. + +

    +This command only effects chords created with MODE=OPTIMAL. + +

    + +

    +Voicing Move +

    + +

    +To intensify a chord progression you may want to have ascending or +descending movement of voicings. This option, in conjunction with the +DIR optional (see below) sets the number of bars over which a +movement is done. + +

    +For the MOVE option to have any effect you must also set the +direction to either -1 or 1. Be careful that you don't force the chord +too high or low on the scale. Use of this command in a REPEAT +section can cause unexpected results. For this reason you should +include a SEQ command at the beginning of repeated sections of +your songs. + +

    +In most cases the use of this command is limited to a section of a +song, its use is not recommended in groove files. You might want to do +something like this in a song: + +

    + + + +
    + ...select groove with voicing +
    +chords ... +
    +Chord-Piano Voicing Move=5 Dir=1 +
    +more chords... +
    +Chord-Piano Voicing Move=5 Dir=-1 +
    +more chords...
    + +
    + +

    + +

    +Voicing Dir +

    + +

    +This option is used in conjunction with the MOVE option to set +the direction (-1 or 1) of the movement. + +

    + +

    + +
    +Voicing Rmove +

    + +

    +As an alternate to movement in a specified direction, random movement +can add some color and variety to your songs. The command option is +quite useful (and safe to use) in groove files. The argument for this +option is a percentage value specifying the frequency to apply a move +in a random direction. + +

    +For example: + +

    + + + +
    + Chord-3 Voicing Mode=Optimal Rmove=20 + +
    + +

    +would cause a movement (randomly up or down) in 20% of the bars. As +noted earlier, using explicit movement instructions can move the chord +into an undesirable range or even ``off the keyboard''; however, the +algorithm used in RMOVE has a sanity check to ensure that the chord +center position remains, approximately, in a two octave range. + +

    + +

    +
    +ChordAdjust +

    + +

    +The actual notes used in a chord are derived from a table which +contains the notes for each variation of a ``C'' chord--this data is +converted to the desired chord by adding or subtracting a constant +value according to the following table: + +

    +

    + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    G$\flat$-6
    G-5
    G$\sharp$-4
    A$\flat$-4
    A-3
    A$\sharp$-2
    B$\flat$-2
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    B-1
    C$\flat$-1
    B$\sharp$0
    C0
    C$\sharp$1
    D$\flat$1
    D2
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    D$\sharp$3
    E$\flat$3
    E4
    F$\flat$4
    E$\sharp$5
    F5
    F$\sharp$6
    +
    + + +
    + +
    + +

    +This means that when +MMA encounters an ``Am'' chord it adjusts the +notes in the chord table down by 3 MIDI values; an ``F'' chord is +adjusted 5 MIDI values up. This also means that ``A'' chords will +sound lower than ``F'' chords. + +

    +In most cases this works just fine; but, there are times when the +``F'' chord might sound better lower than the ``A''. You can +force a single chord by prefacing it with a single ``-'' or ``+'' +, details here. But, if the +entire song needs adjustment you can use CHORDADJUST +command to raise or lower selected chord pitches: + +

    + + + +
    + ChordAdjust E=-1 F=-1 Bb=1 + +
    + +

    +Each item in the command consists of a pitch (``B$\flat$'', ``C'', +etc.) an ``='' and an octave specifier (-1, 0 or 1). The pitch values +are case sensitive and must be in upper case; there must not be +a space on either side of the ``=''. + +

    +To a large extent the need for octave adjustments depends on the chord +range of a song. For example, the supplied song ``A Day In The Life Of +A Fool'' needs all ``E'' and ``F'' chords to be adjusted down an +octave. + +

    +The value ``0'' will reset the adjustment to the original value; +setting a value a second time has no effect. + +

    + +

    +
    +Compress +

    + +

    +When +MMA grabs the notes for a chord, the notes are spread out from +the root position. This means that if you specify a ``C13'' you will +have an ``A'' nearly 2 octaves above the root note as part of the +chord. Depending on your instrumentation, pattern, and the chord +structure of your piece, notes outside of the ``normal'' single octave +range for a chord may sound strange. + +

    + + + +
    + Chord Compress 1 + +
    + +

    +Forces +MMA to put all chord notes in a single octave range. + +

    +This command is only effective in CHORD and ARPEGGIO +tracks. A warning message is printed if it is used in other contexts. + +

    +Notes: COMPRESS takes any value between 1 and 5 as arguments +(however, some values will have no effect as detailed above). You can +specify a different COMPRESS for each bar in a sequence. +Repeated values can be represented with a ``/'': + +

    + + + +
    + Chord Compress 1 / 0 / + +
    + +

    +To restore to its default (off) setting, use a ``0'' as the argument. + +

    +For a similar command, with different results, see the LIMIT +command (here). + +

    + +

    +
    +DupRoot +

    + +

    +To add a bit of fullness to chords, it is quite common of keyboard +players to duplicate the root tone of a chord into a lower (or higher) +octave. This is accomplished in +MMA with the command: + +

    + + + +
    + DupRoot -1 1 -1 1 + +
    + +

    +The command determines whether or not the root tone of a chord is +duplicated in another octave. By default notes are not added. A value +of -1 will add a note one octave lower than the root note, -2 will add +the tone 2 octaves lower, etc. Similarly, the value of 1 will add a +note one octave higher than the root tone, etc. + +

    +Only the values -9 to 9 are permitted. + +

    +The volume used for the generated note is an adjusted average of the +notes in the chord. This volume is always less than the chord +notes--which is probably what you want. If you want a loud bass note, +create a second track (probably a BASS track) with the +appropriate pattern. + +

    +Different values can be used in each bar of the sequence. + +

    +The option is reset to 0 after all SEQUENCE or SEQCLEAR +commands. + +

    +The DUPROOT command is only valid in CHORD tracks. + +

    + +

    +
    +Invert +

    + +

    +By default +MMA uses chords in the root position. By example, the +notes of a C major chord are C, E and G. Chords can be inverted +(something musicians do all the time). Sticking with the C major +chord, the first inversion shifts the root note up an octave and the +chord becomes E, G and C. The second inversion is G, C and E. + +

    + +MMA extends the concept of inversion a bit by permitting the shift +to be to the left or right, and the number of shifts is not limited. +So, you could shift a chord up several octaves by using large invert +values.13.2 +

    +Inversions apply to each bar of a sequence. So, the following is a good example: + +

    + + + +
    + SeqSize 4 +
    +Chord-1 Sequence STR1 +
    +Chord-1 Invert 0 1 0 1
    + +
    + +

    +Here the sequence pattern size is set to 4 bars and the pattern +for each bar in the Chord-1 track is set to ``STR1''. Without the next line, +this would result in a rather boring, repeating pattern. But, the +Invert command forces the chord to be in the root position for the +first bar, the first inversion for the second, etc. + +

    +You can use a negative Invert value: + +

    + + + +
    + Chord-1 Invert -1 + +
    + +

    +In this case the C major chord becomes G, C and E. + +

    +Note that using fewer Invert arguments than the current sequence size +is permitted. +MMA simply expands the number of arguments to the +current sequence size. You may use a ``/'' for a repeated value. + +

    +A SEQUENCE or CLEARSEQ command resets INVERT to 0. + +

    +This command on has an effect in CHORD and ARPEGGIO +tracks. And, frankly, ARPEGGIOs sound a bit odd with +inversions. + +

    +If you use a large value for INVERT you can force the notes out +of the normal MIDI range. In this case the lowest or highest possible +MIDI note value will be used. + +

    + +

    +
    +Limit +

    + +

    +If you use ``jazz'' chords in your piece, some people might not like +the results. To some folks, chords like 11th, 13th, and variations +have a dissonant sound. And, sometimes they are in a chart, but don't +really make sense. The LIMIT command can be used to set the +number of notes of a chord used. + +

    +For example: + +

    + + + +
    + Chord Limit 4 + +
    + +

    +will limit any chords used in the CHORD track to the first 4 +notes of a chord. So, if you have a C11 chord which is C, E, G, +B$\flat$, D, and F, the chord will be truncated to C, E, G and +B$\flat$. + +

    +This command only applies to CHORD and ARPEGGIO tracks. +It can be set for other tracks, but the setting will have no effect. + +

    +Notes: LIMIT takes any value between 0 and 8 as an argument. +The ``0'' argument will disable the command. This command applies to +all chords in the sequence--only one value can be given in the +command. + +

    +To restore to its default (off) setting, use a ``0'' as the argument. + +

    +For a similar command, with different results, see the COMPRESS +command (here). + +

    + +

    +
    +NoteSpan +

    + +

    +Many instruments have a limited range. For example, the bass section +of an accordion is limited to a single octave13.3To emulate these sounds it is a simple matter of limiting +MMA 's +output to match the instrument. For example, in the ``frenchwaltz'' +file you will find the directive: + +

    + + + +
    + Chord NoteSpan 48 59 + +
    + +

    +which forces all CHORD tones to the single octave represented +by the MIDI values 48 though 59. + +

    +This command is applied over other voicing commands like OCTAVE +and RANGE and even TRANSPOSE. Notes will still be +calculated with respect to these settings, but then they'll be forced +into the limited NOTESPAN. + +

    +NOTESPAN expects two arguments: The first is the range start, the +second the range end (first and last notes to use). The values are +MIDI tones and must be in the range 0 to 127. The first value must be +less than the second, and the range must represent at least one full +octave (12 notes). It can be applied to all tracks except DRUM. + +

    + +

    +
    +Range +

    + +

    +For ARPEGGIO and SCALE tracks you can specify the number +of octaves used. The effects of the RANGE command is slightly +different between the two. + +

    +SCALE: Scale tracks, by default, create three octave scales. +The RANGE value will modify this to the number of octaves +specified. For example: + +

    + + + +
    + Scale Range 1 + +
    + +

    +will force the scales to one octave. A value of 4 would create 4 +octave scales, etc. + +

    +You can use fractional values when specifying RANGE. For example: + +

    + + + +
    + Scale Range .3 + +
    + +

    +will create a scale of 2 notes.13.4 And, + +

    + + + +
    + Scale Range 1.5 + +
    + +

    +will create a scale of 10 notes. Now, this gets a bit more confusing for you if +you have set SCALETYPE CHROMATIC. In this case a RANGE 1 would +generate 12 notes, and RANGE 1.5 18. + +

    +Partial scales are useful in generating special effects. + +

    +ARPEGGIO: Normally, arpeggios use a single octave.13.5The RANGE command specifies the number of octaves13.6 to use. A fractional value can be used; the exact result +depends on the number of notes in the current chord. + +

    +In all cases the values of ``0'' and ''1'' have the same effect. + +

    +For both SCALE and ARPEGGIO there will always be a minimum of +two notes in the sequence. + +

    + +

    +
    +DefChord

    -MMA can generate harmony notes for you ...just like hitting two -or more keys on the piano! And you don't have to take lessons. +MMA comes with a large number of chord types already defined. In +most cases, the supplied set (see this list) is sufficient for all the ``modern'' or +``pop'' charts normally encountered. However, there are those times +when you want to do something else, or something different.

    -Automatic harmonies are available for the following track types: Bass, -Walk, Arpeggio, Scale, Solo and Melody. +You can define additional chord types at any time, or redefine +existing chord types. The DEFCHORD command makes no distinction +between a new chord type or a redefinition, with the exception that a +warning message is printed for the later.

    -Just in case you are thinking that -MMA is a wonderful musical -creator when it comes to harmonies, don't be fooled. -MMA 's ideas of -harmony are quite facile. It determines harmony notes by finding a -note lower or higher than the current note being sounded within the -current chord. And its notion of ``open'' is certainly not that of -traditional music theory. But, the sound isn't too bad. - -

    - -

    -
    -Harmony -

    - -

    -To enable harmony notes, use a command like: +The syntax of the command is quite strict:

    - Solo Harmony 2 + DefChord NAME (NoteList) (ScaleList)

    -You can set a different harmony method for each bar in your sequence. +where:

    -The following are valid harmony methods: -

    -
    2 or 2Below
    -
    Two part harmony. The harmony note - selected is lower (on the scale). +
      +
    • Name can be any string, but cannot contain a ``/'', ``>'' or + space. It is case sensitive. Examples of valid names include + ``dim'', ``NO3'' and ``foo-12-xx''.

      +

    • +
    • NoteList is a comma separated list of note offsets + (actually MIDI note values), all of which are enclosed in a set of + ``()''s. There must be at least 2 note offsets and no more than 8 + and all values must be in the range 0 to 24. Using an existing chord + type, a ``7'' chord would be defined with (0, 4, 7, 10). In the case + of a C7 chord, this translates to the notes (c, e, g, b$\flat$). + +

      +

    • +
    • ScaleList is a list of note offsets (again, MIDI note + values), all of which are enclosed in a set of ``()''s. There must + be exactly 7 values in the list and all values must be in the range + 0 to 24. Following on the C7 example above, the scale list would be + (0, 2, 4, 5, 7, 9, 10) or the notes (c, d, e, f, g, a, b$\flat$). + +

      +

    • +
    + +

    +Some examples might clarify. First, assume that you have a section of +your piece which has a major chord, but you only want the root and +fifth to sound for the chords and you want the arpeggios and bass +notes to only use the root. You could create new patterns, but +it's just as easy to create a new chord type. + +

    + + + +
    + DefChord 15 (0,4) (0, 0, 0, 0, 0, 0, 0) +
    +15 C / G / +
    +16 C15 / G15
    + +
    + +

    +In this case a normal Major chords will be used in line 15. In line 16 +the new ``15'' will be used. Note the trick in the scale: by setting +all the offsets to ``0'' only the root note is available to the +WALK and BASS tracks. + +

    +Sometimes you'll see a new chord type that +MMA doesn't know. You +could write the author and ask him to add this new type, but if it is +something quite odd or rare, it might be easier to define it in your +song. Let's pretend that you've encountered a ``Cmaj12'' A reasonable +guess is that this is a major 7 with an added 12th (just the 5th up an +octave). You could change the ``maj12'' part of the chord to a ``M7'' +or ``maj7'' and it should sound fine. But: + +

    + + + +
    + DefChord maj12 (0, 4, 7, 11, 19) (0, 2, 4, 5, 7, 9, 11) + +
    + +

    +is much more fun. Note a few details: + +

    + +

      +
    • The name ``maj12'' can be used with any chord. You can have + ``Cmaj12'' or G$\flat$maj12''. + +

      +

    • +
    • ``maj12'' a case sensitive name. The name ``Maj12'' is quite + different (and unknown). + +

      +

    • +
    • A better name might be ``maj(add12)''. + +

      +

    • +
    • The note and scale offsets are MIDI values. They are easy to + figure if you think of the chord as a ``C''. Just count off notes + from ``C'' on a keyboard (C is note 0). + +

      +

    • +
    • Do Not include a chord name (i.e. C or B$\flat$) in the + definition. Just the type. + +

      +

    • +
    + +

    +The final example handles a minor problem in +MMA and ``diminished'' +chords. In most of the music the author of +MMA encounters, the +marking ``dim'' on a chord usually means a ``diminished 7th''. So, +when +MMA initializes it creates a copy of the ``dim7'' and calls it +``dim''. But, some people think that ``dim'' should reference a +``diminished triad''. It's pretty easy to change this by creating a +new definition for ``dim'': + +

    + + + +
    + DefChord dim (0, 3, 6) (0, 2, 3, 5, 6, 8, 9 ) + +
    + +

    +In this example the scale notes use the same notes as those in a +``dim7''. You might want to change the B$\flat{}\flat$ (9) to B$\flat$ +(10) or B (11). If you really disagree with the choice to make a dim7 +the default you could even put this in a mmarc file. + +

    +It is even easier to use the non-standard notation ``dim3'' to specify +a diminished triad. + +

    + +

    +PrintChord +

    + +

    +This command can be used to make the create of custom chords a bit +simpler. Simply pass one or more chord types after the command and +they will be displayed on your terminal. Example: + +

    + + + +
    + PrintChord m M7 dim + +
    + +

    +in a file should display: + +

    + + + +
    + m : (0, 3, 7) (0, 2, 3, 5, 7, 9, 11) Minor triad. +
    +M7 : (0, 4, 7, 11) (0, 2, 4, 5, 7, 9, 11) Major 7th. +
    +dim : (0, 3, 6, 9) (0, 2, 3, 5, 6, 8, 9) Diminished. +MMA assumes a + diminished 7th.
    + +
    + +

    +From this you can cut and paste, change the chord or scale and insert +the data into a DEFCHORD command. + +

    + +

    +Notes +

    + +

    + +MMA makes other adjustments on-the-fly to your chords. This is done +to make the resulting sounds ``more musical'' ...to keep life +interesting, the definition of ``more musical'' is quite elusive. The +following notes will try to list some of the more common adjustments +made ``behind your back''. + +

    + +

      +
    • Just before the notes (MIDI events) for a chord are generated + the first and last notes in the chord are compared. If they are a + separated by a half-step (or 1 MIDI value) or an octave plus + half-step, the volume of the first note is halved. This happens in + chords such as a Major-7th or Flat-9th. If the adjustment is + not done the dissonance between the two tones overwhelms the ear. + +

      +

    • +
    +

    Footnotes

    +
    +
    ... +algorithms13.1
    +
    Great thanks are due to Alain Brenzikofer who not + only pressured me into including the VOICING options, but + wrote a great deal of the actual code. +
    -
    2Above
    -
    The same as ``2'', but the harmony note is raised an - octave. +
    ... +values.13.2
    +
    The term ``shift'' is used here, but that's not + quite what +MMA does. The order of the notes in the internal buffer + stays the same, just the octave for the notes is changed. So, if the + chord notes are ``C E G'' with the MIDI values ``0, 4, 7'' an invert + of 1 would change the notes to ``C$^{2}$ E G'' and the MIDI values + to ``12, 4, 7''. -

    -
    3 or 3Below
    -
    Three part harmony. The harmony notes - selected are lower. +
    ... octave13.3
    +
    Some accordions + have ``freebass'' switches which overcomes this, but that is the + exception. -

    -
    3Above
    -
    The same as ``3'', but both notes are raised an - octave. +
    ... notes.13.4
    +
    Simple math here: take the number of notes in a scale (7) and +multiply by .3. Take the integer result as the number of notes. -

    -
    Open or OpenBelow
    -
    Two part harmony, however the gap - between the two notes is larger than in ``2''. +
    ... octave.13.5
    +
    Not quite true: they +use whatever notes are in the chord, which might exceed an octave span. -

    -
    OpenAbove
    -
    Same as ``Open'', but the added note is above the - original. +
    ... octaves13.6
    +
    Again, not quite true: the +command just duplicates the arpeggio notes the number of times specified in the +RANGE setting. -

    -

    -
    8 or 8Below
    -
    A note 1 octave lower is added. - -

    -

    -
    8Above
    -
    A note 2 octave higher is added. - -

    -

    -
    16 or 16Below
    -
    A single note two octaves below is - added. - -

    -

    -
    16Above
    -
    A single note two octaves above are added. - -

    -

    -
    24 or 24Below
    -
    A single note three octaves below is - added. - -

    -

    -
    24Above
    -
    A single note three octaves above is added. - -

    - -

    -You can combine any of the above harmony modes by using a ``+''. For -example: - -

    -
    OPEN+8Below
    -
    will produce harmony notes with an ``Open'' - harmony and a note an octave below the current note. - -

    -

    -
    3Above+16
    -
    will generate 2 harmony notes above the current - note plus a note 2 octaves below. - -

    -

    -
    8Below+8Above+16Below
    -
    will generate 3 notes: one 2 octaves - below the current, one an octave below, and one an octave above. - -

    -

    -
    - -

    -There is no limit to the number of modes you can concatenate. Any -duplicate notes generated will be ignored. - -

    -All harmonies are created using the current chord. - -

    -To disable harmony use a ``0'', ``-'' or ``None''. - -

    -Be careful in using harmonies. They can make your song sound heavy, -especially with BASS notes (applying a different volume may -help). - -

    -The command has no effect in DRUM or CHORD tracks. - -

    - -

    -
    -HarmonyOnly -

    - -

    -As a added feature to the automatic harmony generation discussed in -the previous section, it is possible to set a track so that it -only plays the harmony notes. For example, you might want to -set up two arpeggio tracks with one playing quarter notes on a piano -and a harmony track playing half notes on a violin. The following -snippet is extracted from the song file ``Cry Me A River'' and sets up -2 different choir voices: - -

    - - - -
    - Begin Arpeggio -
        Sequence A4 -
        Voice ChoirAahs -
        Invert 0 1 2 3 -
        SeqRnd -
        Octave 5 -
        RSkip 40 -
        Volume p -
        Articulate 99 -
    -End -
                 -
    -Begin Arpeggio-2 -
        Sequence A4 -
        Voice VoiceOohs -
        Octave 5 -
        RSkip 40 -
        Volume p -
        Articulate 99 -
        HarmonyOnly Open -
    -End
    - -
    - -

    -Just like the HARMONY command, above, you can have different -settings for each bar in your sequence. Setting a bar (or the entire -sequence) to '`-'' or ``0'' disables both the HARMONY and -HARMONYONLY settings. - -

    -The command has no effect in DRUM or CHORD tracks. - -

    -If you want to use this feature with SOLO or MELODY -tracks you can duplicate the notes in your RIFF or in-line -notation or with the AUTOHARMONYTRACKS - COMMAND. - -

    - -

    -
    -HarmonyVolume -

    - -

    -By default, -MMA will use a volume (velocity) of 80% of that used by -the original note for all harmony notes it generates. You can change -this with the the HARMONYVOLUME command. For example: - -

    - - - -
    - Begin Solo -
      Voice JazzGuitar -
      Harmony Open -
      HarmonyVolume 80 -
    -End
    - -
    - -

    -You can specify different values for each bar in the sequence. The -values are percentages and must be greater than 0 (large values works -just fine if you want the harmony louder than the original). The -command has no effect in DRUM or CHORD tracks. -


    +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node14.html b/mma/docs/html/ref/node14.html index 8541607..ac5ca49 100644 --- a/mma/docs/html/ref/node14.html +++ b/mma/docs/html/ref/node14.html @@ -1,4 +1,4 @@ - + -Tempo and Timing - +Harmony + @@ -25,911 +25,324 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next: Swing - Up: Next: Tempo and Timing + Up: Reference Manual - Previous: Harmony -
    + Previous: Chord Voicing
    +
    Subsections -
      -
    • Tempo -
    • Time -
    • TimeSig -
    • BeatAdjust -
    • Fermata -
    • Cut +

      - +
      -Tempo and Timing +Harmony

      -MMA has a rich set of commands to adjust and vary the timing of your -song. +MMA can generate harmony notes for you ...just like hitting two +or more keys on the piano! And you don't have to take lessons. + +

      +Automatic harmonies are available for the following track types: Bass, +Walk, Arpeggio, Scale, Solo and Melody. + +

      +Just in case you are thinking that +MMA is a wonderful musical +creator when it comes to harmonies, don't be fooled. +MMA 's ideas of +harmony are quite facile. It determines harmony notes by finding a +note lower or higher than the current note being sounded within the +current chord. And its notion of ``open'' is certainly not that of +traditional music theory. But, the sound isn't too bad.

      -

      -Tempo -

      +

      +
      +Harmony +

      -The tempo of a piece is set in Beats per Minute with the ``Tempo'' -directive. +To enable harmony notes, use a command like:

      - Tempo 120 + Solo Harmony 2

      -sets the tempo to 120 beats/minute. You can also use the tempo command -to increase or decrease the current rate by including a leading ``+'', -``-'' or ``*'' in the rate. For example (assuming the current rate is -120): +You can set a different harmony method for each bar in your sequence.

      +The following are valid harmony methods: - - -
      - Tempo +10 - -
      +

      +
      2 or 2Below
      +
      Two part harmony. The harmony note + selected is lower (on the scale).

      -will increase the current rate to 130 beats/minute. - -

      -The tempo can be changed series of beats, much like a rit. or acc. in -real music. Assuming that a time signature of 4/4, the current tempo -is 120, and there are 4 beats in a bar, the command: - -

      - - - -
      - Tempo 100 1 - -
      - -

      -will cause 4 tempo entries to be placed in the current bar (in the -MIDI meta track). The start of the bar will be 115, the 2nd beat will -be at 110, the 3rd at 105 and the last at 100. - -

      -You can also vary an existing rate using a ``+'', ``-'' or ``*'' in -the rate. - -

      -You can vary the tempo over more than one bar. For example: - -

      - - - -
      - Tempo +20 5.5 - -
      - -

      -tells -MMA to increase the tempo by 20 beats per minute and to step -the increase over the next five and a half bars. Assuming a start -tempo of 100 and 4 beats/bar, the meta track will have a tempo -settings of 101, 102, 103 ...120. This will occur over 22 beats -(5.5 bars * 4 beats) of music. - -

      -Using the multiplier is handy if you are switching to ``double time'': - -

      - - - -
      - Tempo *2 - -
      - -

      -and to return: - -

      - - - -
      - Temp *.5 - -
      - -

      -Note that the ``+'', ``-'' or ``*'' sign must not be separated -from the tempo value by any spaces. The value for TEMPO can be -any value, but will be converted to integer for the final setting. - -

      - -

      -
      -Time -

      - -

      - -MMA doesn't really understand time signatures. It just cares about -the number of beats in a bar. So, if you have a piece in -4/4 time you would use: - -

      - - - -
      - Time 4 - -
      - -

      -For 3/4 use: - -

      - - - -
      - Time 3 - -
      - -

      -For 6/8 you'd probably want either ``2'' or ``6''. - -

      -Changing the time also cancels all existing sequences. So, after a -time directive you'll need to set up your sequences or load a new -groove.14.1 -

      - -

      -TimeSig -

      - -

      -Even though -MMA doesn't really use Time Signatures, some MIDI -programs do recognize and use them. So, here's a command which will -let you insert a Time Signature in your MIDI output: - -

      - - - -
      - TimeSig NN DD - -
      - -

      -The NN parameter is the time signature numerator (the number of beats -per bar). In 3/4 you would set this to ``3''. - -

      -The DD parameter is the time signature denominator (the length of the -note getting a single beat). In 3/4 you would set this to -``4''. - -

      -The NN value must be an integer in the range of 1 to 126. The DD value -must be one of 1, 2, 4, 8, 16, 32 or 64. - -

      - -MMA assumes that all songs are in 4/4 and places that -MIDI event at offset 0 in the Meta track. - -

      -The TIMESIG value is remembered by GROOVEs and is -properly set when grooves are switched. You should probably have a -time signature in any groove library files you create (the supplied -files all do). - -

      -The common time signatures ``common'' and ``cut'' are supported. They -are translated by -MMA to 4/4 and 2/2. - -

      - -

      -
      -BeatAdjust -

      - -

      -Internally, -MMA tracks its position in a song according to beats. -For example, in a 4/4 piece the beat position is -incremented by 4 after each bar is processed. For the most part, this -works fine; however, there are some conditions when it would be nice -to manually adjust the beat position: - -

      - -

        -
      • Insert some extra (silent) beats at the end of bar to simulate a pause, - -

        -

      • -
      • Delete some beats to handle a ``short'' bar. - -

        -

      • -
      • Change a pattern in the middle of a bar. - -

        -

      • -
      - -

      -Each problem will be dealt with in turn. In this - example a pause is simulated at the end of bar -10. One problem with this logic is that the inserted beat will be -silent, but certain notes (percussive things like piano) often will -continue to sound (this is related to the decay of the note, not that - -MMA has not turned off the note). Frankly, this really doesn't -work too well ...which is why the FERMATA -(details here) was added. - -

      - - - - -
      - Adding Extra Beats -
      - - - - -
      - Time 4 -
      -1 Cm / / / -
      ... -
      -10 Am / C / -
      -BeatAdjust 1 -
      ...
      - -
      - - -
      - -

      - -

      -In this example the problem of -the ``short bar'' is handled. In this example, the sheet music has the -majority of the song in 4/4 time, but bar 4 is in -2/4. This could be handled by setting the TIME -setting to 2 and creating some different patterns. Forcing silence on -the last 2 beats and backing up the counter is a bit easier. - -

      - - - - -
      - Short Bar Adjustment -
      - - - - -
      - 1 Cm / / / -
      ... -
      -4 Am / z! / -
      -BeatAdjust -2 -
      ...
      - -
      - - -
      - -

      - -

      -Note that the adjustment factor can be a partial beat. For example: - -

      - - - -
      - BeatAdjust .5 - -
      - -

      -will insert half of a beat between the current bars. - -

      -Finally in this example, the problem of -overlapping bars is handled. We want to change the GROOVE -in the middle of a bar. So, we create the third bar two times. The first one -has a ``z!'' (silence) for beats 3 and 4; the second has ``z!'' for beats 1 and 2. This -permits the two halves to overlap without conflict. The BEATADJUST -forces the two bars to overlap completely. - -

      - - - - -
      - Mid-Bar Groove Change -
      - - - - -
      - Groove BigBand -
      -1 C -
      -Groove BigBandFill -
      -2 Am -
      -3 / / z! -
      -BeatAdjust -4 -
      -Groove BigBand -
         z! / F -
      -5 F -
      ...
      - -
      - - -
      - -

      - -

      - -

      -
      -Fermata -

      - -

      -A ``fermata'' or ``pause'' in written music tells the musician to hold -a note for a longer period than the notation would otherwise indicate. -In standard music notation it is represented by a -`` -\rotatebox{270}{\textbf{(\raisebox{.5ex}{.}}}'' -above a note. - -

      -To indicate all this -MMA uses a command like: - -

      - - - -
      - Fermata 1 1 200 - -
      - -

      -Note that there are three parts to the command: - -

      - -

        -
      1. The beat offset from the current point in the score to apply the - ``pause''. The offset can be positive or negative and is calculated - from the current bar. Positive numbers will apply to the next bar; - negative to the previous. For offsets into the next bar you use - offsets starting at ``0''; for offsets into the previous bar an - offset of ``-1'' represents the last beat in that bar. - -

        -For example, if you were in 4/4 time and wanted the - quarter note at the end of the next bar to be paused, you would use - an offset of 3. The same effect can be achieved by putting the - FERMATA command after the bar and using an offset of -1. - -

        -

      2. -
      3. The duration of the pause in beats. For example, if you have a - quarter note to pause your duration would be 1, a half note (or 2 - quarter notes) would be 2. - -

        -

      4. -
      5. The adjustment. This represented as a percentage of the current - value. For example, to force a note to be held for twice the normal - time you would use 200 (two-hundred percent). You can use a value - smaller than 100 to force a shorter note, but this is seldom done. - -

        -

      6. -
      - -

      -This example shows how you can -place a FERMATA before or after the effected bar. - -

      - - - - -
      - Fermata -
      - - Lost Image - -

      - - - -
      - -MMA Equivalent -
      -
      -Fermata 3 1 200 -
      -C -
      -Gm7
      - -
      - -
      -

      - - - -
      - Alternate -
      -
      -C -
      -Fermata -1 1 200 -
      -Gm7
      - -
      - - -

      - -

      - -

      -Here the second example shows -the first four bars of a popular torch song. The problem with the -piece is that the first beat of bar four needs to be paused, and the -accompaniment style has to switch in the middle of the bar. The -example shows how to split the fourth bar with the first beat on one -line and the balance on a second. The ``z!''s are used to ``fill in'' -the 4 beats skipped by the BEATADJUST. - -

      - - - - -
      - Fermata with Cut -
      - -

      - Lost Image - -

      - - - -
      - C C#dim -
      -G7 -
      -C / C#dim -
      -G7 z! -
      -Fermata -4 1 200 -
      -Cut -3 -
      -BeatAdjust -3.5 -
      -Groove EasySwing -
      -z! G7 C7
      - -
      - -

      - - -

      - -

      - -

      -The following conditions will generate warning messages: - -

      - -

        -
      • A beat offset greater than one bar, - -

        -

      • -
      • A duration greater than one bar, - -

        -

      • -
      • An adjustment value less than 100. - -

        -

      • -
      - -

      -This command works by adjusting the global tempo in the MIDI meta -track at the point of the fermata. In most cases you can put more than -one FERMATA command in the same bar, but they should be in beat -order (no checks are done). If the FERMATA command has a -negative position argument, special code is invoked to remove any -note-on events in the duration specified, after the start of the -beat.14.2 This means that extra rhythm notes will -not be sounded--probably what you expect a held note to sound like. - -

      - -

      -
      -Cut -

      - -

      -This command was born of the need to simulate a ``cut'' or, more -correctly, a ``caesura''. This is indicated in music by two parallel -lines put at the top of a staff indicating the end of a musical -thought. The symbol is also referred to as ``railroad tracks''. - -

      -The idea is to stop the music on all tracks, pause briefly, and -resume.14.3 -

      - -MMA provides the CUT command to help deal with this -situation. But, before the command is described in detail, a -diversion: just how is a note or chord sustained in a MIDI file? - -

      -Assume that a -MMA input file (and the associated library) -files dictates that some notes are to be played from beat 2 to beat 4 -in an arbitrary bar. What -MMA does is: - -

      - -

        -
      • determine the position in the piece as a midi offset to the - current bar, - -

        -

      • -
      • calculate the start and end times for the notes, - -

        -

      • -
      • adjust the times (if necessary) based on adjustable features - such as STRUM, ARTICULATE, RTIME, etc., - -

        -

      • -
      • insert the required MIDI ``note on'' and ``note off'' commands - at the appropriate point in the track. - -

        -

      • -
      - -

      -You may think that a given note starts on beat 2 and ends (using -ARTICULATE 100) right on beat 3--but you would most likely be -wrong. So, if you want the note or chord to be ``cut'', what point do -you use to instruct -MMA correctly? Unfortunately, the simple answer -is ``it depends''. Again, the answers will consist of some examples. - -

      -In this first case you wish to stop the track in the middle of the last -bar. The simplest answer is: - -

      - - - -
      - 1 C -
      ... -
      -36 C / z! / -
      - -
      - -

      -Unfortunately, this will ``almost'' work. But, any chords which are -longer than one or two beats may continue to sound. This, often, gives -a ``dirty'' sound to the end of the piece. The simple solution is to -add to the end of the piece: - -

      - - - -
      - Cut -2 - -
      - -

      -Depending on the rhythm you might have to fiddle a bit with the cut -value. But, the example here puts a ``all notes off'' message in all -the active tracks at the start of beat 3. The exact same result can be -achieved by placing: - -

      - - - -
      - Cut 3 - -
      - -

      -before the final bar. - -

      -In this second example a tiny bit of silence is desired between bars 4 and -5 (this might be the end of a musical introduction). The following bit should -work: - -

      - - - -
      - 1 C -
      -2 G -
      -3 G -
      -4 C -
      -Cut -
      -BeatAdjust .2 -
      -5 G -
      ...
      - -
      - -

      -In this case the ``all notes off'' is placed at the end of bar 4 and -two-tenths of a beat is inserted at the same location. Bar 5 continues -the track. - -

      -The final example show how you might combine CUT with -FERMATA. In this case the sheet music shows a caesura after the -first quarter note and fermatas over the quarter notes on beats 2, 3 -and 4. - -

      - - - -
      - 1 C C#dim -
      -2 G7 -
      -3 C / C#dim -
      -Fermata 1 3 120 -
      -Cut 1.9 -
      -Cut 2.9 -
      -Cut 3.9 -
      -4 G7 / C7 / -
      -5 F6
      - -
      - -

      -A few tutorial notes on the above: - -

      - -

        -
      • The command - -

        - - - -
        - Fermata 1 3 120 - -
        - -

        -applies a slow-down in tempo to the second beat for the following - bar (an offset of 1), for 3 beats. These 3 beats will be played 20% - slower than the set tempo. - -

        -

      • -
      • The three CUT commands insert MIDI ``all notes off'' in - all the active tracks just before beats 2, 3 and 4. - -

        -

      • -
      - -

      -Finally, the proper syntax for the command: - -

      - - - -
      - [Voice] Cut [Offset] - -
      - -

      -If the voice is omitted, MIDI ``all notes off'' will be inserted into -each active track. - -

      -If the offset is omitted, the current bar position will be used. This -the same as using an offset value of 0. -


      Footnotes

      -
      -
      ... -groove.14.1
      -
      The time value is saved/restored with grooves so - setting a time is redundant in this case. -
      -
      ... -beat.14.2
      -
      Technically speaking, -MMA determines an interval - starting 5% of a beat after the start of the fermata to a point 5% - of a beat before the end. Any MIDI Note-On events in this range (in - all tracks) are deleted. +
      2Above
      +
      The same as ``2'', but the harmony note is raised an + octave. +

      -
      ... -resume.14.3
      -
      The answer to the music theory question of whether - the ``pause'' takes time from the current beat or is treated - as a ``fermata'' is not clear--but as far as -MMA is concerned the - command has no effect on timing. +
      3 or 3Below
      +
      Three part harmony. The harmony notes + selected are lower. +

      -

      +
      3Above
      +
      The same as ``3'', but both notes are raised an + octave. + +

      +

      +
      Open or OpenBelow
      +
      Two part harmony, however the gap + between the two notes is larger than in ``2''. + +

      +

      +
      OpenAbove
      +
      Same as ``Open'', but the added note is above the + original. + +

      +

      +
      8 or 8Below
      +
      A note 1 octave lower is added. + +

      +

      +
      8Above
      +
      A note 2 octave higher is added. + +

      +

      +
      16 or 16Below
      +
      A single note two octaves below is + added. + +

      +

      +
      16Above
      +
      A single note two octaves above are added. + +

      +

      +
      24 or 24Below
      +
      A single note three octaves below is + added. + +

      +

      +
      24Above
      +
      A single note three octaves above is added. + +

      +

      +
      + +

      +You can combine any of the above harmony modes by using a ``+''. For +example: + +

      +
      OPEN+8Below
      +
      will produce harmony notes with an ``Open'' + harmony and a note an octave below the current note. + +

      +

      +
      3Above+16
      +
      will generate 2 harmony notes above the current + note plus a note 2 octaves below. + +

      +

      +
      8Below+8Above+16Below
      +
      will generate 3 notes: one 2 octaves + below the current, one an octave below, and one an octave above. + +

      +

      +
      + +

      +There is no limit to the number of modes you can concatenate. Any +duplicate notes generated will be ignored. + +

      +All harmonies are created using the current chord. + +

      +To disable harmony use a ``0'', ``-'' or ``None''. + +

      +Be careful in using harmonies. They can make your song sound heavy, +especially with BASS notes (applying a different volume may +help). + +

      +The command has no effect in DRUM or CHORD tracks. + +

      + +

      +
      +HarmonyOnly +

      + +

      +As a added feature to the automatic harmony generation discussed in +the previous section, it is possible to set a track so that it +only plays the harmony notes. For example, you might want to +set up two arpeggio tracks with one playing quarter notes on a piano +and a harmony track playing half notes on a violin. The following +snippet is extracted from the song file ``Cry Me A River'' and sets up +2 different choir voices: + +

      + + + +
      + Begin Arpeggio +
          Sequence A4 +
          Voice ChoirAahs +
          Invert 0 1 2 3 +
          SeqRnd +
          Octave 5 +
          RSkip 40 +
          Volume p +
          Articulate 99 +
      +End +
                   +
      +Begin Arpeggio-2 +
          Sequence A4 +
          Voice VoiceOohs +
          Octave 5 +
          RSkip 40 +
          Volume p +
          Articulate 99 +
          HarmonyOnly Open +
      +End
      + +
      + +

      +Just like the HARMONY command, above, you can have different +settings for each bar in your sequence. Setting a bar (or the entire +sequence) to '`-'' or ``0'' disables both the HARMONY and +HARMONYONLY settings. + +

      +The command has no effect in DRUM or CHORD tracks. + +

      +If you want to use this feature with SOLO or MELODY +tracks you can duplicate the notes in your RIFF or in-line +notation or with the AUTOHARMONYTRACKS + COMMAND. + +

      + +

      +
      +HarmonyVolume +

      + +

      +By default, +MMA will use a volume (velocity) of 80% of that used by +the original note for all harmony notes it generates. You can change +this with the the HARMONYVOLUME command. For example: + +

      + + + +
      + Begin Solo +
        Voice JazzGuitar +
        Harmony Open +
        HarmonyVolume 80 +
      +End
      + +
      + +

      +You can specify different values for each bar in the sequence. The +values are percentages and must be greater than 0 (large values works +just fine if you want the harmony louder than the original). The +command has no effect in DRUM or CHORD tracks. + +

      + +

      bob -2007-03-07 +2008-09-28
      diff --git a/mma/docs/html/ref/node15.html b/mma/docs/html/ref/node15.html index 70417a1..9e7383f 100644 --- a/mma/docs/html/ref/node15.html +++ b/mma/docs/html/ref/node15.html @@ -1,4 +1,4 @@ - + -Swing - +Tempo and Timing + @@ -25,283 +25,913 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
      - Next: Volume and Dynamics - Up: Next: Swing + Up: Reference Manual - Previous: Tempo and Timing -
      + Previous: Harmony
      +
      + +Subsections -

      + + +
      + +

      +
      -Swing +Tempo and Timing

      -In jazz and swing music there is a convention to apply special timing -to eighth notes. Normally, the first of a pair of eights is lengthened -and the second is shortened. In the sheet music this can is sometimes -notated as sequences of a dotted eighth followed by a sixteenth. But, -if you were to foolish enough to play the song with this timing you'd -get a funny look from a jazz musician who will tell you to ``swing'' -the notes. -

      -The easiest way to think about swing eighths is to mentally convert -them to a triplet consisting of a quarter note and and eighth. - -

      -

      - Lost Image - -
      - -

      -In the above music the first and second bar are both played as -in the third. +MMA has a rich set of commands to adjust and vary the timing of your +song.

      -MMA can handle this musical style in a number of ways, the control -is though the SWINGMODE command and options. +

      +Tempo +

      -In default mode -MMA assumes that you don't want your song to swing. - -

      -To enable automatic conversions, simply set SWINGMODE to ``on'': +The tempo of a piece is set in Beats per Minute with the ``Tempo'' +directive.

      - SwingMode On + Tempo 120

      -This directive accepts the value ``On'' and ``Off'' or ``1'' and -``0''. +sets the tempo to 120 beats/minute. You can also use the tempo command +to increase or decrease the current rate by including a leading ``+'', +``-'' or ``*'' in the rate. For example (assuming the current rate is +120):

      -With SWINGMODE enabled -MMA takes some extra steps when creating -patterns and processing of SOLO and MELODY parts. + + + +
      + Tempo +10 + +
      + +

      +will increase the current rate to 130 beats/minute. + +

      +The tempo can be changed series of beats, much like a rit. or accin +real music. Assuming that a time signature of 4/4, the current tempo +is 120, and there are 4 beats in a bar, the command: + +

      + + + +
      + Tempo 100 1 + +
      + +

      +will cause 4 tempo entries to be placed in the current bar (in the +MIDI meta track). The start of the bar will be 115, the 2nd beat will +be at 110, the 3rd at 105 and the last at 100. + +

      +You can also vary an existing rate using a ``+'', ``-'' or ``*'' in +the rate. + +

      +You can vary the tempo over more than one bar. For example: + +

      + + + +
      + Tempo +20 5.5 + +
      + +

      +tells +MMA to increase the tempo by 20 beats per minute and to step +the increase over the next five and a half bars. Assuming a start +tempo of 100 and 4 beats/bar, the meta track will have a tempo +settings of 101, 102, 103 ...120. This will occur over 22 beats +(5.5 bars * 4 beats) of music. + +

      +Using the multiplier is handy if you are switching to ``double time'': + +

      + + + +
      + Tempo *2 + +
      + +

      +and to return: + +

      + + + +
      + Temp *.5 + +
      + +

      +Note that the ``+'', ``-'' or ``*'' sign must not be separated +from the tempo value by any spaces. The value for TEMPO can be +any value, but will be converted to integer for the final setting. + +

      + +

      +
      +Time +

      + +

      + +MMA doesn't really understand time signatures. It just cares about +the number of beats in a bar. So, if you have a piece in +4/4 time you would use: + +

      + + + +
      + Time 4 + +
      + +

      +For 3/4 use: + +

      + + + +
      + Time 3 + +
      + +

      +For 6/8 you'd probably want either ``2'' or ``6''. + +

      +Changing the time also cancels all existing sequences. So, after a +time directive you'll need to set up your sequences or load a new +groove.15.1 +

      + +

      +TimeSig +

      + +

      +Even though +MMA doesn't really use Time Signatures, some MIDI +programs do recognize and use them. So, here's a command which will +let you insert a Time Signature in your MIDI output: + +

      + + + +
      + TimeSig NN DD + +
      + +

      +The NN parameter is the time signature numerator (the number of beats +per bar). In 3/4 you would set this to ``3''. + +

      +The DD parameter is the time signature denominator (the length of the +note getting a single beat). In 3/4 you would set this to +``4''. + +

      +The NN value must be an integer in the range of 1 to 126. The DD value +must be one of 1, 2, 4, 8, 16, 32 or 64. + +

      + +MMA assumes that all songs are in 4/4 and places that +MIDI event at offset 0 in the Meta track. + +

      +The TIMESIG value is remembered by GROOVEs and is +properly set when grooves are switched. You should probably have a +time signature in any groove library files you create (the supplied +files all do). + +

      +The common time signatures ``common'' and ``cut'' are supported. They +are translated by +MMA to 4/4 and 2/2. + +

      + +

      +
      +BeatAdjust +

      + +

      +Internally, +MMA tracks its position in a song according to beats. +For example, in a 4/4 piece the beat position is +incremented by 4 after each bar is processed. For the most part, this +works fine; however, there are some conditions when it would be nice +to manually adjust the beat position:

        -
      • Any eighth note in a pattern ``on the beat'' (1, 2, etc.) is converted to a - ``81'' note. +
      • Insert some extra (silent) beats at the end of bar to simulate a pause,

      • -
      • Any eighth note is a pattern ``off the beat'' (1.5, 2.5, etc.) - is converted to ``82'' note, and the offset is adjusted to the prior - beat plus the value of an ``81'' note. +
      • Delete some beats to handle a ``short'' bar.

      • -
      • Drum notes with a value of a single MIDI tick are handled in the - same way, but only the offset adjustment is needed. - -

        -

      • -
      • In SOLO and MELODY tracks any successive pairs of - eighth notes (or rests) are adjusted. +
      • Change a pattern in the middle of a bar.

      -Important: when defining patterns and sequences remember that -the adjustment is made when the pattern is compiled. With a -DEFINE command the arguments are compiled (and swing -will be applied). But a SEQUENCE command with an -already defined pattern will use the existing pattern values (the -swing adjustment may or may not have been done at define -time). Finally, if you have a dynamic define in the sequence the -adjustment will take place if needed. +Each problem will be dealt with in turn. In this + example a pause is simulated at the end of bar +10. One problem with this logic is that the inserted beat will be +silent, but certain notes (percussive things like piano) often will +continue to sound (this is related to the decay of the note, not that -

      -SWINGMODE has an additional option, SKEW. This factor -is used to create the ``81'' and ``82'' -note lengths (see here). By -default the value ``66'' is used. This simply means that the note -length ``81'' is assigned 66% of the value of an eight note, and -``82'' is assigned 34%. - -

      -You can change this setting at any point in your song or style -files. It will take effect immediately on all future patterns and solo -lines. - -

      -The setting: +MMA has not turned off the note). Frankly, this really doesn't +work too well ...which is why the FERMATA +(details here) was added.

      + + + +
      + Adding Extra Beats +
      + + -
      - SwingMode Skew=60 - -
      - -

      -will set a 60/40 setting. - -

      -If you want to experiment, find a GROOVE with note lengths of -``81'' and ``82'' (``swing'' is as good a choice as any). Now, put a -SWINGMODE SKEW=VALUE directive at the top of your song file (before -selecting any GROOVEs). Compile and play the song with different values -to hear the effects. - -

      -If you want to play with different effects you could do something like -this: - -

      - - - -
      - SwingMode On Skew=40 -
      ... Set CHORD pattern/groove + Time 4
      -SwingMode Skew=30 -
      ... Set Drum-1 pattern/groove +1 Cm / / / +
      ...
      -SwingMode Skew=whatever -
      ... Set Drum-2
      - -
      - -

      -This will give different rates for different tracks. I'll probably not -enjoy your results, but I play polkas on the accordion for fun. - -

      -The complete SWINGMODE setting is saved in the current GROOVE and can be accessed -via the $_SwingMode built-in macro. - -

      -The easy (and ugly and unintuitive) way to handle swing is to -hard-code the value right into your patterns. For example, you could -set a swing chord pattern with: - -

      - - - -
      - Chord Define Swing8 1 3+3 80; 1.33 3 80; 2 3+3 80; 2.33 3 80 ... - -
      - -

      -We really don't recommend this for the simple reason that the swing -rate is frozen as quarter/eighth triplets. - -

      -If you refer to the table of note lengths -(here) you will find the cryptic -values of ``81'' and ``82''. These notes are adjusted depending of the -SWINGSKEW value. So: - -

      - - - -
      - Chord Define Swing8 1 81 80; 1+81 82 80; 2 81 80; 2+81 82 80 ... - -
      - -

      -is a bit better. In this case we have set a chord on beat 1 as the -first of an eighth note, and a chord on the off-beat as the -second. Note how we specify the off-beats as ``1+81'', etc. - -

      -In this example the feel of the swing will vary with the -SWINGSKEW setting. - -

      -But, aren't computers supposed to make life simple? Well, here is our -recommended method: - -

      - - - +
      - SwingMode On +10 Am / C /
      -Chord Define Swing8 1 8 80; 1.5 8 80; 2 8 80; 2.5 8 80 ...
      +BeatAdjust 1 +
      ... + +
      + + +

      + +

      + +

      +In this example the problem of +the ``short bar'' is handled. In this example, the sheet music has the +majority of the song in 4/4 time, but bar 4 is in +2/4. This could be handled by setting the TIME +setting to 2 and creating some different patterns. Forcing silence on +the last 2 beats and backing up the counter is a bit easier. + +

      + + + + +
      + Short Bar Adjustment +
      + + + + +
      + 1 Cm / / / +
      ... +
      +4 Am / z! / +
      +BeatAdjust -2 +
      ...
      + +
      + + +
      + +

      + +

      +Note that the adjustment factor can be a partial beat. For example: + +

      + + +
      + BeatAdjust .5

      -Now, -MMA will convert the values for you. Magic, well ...almost. +will insert half of a beat between the current bars.

      -There are times when you will need to be more explicit, especially in -SOLO and MELODY tracks: +Finally in this example, the problem of +overlapping bars is handled. We want to change the GROOVE +in the middle of a bar. So, we create the third bar two times. The first one +has a ``z!'' (silence) for beats 3 and 4; the second has ``z!'' for beats 1 and 2. This +permits the two halves to overlap without conflict. The BEATADJUST +forces the two bars to overlap completely. + +

      + + + + +
      + Mid-Bar Groove Change +
      + + + + +
      + Groove BigBand +
      +1 C +
      +Groove BigBandFill +
      +2 Am +
      +3 / / z! +
      +BeatAdjust -4 +
      +Groove BigBand +
         z! / F +
      +5 F +
      ...
      + +
      + + +
      + +

      + +

      + +

      +
      +Fermata +

      + +

      +A ``fermata'' or ``pause'' in written music tells the musician to hold +a note for a longer period than the notation would otherwise indicate. +In standard music notation it is represented by a +`` +\rotatebox{270}{\textbf{(\raisebox{.5ex}{.}}}'' +above a note. + +

      +To indicate all this +MMA uses a command like: + +

      + + + +
      + Fermata 1 1 200 + +
      + +

      +Note that there are three parts to the command: + +

      + +

        +
      1. The beat offset from the current point in the score to apply the + ``pause''. The offset can be positive or negative and is calculated + from the current bar. Positive numbers will apply to the next bar; + negative to the previous. For offsets into the next bar you use + offsets starting at ``0''; for offsets into the previous bar an + offset of ``-1'' represents the last beat in that bar. + +

        +For example, if you were in 4/4 time and wanted the + quarter note at the end of the next bar to be paused, you would use + an offset of 3. The same effect can be achieved by putting the + FERMATA command after the bar and using an offset of -1. + +

        +

      2. +
      3. The duration of the pause in beats. For example, if you have a + quarter note to pause your duration would be 1, a half note (or 2 + quarter notes) would be 2. + +

        +

      4. +
      5. The adjustment. This represented as a percentage of the current + value. For example, to force a note to be held for twice the normal + time you would use 200 (two-hundred percent). You can use a value + smaller than 100 to force a shorter note, but this is seldom done. + +

        +

      6. +
      + +

      +This example shows how you can +place a FERMATA before or after the effected bar. + +

      + + + + +
      + Fermata +
      + + Lost Image + +

      + + + +
      + +MMA Equivalent +
      +
      +Fermata 3 1 200 +
      +C +
      +Gm7
      + +
      + +
      +

      + + + +
      + Alternate +
      +
      +C +
      +Fermata -1 1 200 +
      +Gm7
      + +
      + + +

      + +

      + +

      +Here the second example shows +the first four bars of a popular torch song. The problem with the +piece is that the first beat of bar four needs to be paused, and the +accompaniment style has to switch in the middle of the bar. The +example shows how to split the fourth bar with the first beat on one +line and the balance on a second. The ``z!''s are used to ``fill in'' +the 4 beats skipped by the BEATADJUST. + +

      + + + + +
      + Fermata with Cut +
      + +

      + Lost Image + +

      + + + +
      + C C#dim +
      +G7 +
      +C / C#dim +
      +G7 z! +
      +Fermata -4 1 200 +
      +Cut -3 +
      +BeatAdjust -3.5 +
      +Groove EasySwing +
      +z! G7 C7
      + +
      + +

      + + +

      + +

      + +

      +The following conditions will generate warning messages:

        -
      • If a bar has both swing and straight eighths. +
      • A beat offset greater than one bar,

      • -
      • If the note following an eighth is not an eight. +
      • A duration greater than one bar, + +

        +

      • +
      • An adjustment value less than 100.

      -
      + +

      +This command works by adjusting the global tempo in the MIDI meta +track at the point of the fermata. In most cases you can put more than +one FERMATA command in the same bar, but they should be in beat +order (no checks are done). If the FERMATA command has a +negative position argument, special code is invoked to remove any +note-on events in the duration specified, after the start of the +beat.15.2 This means that extra rhythm notes will +not be sounded--probably what you expect a held note to sound like. + +

      + +

      +
      +Cut +

      + +

      +This command was born of the need to simulate a ``cut'' or, more +correctly, a ``caesura''. This is indicated in music by two parallel +lines put at the top of a staff indicating the end of a musical +thought. The symbol is also referred to as ``railroad tracks''. + +

      +The idea is to stop the music on all tracks, pause briefly, and +resume.15.3 +

      + +MMA provides the CUT command to help deal with this +situation. But, before the command is described in detail, a +diversion: just how is a note or chord sustained in a MIDI file? + +

      +Assume that a +MMA input file (and the associated library) +files dictates that some notes are to be played from beat 2 to beat 4 +in an arbitrary bar. What +MMA does is: + +

      + +

        +
      • determine the position in the piece as a midi offset to the + current bar, + +

        +

      • +
      • calculate the start and end times for the notes, + +

        +

      • +
      • adjust the times (if necessary) based on adjustable features + such as STRUM, ARTICULATE, RTIME, etc., + +

        +

      • +
      • insert the required MIDI ``note on'' and ``note off'' commands + at the appropriate point in the track. + +

        +

      • +
      + +

      +You may think that a given note starts on beat 2 and ends (using +ARTICULATE 100) right on beat 3--but you would most likely be +wrong. So, if you want the note or chord to be ``cut'', what point do +you use to instruct +MMA correctly? Unfortunately, the simple answer +is ``it depends''. Again, the answers will consist of some examples. + +

      +In this first case you wish to stop the track in the middle of the last +bar. The simplest answer is: + +

      + + + +
      + 1 C +
      ... +
      +36 C / z! / +
      + +
      + +

      +Unfortunately, this will ``almost'' work. But, any chords which are +longer than one or two beats may continue to sound. This, often, gives +a ``dirty'' sound to the end of the piece. The simple solution is to +add to the end of the piece: + +

      + + + +
      + Cut -2 + +
      + +

      +Depending on the rhythm you might have to fiddle a bit with the cut +value. But, the example here puts a ``all notes off'' message in all +the active tracks at the start of beat 3. The exact same result can be +achieved by placing: + +

      + + + +
      + Cut 3 + +
      + +

      +before the final bar. + +

      +In this second example a tiny bit of silence is desired between bars 4 and +5 (this might be the end of a musical introduction). The following bit should +work: + +

      + + + +
      + 1 C +
      +2 G +
      +3 G +
      +4 C +
      +Cut +
      +BeatAdjust .2 +
      +5 G +
      ...
      + +
      + +

      +In this case the ``all notes off'' is placed at the end of bar 4 and +two-tenths of a beat is inserted at the same location. Bar 5 continues +the track. + +

      +The final example show how you might combine CUT with +FERMATA. In this case the sheet music shows a caesura after the +first quarter note and fermatas over the quarter notes on beats 2, 3 +and 4. + +

      + + + +
      + 1 C C#dim +
      +2 G7 +
      +3 C / C#dim +
      +Fermata 1 3 120 +
      +Cut 1.9 +
      +Cut 2.9 +
      +Cut 3.9 +
      +4 G7 / C7 / +
      +5 F6
      + +
      + +

      +A few tutorial notes on the above: + +

      + +

        +
      • The command + +

        + + + +
        + Fermata 1 3 120 + +
        + +

        +applies a slow-down in tempo to the second beat for the following + bar (an offset of 1), for 3 beats. These 3 beats will be played 20% + slower than the set tempo. + +

        +

      • +
      • The three CUT commands insert MIDI ``all notes off'' in + all the active tracks just before beats 2, 3 and 4. + +

        +

      • +
      + +

      +Finally, the proper syntax for the command: + +

      + + + +
      + [Voice] Cut [Offset] + +
      + +

      +If the voice is omitted, MIDI ``all notes off'' will be inserted into +each active track. + +

      +If the offset is omitted, the current bar position will be used. This +the same as using an offset value of 0. +


      Footnotes

      +
      +
      ... +groove.15.1
      +
      The time value is saved/restored with grooves so + setting a time is redundant in this case. + +
      +
      ... +beat.15.2
      +
      Technically speaking, +MMA determines an interval + starting 5% of a beat after the start of the fermata to a point 5% + of a beat before the end. Any MIDI Note-On events in this range (in + all tracks) are deleted. + +
      +
      ... +resume.15.3
      +
      The answer to the music theory question of whether + the ``pause'' takes time from the current beat or is treated + as a ``fermata'' is not clear--but as far as +MMA is concerned the + command has no effect on timing. + +
      +
      +
      bob -2007-03-07 +2008-09-28
      diff --git a/mma/docs/html/ref/node16.html b/mma/docs/html/ref/node16.html index 1d08b5b..f8f27ab 100644 --- a/mma/docs/html/ref/node16.html +++ b/mma/docs/html/ref/node16.html @@ -1,4 +1,4 @@ - + -Volume and Dynamics - +Swing + @@ -25,909 +25,285 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
      - Next: Repeats - Up: Next: Volume and Dynamics + Up: Reference Manual - Previous: Swing -
      + Previous: Tempo and Timing
      +
      - -Subsections - - -
      - -

      - -
      -Volume and Dynamics +Swing

      - -MMA is very versatile when it comes to the volumes or dynamics used in your song. -16.1 -

      -Each generated note goes though several adjustments: +In jazz and swing music there is a convention to apply special timing +to eighth notes. Normally, the first of a pair of eights is lengthened +and the second is shortened. In the sheet music this can is sometimes +notated as sequences of a dotted eighth followed by a sixteenth. But, +if you were to foolish enough to play the song with this timing you'd +get a funny look from a jazz musician who will tell you to ``swing'' +the notes.

      - -

        -
      1. The initial velocity is set in the pattern definition, see - patterns,16.2 -

        -

      2. -
      3. the velocity is then adjusted by the master and - track volume settings (see here - for the discussion of ADJUSTVOLUME RATIO), - -

        -

      4. -
      5. if certain notes are to be accented, yet another adjustment is made, - -

        -

      6. -
      7. and, finally, if the random volume is set, more adjustment. - -

        -

      8. -
      - -

      -For the most part -MMA uses conventional musical score notation for -volumes. Internally, the dynamic name is converted to a percentage -value. The note volume is adjusted by the percentage. - -

      -The following table shows the available volume settings and the adjustment values. +The easiest way to think about swing eighths is to mentally convert +them to a triplet consisting of a quarter note and and eighth.

      - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Symbolic NameRatio (Percentage) Adjustment
      off0
      pppp5
      ppp10
      pp25
      p40
      mp70
      m100
      mf110
      f130
      ff160
      fff180
      ffff200
      - - -
      + Lost Image

      -The setting OFF is useful for generating fades at the end of a - piece. For example: +In the above music the first and second bar are both played as +in the third. + +

      + +MMA can handle this musical style in a number of ways, the control +is though the SWINGMODE command and options. + +

      +In default mode +MMA assumes that you don't want your song to swing. + +

      +To enable automatic conversions, simply set SWINGMODE to ``on'':

      - Volume ff -
      -Decresc Off 5 -
      -G / Gm / * 5
      + SwingMode On

      -will cause the last 5 bars of your music to fade from a FF to - silence. +This directive accepts the value ``On'' and ``Off'' or ``1'' and +``0''.

      -The initial velocity of a note is set in the pattern definition (see - patterns). The following - commands set the master volume, track volume and random volume - adjustments. - -

      -In addition to the note velocities generated by -MMA your MIDI - device can also change the mix between channels. See the discussion - for MIDIVOLUME (here). - -

      - -

      -
      -Accent -

      - -

      -``Real musicians''16.3, in an almost - automatic manner, emphasize notes on certain beats. In popular Western - music written in 4/4 time this is usually beats one and - three. This emphasis sets the pulse or beat in a piece. - -

      -In -MMA you can set the velocities in a pattern so that this emphasis is - automatically adjusted. For example, when setting a walking bass line - pattern you could use a pattern definition like: - -

      - - - -
      - Define Walk W1234 1 4 100; 2 4 70; 3 4 80; 4 4 70 - -
      - -

      -However, it is much easier to use a definition which has all the - velocities the same: - -

      - - - -
      - Define Walk W1234 1 1 90 * 4 - -
      - -

      -and use the ACCENT command to increase or decrease the volume - of notes on certain beats: - -

      - - - -
      - Walk Accent 1 20 2 -10 4 -10 - -
      - -

      -The above command will increase the volume for walking bass notes on - beat 1 by 20%, and decrease the volumes of notes on beats 2 and 4 by - 10%. - -

      -You can use this command in all tracks. - -

      -When specifying the accents, you must have matching pairs of data. The - first item in the pair is the beat (which can be fractional), the - second is the volume adjustment. This is a percentage of the current - note volume that is added (or subtracted) to the volume. Adjustment - factors must be integers in the range -100 to 100. - -

      -The ACCENTs can apply to all bars in a track; as well, you can set - different accents for different bars. Just use a ``{}'' pair to delimit - each bar. For example: - -

      - - - -
      - Bass Accent {1 20} / / {1 30 3 30} - -
      - -

      -The above line will set an accent on beat 1 of bars 1, 2 and 3; in - bar 4 beats 1 and 3 will be accented. - -

      -You can use a ``/'' to repeat a setting. The ``/'' can be enclosed in - a ``{}'' delimiter if you want. - -

      - -

      -AdjustVolume -

      - -

      - -

      -Mnemonic Volume Ratios -

      - -

      -The ratios used to adjust the volume can be changed from the table at - the start of this chapter. For example, to change the percentage used - for the MF setting: - -

      - - - -
      - AdjustVolume MF=95 f=120 - -
      - -

      -Note that you can have multiple setting on the same line. - -

      -The values used have the same format as those used for the - VOLUME command, below. For now, a few examples: - -

      - - - -
      - AdjustVolume Mf=mp+200 - -
      - -

      -will set the adjustment factor for ``mf'' to that of ``mp'' plus - 200%. - -

      -And, - -

      - - - -
      - AdjustVolume mf=+20 - -
      - -

      -will increase the current ``mf'' setting by 20%. - -

      -You might want to do these adjustment in your MMArc file(s). - -

      - -

      - -
      -Master Volume Ratio -

      - -

      - -MMA uses both the master and track volumes - to determine the final velocity of a note. By default, the track volume - setting accounts for 60% of the adjustment and the master volume for - the remaining 40%. The simple-minded logic behind this is that if the - user goes to the effort of setting a volume for a track, then that is - probably more important than a volume set for the entire piece. - -

      -You can change the ratio used at anytime with the ADJUSTVOLUME RATIO=VALUE - directive. $<$Value$>$ is the percentage to use for the Track volume. A few examples: - -

      - - - -
      - AdjustVolume Ratio=60 - -
      - -

      -This duplicates the default setting. - -

      - - - -
      - AdjustVolume Ratio=40 - -
      - -

      -Volume adjustments use 40% of the track volume and 60% of the master - volume. - -

      - - - -
      - AdjustVolume Ratio=100 - -
      - -

      -Volume adjustments use only the track volume (and ignore the master - volume completely). - -

      - - - -
      - AdjustVolume Ratio=0 - -
      - -

      -Volume adjustments use only the master volume (and ignore the track - volumes completely). - -

      -Any value in the range 0 to 100 can be used as an argument for this - command. This setting is saved in GROOVEs. - -

      -Feel free to experiment with different ratios. - -

      - -

      -
      -Volume -

      - -

      -The volume for a track and the master volume, is set with the VOLUME - command. Volumes can be specified much like standard sheet music with - the conventional dynamic names. These volumes can be applied to a - track or to the entire song. For example: - -

      - - - -
      - Arpeggio-Piano Volume p - -
      - -

      -sets the volume for the Arpeggio-Piano track to something approximating - piano. - -

      - - - -
      - Volume f - -
      - -

      -sets the master volume to forte. - -

      -In most cases the volume for a specific track will be set within the GROOVE - definition; the master volume is used in the music file to adjust the - overall feel of the piece. - -

      -When using VOLUME for a specific track, you can use a different - value for each bar in a sequence: - -

      - - - -
      - Drum Volume mp ff / ppp - -
      - -

      -A ``/'' can be used to repeat values. - -

      -In addition to the ``musical symbols'' like FF and MP you can - also use numeric values to indicate a percentage. In this case you can - use intermediate values to those specified in the table above. For - example, to set the volume between MF and F, you could do - something like: - -

      - - - -
      - Volume 87 - -
      - -

      -But, we don't recommend that you use this! - -

      -A better option is to increment or decrement an existing volume by a - percentage. A numeric value prefaced by a ``+'' or ``-'' is - interpreted as a change. So: - -

      - - - -
      - Drum-Snare Volume -20 - -
      - -

      -would decrement the existing volume of the DRUM-SNARE track by - 20%. - -

      -And, finally, for fine tuning you can adjust a ``musical symbol'' - volume by a percentage. The volume ``mf-10'' will generate a volume - 10% less than the value of ``mf''; ``f+20'' will generate a volume - 20% greater than ``f''. - -

      - -

      -Cresc and Decresc -

      - -

      -If you wish to adjust over a series of bars use the CRESC or - DECRESC commands. These commands work in both the master - context and individual tracks. - -

      -For all practical purposes, the two commands are equivalent, expect - for a possible warning message. If the new volume in less than the - current volume in a CRESC a warning will be displayed; the - converse applies to a DECRESC. In addition, a warning will - be displayed if the effect of either command results in no volume change. - -

      -The command requires two or three arguments. The first argument is an - optional initial volume followed by the new (destination) volume and - the number of bars the adjustment will take. - -

      -For example: - -

      - - - -
      - Cresc fff 5 - -
      - -

      -will gradually vary the master volume from its current setting to a - ``triple forte'' over the next 5 bars. Note that the very next bar - will be played at the current volume and the fifth bar at fff - with the other three bars at increasing volumes. - -

      -Similarly: - -

      - - - -
      - Drum-Snare Decresc mp 2 - -
      - -

      -will decrease the ``drum-snare'' volume to ``mezzo piano'' over the next 2 bars. - -

      -Finally, consider: - -

      - - - -
      - Cresc pp mf 4 - -
      - -

      -which will set the current volume to PP and then increase it to - MF over the next 4 bars. Again, note that the very next bar - will be played at pp and the fourth at mf. - -

      -You can use numeric values (not recommended!) in these directives: - -

      - - - -
      - Cresc 20 100 4 - -
      - -

      -As well as increment/decrement: - -

      - - - -
      - Volume ff -
      ... -
      -Decresc -10 -40 4
      - -
      - -

      -The above example will first set the volume to 10% less than the - current FF setting. Then it will decrease the volume over the next - 4 bars to a volume 40% less than the new setting for the first bar. - -

      -A SEQCLEAR command will reset all track volumes to the default - M. - -

      -When applying CRESC or DECRESC on a specific track the - volume for all the sequences will be the same. For this reason, a - warning is displayed if the volumes for each bar in the current - sequence are not the same. - -

      -You may find that certain volume adjustments don't create the volumes - you are expecting. In most cases this will be due to the fact that - -MMA uses a master and track volume to determine the final - result. So, if you want a fade at the end of a piece you might do: - -

      - - - -
      - Decresc m pppp 4 - -
      - -

      -and find that the volume on the last bar is still too loud. There are - two simple solutions: +With SWINGMODE enabled +MMA takes some extra steps when creating +patterns and processing of SOLO and MELODY parts.

        -
      • Add a command to decrease the track volumes. For example: - -

        - - - -
        - Alltracks Decresc m pppp 4 - -
        - -

        -in addition to to the master setting. +

      • Any eighth note in a pattern ``on the beat'' (1, 2, etc.) is converted to a + ``81'' note.

      • -
      • Change the ratio between track and master settings: +
      • Any eighth note is a pattern ``off the beat'' (1.5, 2.5, etc.) + is converted to ``82'' note, and the offset is adjusted to the prior + beat plus the value of an ``81'' note.

        - - - -
        - AdjustVolume Ratio=0 - -
        +

      • +
      • Drum notes with a value of a single MIDI tick are handled in the + same way, but only the offset adjustment is needed.

        -or some other small value. +

      • +
      • In SOLO and MELODY tracks any successive pairs of + eighth notes (or rests) are adjusted.

      -These methods will produce similar, but different results. +Important: when defining patterns and sequences remember that +the adjustment is made when the pattern is compiled. With a +DEFINE command the arguments are compiled (and swing +will be applied). But a SEQUENCE command with an +already defined pattern will use the existing pattern values (the +swing adjustment may or may not have been done at define +time). Finally, if you have a dynamic define in the sequence the +adjustment will take place if needed.

      - -

      -
      -RVolume -

      +SWINGMODE has an additional option, SKEW. This factor +is used to create the ``81'' and ``82'' +note lengths (see here). By +default the value ``66'' is used. This simply means that the note +length ``81'' is assigned 66% of the value of an eight note, and +``82'' is assigned 34%.

      -Not even the best musician can play each note at the same volume. Nor -would he or she want to--the result would be quite unmusical ... -so -MMA tries to be a bit human by randomly adjusting note volume -with the RVOLUME command. +You can change this setting at any point in your song or style +files. It will take effect immediately on all future patterns and solo +lines.

      -The command can be applied to any specific track. Examples: +The setting:

      - Chord RVolume 10 -
      -Drum-Snare RVolume 5
      + SwingMode Skew=60

      -The RVOLUME argument is a percentage value by which a volume is -adjusted. A setting of 0 disables the adjustment for a track (this is -the default). +will set a 60/40 setting.

      -When set, the note velocity (after the track and master volume -adjustments) is randomized up or down by the value. Again, using the -above example, let us assume that a note in the current pattern gets a -MIDI velocity of 88. The random factor of 10 will adjust this by 10% -up or down--the new value can be from 78 to 98. +If you want to experiment, find a GROOVE with note lengths of +``81'' and ``82'' (``swing'' is as good a choice as any). Now, put a +SWINGMODE SKEW=VALUE directive at the top of your song file (before +selecting any GROOVEs). Compile and play the song with different values +to hear the effects.

      -The idea behind this is to give the track a more human sounding -effect. You can use large values, but it's not recommended. Usually, -values in the 5 to 10 range work well. You might want slightly larger -values for drum tracks. Using a value greater than 30 will generate a -warning message. +If you want to play with different effects you could do something like +this:

      -Notes: + + + +
      + SwingMode On Skew=40 +
      ...Set CHORD pattern/groove +
      +SwingMode Skew=30 +
      ...Set Drum-1 pattern/groove +
      +SwingMode Skew=whatever +
      ...Set Drum-2
      + +
      + +

      +This will give different rates for different tracks. I'll probably not +enjoy your results, but I play polkas on the accordion for fun. + +

      +The complete SWINGMODE setting is saved in the current GROOVE and can be accessed +via the $_SwingMode built-in macro. + +

      +The easy (and ugly and unintuitive) way to handle swing is to +hard-code the value right into your patterns. For example, you could +set a swing chord pattern with: + +

      + + + +
      + Chord Define Swing8 1 3+3 80; 1.33 3 80; 2 3+3 80; 2.33 3 80 ... + +
      + +

      +We really don't recommend this for the simple reason that the swing +rate is frozen as quarter/eighth triplets. + +

      +If you refer to the table of note lengths +(here) you will find the cryptic +values of ``81'' and ``82''. These notes are adjusted depending of the +SWINGSKEW value. So: + +

      + + + +
      + Chord Define Swing8 1 81 80; 1+81 82 80; 2 81 80; 2+81 82 80 ... + +
      + +

      +is a bit better. In this case we have set a chord on beat 1 as the +first of an eighth note, and a chord on the off-beat as the +second. Note how we specify the off-beats as ``1+81'', etc. + +

      +In this example the feel of the swing will vary with the +SWINGSKEW setting. + +

      +But, aren't computers supposed to make life simple? Well, here is our +recommended method: + +

      + + + +
      + SwingMode On +
      +Chord Define Swing8 1 8 80; 1.5 8 80; 2 8 80; 2.5 8 80 ...
      + +
      + +

      +Now, +MMA will convert the values for you. Magic, well ...almost. + +

      +There are times when you will need to be more explicit, especially in +SOLO and MELODY tracks:

        -
      • No generated value will be out of the valid MIDI velocity range - of 1 to 127. +
      • If a bar has both swing and straight eighths.

      • -
      • A different value can be used for each bar in a sequence: - -

        - - - -
        - Scale RVolume 10 0 / 20 - -
        - -

        -

      • -
      • A ``/'' can be used to repeat values. +
      • If the note following an eighth is not an eight.

      -

      - -

      -Saving and Restoring Volumes -

      - -

      -Dynamics can get quite complicated, especially when you are adjusting -the volumes of a track inside a repeat or other complicated sections -of music. In this section attempts to give some general -guidelines and hints. - -

      -For the most part, the supplied groove files will have balanced -volumes between the different instruments. If you find that some -instruments or drum tones are consistently too loud or soft, spend some -time with the chapter on Fine Tuning. - -

      -Remember that GROOVEs save all the current volume settings. -This includes the master setting as well as individual track settings. -So, if you are using the mythical groove ``Wonderful'' and think that -the Chord-Piano volume should be louder in a particular song -it's easy to do something like: - -

      - - - -
      - Groove Wonderful -
      -Chord-Piano Volume ff -
      -DefGroove Wonderful
      - -
      - -

      -Now, when you call this groove the new volume will be used. Note that -you'll have to do this for each variation of the groove that you use -in the song. - -

      -In most songs you will not need to do major changes. But, it is nice -to use the same volume each time though a section. In most cases -you'll want to do a explicit setting at the start of a section. For -example: - -

      - - - -
      - Repeat -
      -Volume mf -
      .... -
      -Cresc ff 5 -
      ... -
      -EndRepeat
      - -
      - -

      -Another useful technique is the use of the $_LASTVOLUME -macro. For example: - -

      - - - -
      - Volume pp -
      ... -
      -Cresc f 5 -
      ... -
      $_LastVolume // restores to pp
      - -
      - -

      -


      Footnotes

      -
      -
      ... song.16.1
      -
      We'll try to be consistent and refer to a MIDI - ``volume'' as a ``velocity'' and internal -MMA adjustments to velocity as volumes. - -
      -
      ...sec-pats,16.2
      -
      Solo and - Melody track notes use an initial velocity of 90. - -
      -
      ... musicians''16.3
      -
      as opposed to mechanical. - -
      -

      +
      bob -2007-03-07 +2008-09-28
      diff --git a/mma/docs/html/ref/node17.html b/mma/docs/html/ref/node17.html index 25e716b..e4e87c7 100644 --- a/mma/docs/html/ref/node17.html +++ b/mma/docs/html/ref/node17.html @@ -1,4 +1,4 @@ - + -Repeats - +Volume and Dynamics + @@ -25,122 +25,1017 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
      - Next: Variables, Conditionals and Jumps - Up: Next: Repeats + Up: Reference Manual - Previous: Volume and Dynamics -
      + Previous: Swing
      +
      + +Subsections -

      + + +
      + +

      + +
      +Volume and Dynamics

      -MMA attempts to be as comfortable to use as standard sheet music. -This includes repeats and endings. - +MMA is very versatile when it comes to the volumes or dynamics used in your song.17.1

      -More complex structures like D.S., Coda, etc. are -not directly supported. But, they are easily simulated with by -using some simple variables, conditionals and GOTOs. See -Variables for details. -Often as not, it may be easier to use your editor to cut, paste and -duplicate. Another, alternate, method of handling complicated repeats -is to set sections of code in MSET (more - here) variables and simply expand those. - -

      -A section of music to be repeated is indicated with a REPEAT -and REPEATEND or ENDREPEAT17.1 In addition, you can have REPEATENDINGS. +Each generated note goes though several adjustments:

      - - -
      - Repeats -
      +
        +
      1. The initial velocity is set in the pattern definition, see + patterns,17.2 +

        +

      2. +
      3. the velocity is then adjusted by the master and + track volume settings (see here + for the discussion of ADJUSTVOLUME RATIO),

        - Lost Image -
        -
        -
        -
        -

        +

      4. +
      5. if certain notes are to be accented, yet another adjustment is made, - - -
        - Repeat -
        -1 Am -
        -2 C -
        -RepeatEnding 2 -
        -3 D7 -
        -RepeatEnding -
        -4 D7 / Dm -
        -RepeatEnd -
        -5 G7 -
        -6 A
        - -
        +

        +

      6. +
      7. and, finally, if the random volume is set, more adjustment. + +

        +

      8. +
      + +

      +For the most part +MMA uses conventional musical score notation for +volumes. Internally, the dynamic name is converted to a percentage +value. The note volume is adjusted by the percentage. + +

      +The following table shows the available volume settings and the adjustment values. + +

      +

      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Symbolic NameRatio (Percentage) Adjustment
      off0
      pppp5
      ppp10
      pp25
      p40
      mp70
      m100
      mf110
      f130
      ff160
      fff180
      ffff200
      -
      -

      +

      -In this example -MMA produces -music with bars: +The setting OFF is useful for generating fades at the end of a + piece. For example:

      -

      -1, 2, 3, + + + +
      + Volume ff
      -1, 2, 3, +Decresc Off 5
      -1, 2, 4, -
      -1, 2, 5, 6 - - +G / Gm / * 5
      + +

      -This works just like standard sheet music. Note that both -REPEATENDING and REPEATEND can take an optional argument -indicating the number of times to use the ending or to repeat the -block. The effect of an optional count for REPEATENDING is -illustrated in the example, above. The following simple example: +will cause the last 5 bars of your music to fade from a ff to + silence. + +

      +The initial velocity of a note is set in the pattern definition (see + patterns). The following + commands set the master volume, track volume and random volume + adjustments. + +

      +In addition to the note velocities generated by +MMA your MIDI + device can also change the mix between channels. See the discussion + for MIDIVOLUME (here). + +

      + +

      +
      +Accent +

      + +

      +``Real musicians''17.3, in an almost + automatic manner, emphasize notes on certain beats. In popular Western + music written in 4/4 time this is usually beats one and + three. This emphasis sets the pulse or beat in a piece. + +

      +In +MMA you can set the velocities in a pattern so that this emphasis is + automatically adjusted. For example, when setting a walking bass line + pattern you could use a pattern definition like: + +

      + + + +
      + Define Walk W1234 1 4 100; 2 4 70; 3 4 80; 4 4 70 + +
      + +

      +However, it is much easier to use a definition which has all the + velocities the same: + +

      + + + +
      + Define Walk W1234 1 1 90 * 4 + +
      + +

      +and use the ACCENT command to increase or decrease the volume + of notes on certain beats: + +

      + + + +
      + Walk Accent 1 20 2 -10 4 -10 + +
      + +

      +The above command will increase the volume for walking bass notes on + beat 1 by 20%, and decrease the volumes of notes on beats 2 and 4 by + 10%. + +

      +You can use this command in all tracks. + +

      +When specifying the accents, you must have matching pairs of data. The + first item in the pair is the beat (which can be fractional), the + second is the volume adjustment. This is a percentage of the current + note volume that is added (or subtracted) to the volume. Adjustment + factors must be integers in the range -100 to 100. + +

      +The ACCENTs can apply to all bars in a track; as well, you can set + different accents for different bars. Just use a ``{}'' pair to delimit + each bar. For example: + +

      + + + +
      + Bass Accent {1 20} / / {1 30 3 30} + +
      + +

      +The above line will set an accent on beat 1 of bars 1, 2 and 3; in + bar 4 beats 1 and 3 will be accented. + +

      +You can use a ``/'' to repeat a setting. The ``/'' can be enclosed in + a ``{}'' delimiter if you want. + +

      + +

      +AdjustVolume +

      + +

      + +

      +Mnemonic Volume Ratios +

      + +

      +The ratios used to adjust the volume can be changed from the table at + the start of this chapter. For example, to change the percentage used + for the MF setting: + +

      + + + +
      + AdjustVolume MF=95 f=120 + +
      + +

      +Note that you can have multiple setting on the same line. + +

      +The values used have the same format as those used for the + VOLUME command, below. For now, a few examples: + +

      + + + +
      + AdjustVolume Mf=mp+200 + +
      + +

      +will set the adjustment factor for mf to that of mp plus + 200%. + +

      +And, + +

      + + + +
      + AdjustVolume mf=+20 + +
      + +

      +will increase the current mf setting by 20%. + +

      +You might want to do these adjustment in your MMArc file(s). + +

      + +

      + +
      +Master Volume Ratio +

      + +

      + +MMA uses both the master and track volumes + to determine the final velocity of a note. By default, the track volume + setting accounts for 60% of the adjustment and the master volume for + the remaining 40%. The simple-minded logic behind this is that if the + user goes to the effort of setting a volume for a track, then that is + probably more important than a volume set for the entire piece. + +

      +You can change the ratio used at anytime with the ADJUSTVOLUME RATIO=VALUE + directive. $<$Value$>$ is the percentage to use for the Track volume. A few examples: + +

      + + + +
      + AdjustVolume Ratio=60 + +
      + +

      +This duplicates the default setting. + +

      + + + +
      + AdjustVolume Ratio=40 + +
      + +

      +Volume adjustments use 40% of the track volume and 60% of the master + volume. + +

      + + + +
      + AdjustVolume Ratio=100 + +
      + +

      +Volume adjustments use only the track volume (and ignore the master + volume completely). + +

      + + + +
      + AdjustVolume Ratio=0 + +
      + +

      +Volume adjustments use only the master volume (and ignore the track + volumes completely). + +

      +Any value in the range 0 to 100 can be used as an argument for this + command. This setting is saved in GROOVEs. + +

      +Feel free to experiment with different ratios. + +

      + +

      +
      +Volume +

      + +

      +The volume for a track and the master volume, is set with the VOLUME + command. Volumes can be specified much like standard sheet music with + the conventional dynamic names. These volumes can be applied to a + track or to the entire song. For example: + +

      + + + +
      + Arpeggio-Piano Volume p + +
      + +

      +sets the volume for the Arpeggio-Piano track to something approximating + piano. + +

      + + + +
      + Volume f + +
      + +

      +sets the master volume to forte. + +

      +In most cases the volume for a specific track will be set within the GROOVE + definition; the master volume is used in the music file to adjust the + overall feel of the piece. + +

      +When using VOLUME for a specific track, you can use a different + value for each bar in a sequence: + +

      + + + +
      + Drum Volume mp ff / ppp + +
      + +

      +A ``/'' can be used to repeat values. + +

      +In addition to the ``musical symbols'' like ff and mp you can + also use numeric values to indicate a percentage. In this case you can + use intermediate values to those specified in the table above. For + example, to set the volume between mf and f, you could do + something like: + +

      + + + +
      + Volume 87 + +
      + +

      +But, we don't recommend that you use this! + +

      +A better option is to increment or decrement an existing volume by a + percentage. A numeric value prefaced by a ``+'' or ``-'' is + interpreted as a change. So: + +

      + + + +
      + Drum-Snare Volume -20 + +
      + +

      +would decrement the existing volume of the DRUM-SNARE track by + 20%. + +

      +And, finally, for fine tuning you can adjust a ``musical symbol'' + volume by a percentage. The volume ``mf-10'' will generate a volume + 10% less than the value of ``mf''; ``f+20'' will generate a volume + 20% greater than ``f''. + +

      + +

      +Cresc and Decresc +

      + +

      +If you wish to adjust the volume over one or more bars use the CRESC or + DECRESC17.4 commands. These commands work in both the master + context and individual tracks. + +

      +For all practical purposes, the two commands are equivalent, except + for a possible warning message. If the new volume in less than the + current volume in a CRESC a warning will be displayed; the + converse applies to a DECRESC. In addition, a warning will + be displayed if the effect of either command results in no volume change. + +

      +The command requires two or three arguments. The first argument is an + optional initial volume followed by the new (destination) volume and + the number of bars the adjustment will take. + +

      +For example: + +

      + + + +
      + Cresc fff 5 + +
      + +

      +will gradually vary the master volume from its current setting to a + ``triple forte'' over the next 5 bars. Note that the very next bar + will be played at the current volume and the fifth bar at fff + with the other three bars at increasing volumes. + +

      +Similarly: + +

      + + + +
      + Drum-Snare Decresc mp 2 + +
      + +

      +will decrease the ``drum-snare'' volume to ``mezzo piano'' over the next 2 bars. + +

      +Finally, consider: + +

      + + + +
      + Cresc pp mf 4 + +
      + +

      +which will set the current volume to pp and then increase it to + mf over the next 4 bars. Again, note that the very next bar + will be played at pp and the fourth at mf. + +

      +You can use numeric values (not recommended!) in these directives: + +

      + + + +
      + Cresc 20 100 4 + +
      + +

      +As well as increment/decrement: + +

      + + + +
      + Volume ff +
      ... +
      +Decresc -10 -40 4
      + +
      + +

      +The above example will first set the volume to 10% less than the + current ff setting. Then it will decrease the volume over the next + 4 bars to a volume 40% less than the new setting for the first bar. + +

      +A SEQCLEAR command will reset all track volumes to the default + M. + +

      +When applying CRESC or DECRESC at the track level the + volumes for each bar in the sequence will end up being the same. For example, + assuming a two bar sequence length, you might have: + +

      + + + +
      + Chord Volume MP F + +
      + +

      +which alternates the volume between successive bars in the + CHORD track. Now, if you were to: + +

      + + + +
      + Chord Cresc M FF 4 + +
      + +

      +The following actions take effect: + +

        +
      1. A warning message will be displayed, +
      2. +
      3. The volume for the chord track will be set to m, +
      4. +
      5. The volume for the chord track will increment to ff over + the next four bars, +
      6. +
      7. The volume for the sequence will end up being ff for all + the bars in the remaining sequence. You may need to reissue the + initial chord volume command. + +
      8. +
      + +

      +You may find that certain volume adjustments don't create the volumes + you are expecting. In most cases this will be due to the fact that + +MMA uses a master and track volume to determine the final + result. So, if you want a fade at the end of a piece you might do: + +

      + + + +
      + Decresc m pppp 4 + +
      + +

      +and find that the volume on the last bar is still too loud. There are + two simple solutions: + +

      + +

        +
      • Add a command to decrease the track volumes. For example: + +

        + + + +
        + Alltracks Decresc m pppp 4 + +
        + +

        +in addition to to the master setting. + +

        +

      • +
      • Change the ratio between track and master settings: + +

        + + + +
        + AdjustVolume Ratio=0 + +
        + +

        +or some other small value. + +

        +

      • +
      + +

      +These methods will produce similar, but different results. + +

      +The adjustments made for CRESC and DECRESC are applied +over each bar effected. This means that the first note or notes in a +bar will be louder (or softer) than the last. You can use this effect +for interesting changes by using a single bar for the range. Assuming +a current volume of mp: + +

      + + + +
      + Cresc fff 1 + +
      + +

      +will set the final notes in the following bar to be fff, etc. + +

      +If you have a number of bars with the same chord and the track you are +modifying has UNIFY enabled the volume will not +change. UNIFY creates long notes sustained over a number of +bars for which the volume is only set once. + +

      +Sometimes a CRESC17.5 command will span a groove +change. +MMA handles this in two different ways: + +

      + +

        +
      • Master CRESC commands can continue over a new + GROOVE. For example: + +

        + + + +
        + Groove One +
        +Cresc mp ff 8 +
        +C * 4 +
        +Groove Two +
        +Dm * 4
        + +
        + +

        +will work just fine. This makes sense since library files and groove + definitions normally do not have master volume settings. + +

        +

      • +
      • However, volume changes at a track level cannot span + GROOVE changes. Using a similar example: + +

        + + + +
        + Groove One +
        +Chord Cresc mp ff 8 +
        +C * 4 +
        +Groove Two +
        +Dm * 4
        + +
        + +

        +In this case +MMA will truncate the CRESC after 4 bars and + issue a warning message. The CHORD volume will never reach + ff. Since groove definitions and library files normally + do set individual volumes for each track it would be counter + intuitive to permit a previous CRESC to continue its effect. + +

        +

      • +
      + +

      + +

      +Swell +

      + +

      +Often you want a crescendo to be followed by a decrescendo (or, less +commonly, a decrescendo followed by a crescendo). Technically, this is +a messa di voce.17.6 You'll see the notation in sheet music with opposed +``hairpins''. + +

      +A SWELL is set with a command like: + +

      + + + +
      + Swell pp ff 4 + +
      + +

      +or + +

      + + + +
      + Chord Swell ff 4 + +
      + +

      +In the first case the master volume will be increased over 2 bars from +pp to ff and then back to pp. In the second +case the CHORD volume will be increased to ff over 2 +bars, then back to the original volume. + +

      +You can achieve the same results with a pair of CRESC and +DECRESC commands (and you might be safer to do just this since +SWELL doesn't issue as many warnings). + +

      +Note that, just like in CRESC, you can skip the first argument +(the initial volume setting). Also, note that the final argument is +the total number of bars to effect (and it must be 2 or more). + +

      + +

      + +
      +RVolume +

      + +

      +Not even the best musician can play each note at the same volume. Nor +would he or she want to--the result would be quite unmusical ... +so +MMA tries to be a bit human by randomly adjusting note volume +with the RVOLUME command. + +

      +The command can be applied to any specific track. Examples: + +

      + + + +
      + Chord RVolume 10 +
      +Drum-Snare RVolume 5
      + +
      + +

      +The RVOLUME argument is a percentage value by which a volume is +adjusted. A setting of 0 disables the adjustment for a track (this is +the default). + +

      +When set, the note velocity (after the track and master volume +adjustments) is randomized up or down by the value. Again, using the +above example, let us assume that a note in the current pattern gets a +MIDI velocity of 88. The random factor of 10 will adjust this by 10% +up or down--the new value can be from 78 to 98. + +

      +The idea behind this is to give the track a more human sounding +effect. You can use large values, but it's not recommended. Usually, +values in the 5 to 10 range work well. You might want slightly larger +values for drum tracks. Using a value greater than 30 will generate a +warning message. + +

      +Notes: + +

      + +

        +
      • No generated value will be out of the valid MIDI velocity range + of 1 to 127. + +

        +

      • +
      • A different value can be used for each bar in a sequence: + +

        + + + +
        + Scale RVolume 10 0 / 20 + +
        + +

        +

      • +
      • A ``/'' can be used to repeat values. + +

        +

      • +
      + +

      + +

      +Saving and Restoring Volumes +

      + +

      +Dynamics can get quite complicated, especially when you are adjusting +the volumes of a track inside a repeat or other complicated sections +of music. In this section attempts to give some general +guidelines and hints. + +

      +For the most part, the supplied groove files will have balanced +volumes between the different instruments. If you find that some +instruments or drum tones are consistently too loud or soft, spend some +time with the chapter on Fine Tuning. + +

      +Remember that GROOVEs save all the current volume settings. +This includes the master setting as well as individual track settings. +So, if you are using the mythical groove ``Wonderful'' and think that +the Chord-Piano volume should be louder in a particular song +it's easy to do something like: + +

      + + + +
      + Groove Wonderful +
      +Chord-Piano Volume ff +
      +DefGroove Wonderful
      + +
      + +

      +Now, when you call this groove the new volume will be used. Note that +you'll have to do this for each variation of the groove that you use +in the song. + +

      +In most songs you will not need to do major changes. But, it is nice +to use the same volume each time though a section. In most cases +you'll want to do a explicit setting at the start of a section. For +example:

      @@ -148,137 +1043,99 @@ illustrated in the example, above. The following simple example:

      Repeat
      -1  Am +Volume mf +
      ...
      -2  Cm +Cresc ff 5 +
      ...
      -RepeatEnd 3
      +EndRepeat

      -Will expand to: -

      -1, 2, -
      -1, 2, -
      -1, 2 - -
      - -

      -Note that the optional argument ``3'' produces a total of three -copies. The default argument for REPEAT is ``2''. Using ``1'' -cancels the REPEAT and ``0'' deletes the entire section. Using -``1'' and ``0'' are useful in setting up Coda sections where you want -a different count the second time the section is played. Note that the -count argument can be a macro. Have a look at the sample file -repeats.mma for lots of examples. - -

      -Combining optional counts with both REPEATENDING and -REPEATEND is permitted. Another example: +Another useful technique is the use of the $_LASTVOLUME +macro. For example:

      - Repeat + Volume pp +
      ...
      -1 Am -
      -2 C -
      -RepeatEnding 2 -
      -3 D7 -
      -RepeatEnd 2
      +Cresc f 5 +
      ... +
      $_LastVolume // restores to pp

      -Produces: -

      -1, 2, 3, -
      -1, 2, 3, -
      -1, 2, -
      -1, 2 - -
      - -

      - -MMA processes repeats by reading the input file and creating -duplicates of the repeated material. This means that a directive in -the repeated material would be processed multiple times. Unless you -know what you are doing, directives should not be inserted in repeat -sections. Be especially careful if you define a pattern inside a -repeat. Using TEMPO with a ``+'' or ``-'' will be problematic -as well. - -

      -Repeats can be nested to any level. - -

      -Some count values for REPEATEND or ENDREPEAT and -REPEATENDING will generate a warning message. Using the -optional text NoWarn as the first argument will supress the -message: - -

      - - - -
      - Repeat -
      ... -
      -RepeatEnd Nowarn 1
      - -
      - -

      -There must be one REPEATEND or ENDREPEAT for every -REPEAT. Any number of REPEATENDINGs can be included -before the REPEATEND.


      Footnotes

      -
      ...ENDREPEAT17.1
      -
      The reason for both - ENDREPEAT and REPEATEND is to match IFEND and - ENDIF. +
      ...17.1
      +
      We'll try to be consistent and refer to a MIDI + ``volume'' as a ``velocity'' and internal +MMA adjustments to velocity as volumes.
      -

      +
      ...sec-pats,17.2
      +
      Solo and + Melody track notes use an initial velocity of 90. + +
      +
      ... musicians''17.3
      +
      as opposed to mechanical. + +
      +
      ...DECRESC17.4
      +
      We use the term ``decrescendo'', others + prefer ``diminuendo''. + +
      +
      ...CRESC17.5
      +
      This applies to DECRESC and + SWELL as well. + +
      +
      ... voce.17.6
      +
      Some references indicate that messa di + voce applies to a single tone, and +MMA is not capable of doing + this. + +
      +
    +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node18.html b/mma/docs/html/ref/node18.html index b14934b..bf13f2a 100644 --- a/mma/docs/html/ref/node18.html +++ b/mma/docs/html/ref/node18.html @@ -1,4 +1,4 @@ - + -Variables, Conditionals and Jumps - +Repeats + @@ -25,1435 +25,262 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next: Low Level MIDI Commands - Up: Next: Variables, Conditionals and Jumps + Up: Reference Manual - Previous: Repeats -
    + Previous: Volume and Dynamics
    +
    - -Subsections - - -
    - -

    - -
    -Variables, Conditionals and Jumps -

    - -

    -To make the processing of your music easier, -MMA supports a very -primitive set for variable manipulations along with some conditional -testing and the oft-frowned-upon GOTO command. - -

    - -

    -Variables +Repeats

    -MMA lets you set a variable, much like in other programming -languages and to do some basic manipulations on them. Variables are -most likely to be used for two reasons: +MMA attempts to be as comfortable to use as standard sheet music. +This includes repeats and endings. + +

    +More complex structures like D.S., Coda, etc. are +not directly supported. But, they are easily simulated with by +using some simple variables, conditionals and GOTOs. See +Variables for details. +Often as not, it may be easier to use your editor to cut, paste and +duplicate. Another, alternate, method of handling complicated repeats +is to set sections of code in MSET (more + here) variables and simply expand those. + +

    +A section of music to be repeated is indicated with a REPEAT +and REPEATEND or ENDREPEAT18.1 In addition, you can have REPEATENDINGS.

    -

      -
    • For use in setting up conditional segments of your file, + + + +
      + Repeats +

      - -

    • As a shortcut to entering complex chord sequences. + Lost Image +
      +
      +
      +
      +

      + + + +
      + Repeat +
      +1 Am +
      +2 C +
      +RepeatEnding 2 +
      +3 D7 +
      +RepeatEnding +
      +4 D7 / Dm +
      +RepeatEnd +
      +5 G7 +
      +6 A
      + +
      + + +

    • -

    • -

    -To begin, the following list shows the available commands to set and manipulate variables: +In this example +MMA produces +music with bars: + +

    +

    +1, 2, 3, +
    +1, 2, 3, +
    +1, 2, 4, +
    +1, 2, 5, 6 + +
    + +

    +This works just like standard sheet music. Note that both +REPEATENDING and REPEATEND can take an optional argument +indicating the number of times to use the ending or to repeat the +block. The effect of an optional count for REPEATENDING is +illustrated in the example, above. The following simple example:

    - Set VariableName String + Repeat
    -Mset VariableName ... MsetEnd +1  Am
    -UnSet VariableName +2  Cm
    -ShowVars -
    -Inc Variablename [value] -
    -Dec Variablename [value] -
    -Vexpand ON/Off
    +RepeatEnd 3

    -All variable names are case-insensitive. Any characters can be used in -a variable name. The only exceptions are that a variable name cannot -start with a ``$'' or a ``_'' (an underscore--this is reserved for -internal variables, see below). +Will expand to: +

    +1, 2, +
    +1, 2, +
    +1, 2 + +

    -Variables are set and manipulated by using their names. Variables are -expanded when their name is prefaced by a space followed by single -``$'' sign. For example: +Note that the optional argument ``3'' produces a total of three +copies. The default argument for REPEAT is ``2''. Using ``1'' +cancels the REPEAT and ``0'' deletes the entire section. Using +``1'' and ``0'' are useful in setting up Coda sections where you want +a different count the second time the section is played. Note that the +count argument can be a macro. Have a look at the sample file +repeats.mma for lots of examples. + +

    +Combining optional counts with both REPEATENDING and +REPEATEND is permitted. Another example:

    - Set Silly Am / Bm / + Repeat
    -1 $Silly
    +1 Am +
    +2 C +
    +RepeatEnding 2 +
    +3 D7 +
    +RepeatEnd 2

    -The first line creates the variable ``Silly''; the second creates a -bar of music with the chords ``Am / Bm /''. +Produces: +

    +1, 2, 3, +
    +1, 2, 3, +
    +1, 2, +
    +1, 2 + +

    -Note that the ``$'' must be the first item on a line or follow a -space character. For example, the following will NOT work: + +MMA processes repeats by reading the input file and creating +duplicates of the repeated material. This means that a directive in +the repeated material would be processed multiple times. Unless you +know what you are doing, directives should not be inserted in repeat +sections. Be especially careful if you define a pattern inside a +repeat. Using TEMPO with a ``+'' or ``-'' will be problematic +as well. + +

    +Repeats can be nested to any level. + +

    +Some count values for REPEATEND or ENDREPEAT and +REPEATENDING will generate a warning message. Using the +optional text NoWarn as the first argument will suppress the +message:

    - Set Silly 4a;b;c;d; + Repeat +
    ...
    -1 Am {$Silly}
    +RepeatEnd Nowarn 1

    -However: - -

    - - - -
    - 1 Am { $Silly} - -
    - -

    -will work fine. - -

    -Following are details on all the available variable commands: - -

    - -

    -Set -

    - -

    -Set or create a variable. You can skip the String if you do -want to assign an empty string to the variable. A valid example is: - -

    - - - -
    - Set PassCount 1 - -
    - -

    -You can concatenate variables or constants by using a single ``+''. -For example: - -

    - - - -
    - Groove Rhumba -
    -Repeat -
    ... -
    -Set a $_Groove + Sus -
    -Groove $a -
    ... -
    -Groove Rhumba1 -
    -Repeatend
    - -
    - -

    -This can be useful in calling GROOVE variations. - -

    - -

    -NewSet -

    - -

    -The NEWSET command works the same as SET with the -exception that that it is completely ignored if the variable already -exists. So, - -

    - - - -
    - NewSet ChordVoice JazzGuitar - -
    - -

    -and - -

    - - - -
    - If NDef ChordVoice -
    -Set ChordVoice JazzGuitar -
    -Endif
    - -
    - -

    -have identical results. - -

    - -

    -
    -Mset -

    - -

    -This command is quite similar to SET, but MSET expects -multiple lines. An example: - -

    - - - -
    - MSet LongVar -
    -1 Cm -
    -2 Gm -
    -3 G7 -
    -MsetEnd
    - -
    - -

    -It is quite possible to set a variable to hold an entire section of -music (perhaps a chorus) and insert this via macro expansion at -various places in your file. - -

    -Each MSET must be terminated by a ENDMSET or -MSETEND command (on its own separate line). - -

    -Be careful if you use an MSET variable in a PRINT -statement ...you'll probably get an error. The PRINT -command will print the first line of the variable and the -remainder will be reinserted into the input stream for interpretation. - -

    -Special code in -MMA will maintain the block settings from -BEGIN/END. So, you can do something like: - -

    - - - -
    - Mset Spam -
      Line one -
      Line 2 -
      333 -
    -EndMset -
    -Begin Print -
      $Spam -
    -End
    - -
    - -

    - -

    -RndSet -

    - -

    -There are times when you may want a random value to use in selecting a GROOVE or -for other more creative purposes. The RNDSET command sets a variable from -a value in a list. The list can be anything; just remember that each whitespace -forms the start of a new item. So, - -

    - - - -
    - RndSet Var 1 2 3 4 5 - -
    - -

    -will set $VAR to one of the values 1, 2, 3, 4 or 5. - -

    -You could use this to randomly select a GROOVE: - -

    - - - -
    - Groove $var Groove1 Groove2 Groove3 - -
    - -

    -Alternately, - -

    - - - -
    - RndSet Grv Groove1 Groove2 Groove3 - -
    - -

    -will set $GRV to one of ``Groove1'', ``Groove2'' or ``Groove3''. - -

    -Then you can do the same as in the earlier example with: - -

    - - - -
    - Groove $Grv - -
    - -

    -You can also have fun using random values for timing, transposition, etc. - -

    - -

    -UnSet VariableName -

    - -

    -Removes the variable. This can be useful if you have conditional tests -which simply rely on a certain variable being ``defined''. - -

    - -

    -ShowVars -

    - -

    -Mainly used for debugging, this command displays the names of the -defined variables and their contents. The display will preface each -variable name with a ``$''. Note that internal -MMA variables are not -displayed with this command. - -

    -You can call SHOWVARS with an argument list. In this case the -values of the variables names in the list will be printed. Variables -which do not exist will not cause an error. Eg: - -

    - - - -
    - ShowVars xXx Count foo -
       $XXX - not defined -
       $COUNT: 11 -
       $FOO: This is Foo
    - -
    - -

    - -

    -Inc and Dec -

    - -

    -These commands increment or decrement a variable. If no argument is -given, a value of 1 is used; otherwise, the value specified is used. -The value can be an integer or a floating point number. - -

    -A short example: - -

    - - - -
    - Set PassCount 1 -
    -Set Foobar 4 -
    -Showvars -
    -Inc FooBar 4 -
    -Inc PassCount -
    -ShowVars
    - -
    - -

    -This command is quite useful for creating conditional tests for proper -handling of codas or groove changes in repeats. - -

    - -

    -VExpand On or Off -

    - -

    -Normally variable expansion is enabled. These two options will turn -expansion on or off. Why would you want to do this? Well, here's a -simple example: - -

    - - - -
    - Set LeftC Am Em -
    -Set RightC G / -
    -VExpand Off -
    -Set Full $LeftC $RightC -
    -VExpand On
    - -
    - -

    -In this case the actual contents of the variable ``Full'' is ``$LeftC -$RightC''. If the OFF/ON option lines had not been used, the -contents would be ``Am Em G /''. You can easily verify this with the -SHOWVARS option. - -

    -When -MMA processes a file it expands variables in a recursive -manner. This means that, in the above example, the line: - -

    - - - -
    - 1 $Full - -
    - -

    -will be changed to: - -

    - - - -
    - 1 Am Em G / - -
    - -

    -However, if later in the file, you change the definition of one of the -variables ...for example: - -

    - - - -
    - Set LeftC Am / - -
    - -

    -the same line will now be ``1 Am / G /''. - -

    -Most of -MMA 's internal commands can be redefined with -variables. However, you really shouldn't use this feature. -It's been left for two reasons: it might be useful, and, it's hard to -disable. - -

    -However, not all commands can be redefined. The following is short -list of things which will work (but, again, not all suggestions should -be used!): - -

    - - - -
    - Set Rate Tempo 120 -
    $Rate -
    -Set R Repeat -
    $R
    - -
    - -

    -But, the following will not work: - -

    - - - -
    - Set B Begin -
    -Set E End -
    $B Arpeggio Define -
    .... -
    $E
    - -
    - -

    -This fails since the Begin/End constructs are expanded before variable -expansion. However: - -

    - - - -
    - Set A Define Arpeggio -
    -Begin $a ... End
    - -
    - -

    -is quite alright. - -

    -Even though you can use a variable to substitute for the REPEAT -or IF directives, using one for REPEATEND, ENDREPEAT, -REPEATENDING, LABEL, IFEND or ENDIF will fail. - -

    -Variable expansion should usually not be a concern. In most normal -files, -MMA will expand variables as they are encountered. However, -when reading the data in a REPEAT, IF or MSET -section the expansion function is skipped--but, when the lines are -processed, after being stored in an internal queue, variables are -expanded. - -

    - -

    -StackValue -

    - -

    -Sometimes you just want to save a value for a few lines of code. The -STACKVALUE command will save its arguments. You can later -retrive them via the $_StackValue macro. For example (taken from the -stdpats.mma file): - -

    - - - -
    - StackValue $_SwingMode -
    -SwingMode On -
    -Begin Drum Define -
      Swing8 1 0 90 * 8 -
    -End -
      ... -
    -SwingMode $_StackValue
    - -
    - -

    -Note that the $_StackValue macro removes the last value from the -stack. If you invoke the macro when there is nothing saved an error -will occur. - -

    - -

    -Predefined Variables -

    - -

    -For your convenience -MMA tracks a number of internal settings and -you can access these values with special macros.18.1 All of these ``system'' variables are -prefaced with a single underscore. For example, the current tempo is -displayed with the variable $_TEMPO. - -

    -There are two categories of system variables. The first are the simple -values for global settings: - -

    -

    -
      $_AutoLibPath
    -
    Current AUTOLIBPATH setting. - -

    -

    -
      $_BarNum
    -
    Current bar number of song. - -

    -

    -
      $_Debug
    -
    Current debug settings. - -

    -

    -
      $_Groove
    -
    Name of the currently selected groove. May be - empty if no groove has been selected. - -

    -

    -
      $_KeySig
    -
    Key signature as defined in song file. If no - keysignature is set the somewhat cryptic 0# will be returned. - -

    -

    -
      $_LineNum
    -
    Line number in current file. - -

    -

    -
      $_IncPath
    -
    Current INCPATH setting. - -

    -

    -
      $_LastDebug
    -
    Debug settings prior to last DEBUG - command. This setting can be used to restore settings, IE: - -

    - - - -
    - Debug Warnings=off -
    ... stuff generating annoying warnings -
    -Debug $_LastDebug
    - -
    - -

    -

    -
      $_LastGroove
    -
    Name of the groove selected before the - currently selected groove. - -

    -

    -
      $_LastVolume
    -
    Previously set global volume setting. - -

    -

    -
      $_LibPath
    -
    Current LIBPATH setting. - -

    -

    -
      $_Lyric
    -
    Current LYRIC settings. - -

    -

    -
      $_MIDISplit
    -
    List of SPLITCHANNELS. - -

    -

    -
      $_OutPath
    -
    Current OUTPATH setting. - -

    -

    -
      $_SeqRnd
    -
    Global SEQRND setting (on, off or track list). - -

    -

    -
      $_SeqRndWeight
    -
    Global SEQRNDWEIGHT settings. - -

    -

    -
      $_SeqSize
    -
    Current SEQSIZE setting. - -

    -

    -
      $_SwingMode
    -
    Current SWINGMODE setting (On or Off) - and the Skew value. - -

    -

    -
      $_StackValue
    -
    The last value stored on the STACKVALUE - stack. - -

    -

    -
      $_Tempo
    -
    Current TEMPO. Note that if you have used - the optional bar count in setting the tempo this will be the - target tempo. - -

    -

    -
      $_Time
    -
    The current TIME (beats per bar) setting. - -

    -

    -
      $_ToneTr
    -
    List of all TONETR settings. - -

    -

    -
      $_Transpose
    -
    Current TRANSPOSE setting. - -

    -

    -
      $_VExpand
    -
    VExpand value (On/Off). Not very useful since you - can't enable VEXPAND back with a macro. - -

    -

    -
      $_VoiceTr
    -
    List of all VOICETR settings. - -

    -

    -
      $_Volume
    -
    Current global volume setting. - -

    -

    -
      $_VolumeRatio
    -
    Global volume ratio (track vrs. master) from - ADJUSTVOLUME Ratio setting. - -

    -

    -
    - -

    -The second type of system variable is for settings in a certain track. -Each of these variables is in the form $_TRACKNAME_VALUE. For -example, the current voice setting for the ``Bass-Sus'' track can be -accessed with the variable $_Bass-Sus_Voice. - -

    -If the associated command permits a value for each sequence in your -pattern, the macro will more than one value. For example (assuming a -SEQSIZE of 4): - -

    - - - -
    - Bass Octave 3 4 2 4 -
    -Print $_Bass_Octave -
    ... -
    -3 4 2 4
    - -
    - -

    -The following are the available ``TrackName'' macros: - -

    -

    -
      $_TRACKNAME_Accent
    -
    -
    -
      $_TRACKNAME_Articulate
    -
    -
    -
      $_TRACKNAME_Channel
    -
    Assigned MIDI channel 1-16, 0 if not assigned. -
    -
      $_TRACKNAME_Compress
    -
    -
    -
      $_TRACKNAME_Direction
    -
    -
    -
      $_TRACKNAME_DupRoot
    -
    (only permitted in Chord Tracks) -
    -
      $_TRACKNAME_Harmony
    -
    -
    -
      $_TRACKNAME_HarmonyVolume
    -
    -
    -
      $_TRACKNAME_Invert
    -
    -
    -
      $_TRACKNAME_Limit
    -
    -
    -
      $_TRACKNAME_Mallet
    -
    Rate and delay values (only valid in - Solo and Melody tracks) -
    -
      $_TRACKNAME_NoteSpan
    -
    -
    -
      $_TRACKNAME_Octave
    -
    -
    -
      $_TRACKNAME_Range
    -
    -
    -
      $_TRACKNAME_Rskip
    -
    -
    -
      $_TRACKNAME_Rtime
    -
    -
    -
      $_TRACKNAME_Rvolume
    -
    -
    -
      $_TRACKNAME_SeqRnd
    -
    -
    -
      $_TRACKNAME_SeqRndWeight
    -
    -
    -
      $_TRACKNAME_Strum
    -
    (only permitted in Chord tracks) -
    -
      $_TRACKNAME_Tone
    -
    (only permitted in Drum tracks) -
    -
      $_TRACKNAME_Unify
    -
    -
    -
      $_TRACKNAME_Voice
    -
    -
    -
      $_TRACKNAME_Voicing
    -
    (only permitted in Chord tracks) -
    -
      $_TRACKNAME_Volume
    -

    -

    -
    - -

    -The ``TrackName'' macros are useful in copying values between -non-similar tracks and CHSHARE tracks. For example: - -

    - - - -
    - Begin Bass -
      Voice AcousticBass -
      Octave 3 -
      ... -
    -End -
    -Begin Walk -
      ChShare Bass -
      Voice $_Bass_Voice -
      Octave $_Bass_Octave -
      ... -
    -End
    - -
    - -

    - -

    -Conditionals -

    - -

    -The most important reason to have variables in -MMA is to use them -available in conditionals. In -MMA a conditional consists of a line -starting with an IF directive, a test, a series of lines to -process (depending upon the result of the test), and a closing -ENDIF or IFEND18.2 directive. An optional ELSE statement may be included. - -

    -The first set of tests are unary (they take no arguments): - -

    -

    -
    Def VariableName
    -
    Returns true if the variable has been defined. - -

    -

    -
    Ndef VariableName
    -
    Returns true if the variable has not been - defined. - -

    -

    -
    - -

    -In the above tests you must supply the name of a variable--don't make -the mistake of including a ``$'' which will invoke expansion and -result in something you were not expecting. - -

    -A simple example: - -

    - - - -
    - If Def InCoda -
      5 Cm -
      6 / -
    -Endif
    - -
    - -

    -The other tests are binary (they take two arguments): - -

    -

    -
    LT Str1 Str2
    -
    Returns true if Str1 is less than - Str2. (Please see the discussion below on how the tests are - done.) - -

    -

    -
    LE Str1 Str2
    -
    Returns true if str1 is less than or equal - to Str2. - -

    -

    -
    EQ Str1 Str2
    -
    Returns true if str1 is equal to - Str2. - -

    -

    -
    NE Str1 Str2
    -
    Returns true if str1 is not equal to - Str2. - -

    -

    -
    GT Str1 Str2
    -
    Returns true if str1 is greater than - Str2. - -

    -

    -
    GE Str1 Str2
    -
    Returns true if str1 is greater than or - equal to Str2. - -

    -

    -
    - -

    -In the above tests you have several choices in specifying Str1 -and Str2. At some point, when -MMA does the actual comparison, -two strings or numeric values are expected. So, you really could do: - -

    - - - -
    - If EQ abc ABC - -
    - -

    -and get a ``true'' result. The reason that ``abc'' equals ``ABC'' is -that all the comparisons in -MMA are case-insensitive. - -

    -You can also compare a variable to a string: - -

    - - - -
    - If GT $foo abc - -
    - -

    -will evaluate to ``true'' if the contents of the variable -``foo'' evaluates to something ``greater than'' ``abc''. But, there is -a bit of a ``gotcha' here. If you have set ``foo'' to a two word -string, then -MMA will choke on the command. In the following -example: - -

    - - - -
    - Set Foo A B -
    -If GT $Foo abc
    - -
    - -

    -the comparison is passed the line: - -

    - - - -
    - If GT A B abc - -
    - -

    -and -MMA seeing three arguments generates an error. If you want the -comparison done on a variable which might be more than one word, use -the ``$$'' syntax. This delays the expansion of the variable until -the IF directive is entered. So: - -

    - - - -
    - If $$foo abc - -
    - -

    -would generate a comparison between ``A B'' and ``ABC''. - -

    -Delayed expansion can be applied to either variable. It only works in -an IF directive. - -

    -Strings and numeric values can be confusing in comparisons. For -example, if you have the strings ``22'' and ''3'' and compare them as -strings, ``3'' is greater than ``22''; however, if you compare them as -values then 3 is less than 22. - -

    -The rule in -MMA is quite simple: If either string in a comparison is -a numeric value, both strings are converted to values. Otherwise they -are compared as strings.18.3 -

    -This lets you do consistent comparisons in situations like: - -

    - - - -
    - Set Count 1 -
    -If LE $$Count 4 -
      .... -
    -IfEnd
    - -
    - -

    -Note that the above example could have used ``$Count'', but you -should probably always use the ``$$'' in tests. - -

    -Much like other programming languages, an optional ELSE -condition may be used: - -

    - - - -
    - If Def Coda -
      Groove Rhumba1 -
    -Else -
      Groove Rhumba -
    -Endif
    - -
    - -

    -The ELSE statement(s) are processed only if the test for the -IF test is false. - -

    -Nesting of IFs is permitted: - -

    - - - -
    - If ndef Foo -
      Print Foo has been defined. -
    -Else -
      If def bar -
        Print bar has been defined. Cool. -
      Else -
        Print no bar...go thirsty. -
      Endif -
    -Endif
    - -
    - -

    -works just fine. Indentation has been used in these examples to clearly -show the nesting and conditions. You should do the same. - -

    - -

    -Goto -

    - -

    -The GOTO command redirects the execution order of your script to -the point at which a LABEL or line number has been defined. There are really -two parts to this: - -

    - -

      -
    1. A command defining a label, and, - -

      -

    2. -
    3. The GOTO command. - -

      -

    4. -
    - -

    - -

    -A label is set with the LABEL directive: - -

    - - - -
    - Label Point1 - -
    - -

    -The string defining the label can be any sequence of characters. -Labels are case-insensitive. - -

    -To make this look a lot more line those old BASIC progams, any lines -starting with a line number are considered to be label lines as -well. - -

    -A few considerations on labels and linenumbers: - -

    - -

      -
    • A duplicate label generated with a LABEL command will - generate an error. - -

      -

    • -
    • A line number label duplicating a LABEL is an error. - -

      -

    • -
    • A LABEL duplicating a line number is an error. - -

      -

    • -
    • Duplicate line numbers are permitted. The last one encountered - will be the one used. - -

      -

    • -
    • All label points are generated when the file is opened, not as it is - parsed. - -

      -

    • -
    • Line numbers (really, just comments) do not need to be in any - order. - -

      -

    • -
    - -

    - -

    -The command: - -

    - - - -
    - Goto Point1 - -
    - -

    -causes an immediate jump to a new point in the file. If you are -currently in repeat or conditional segment of the file, the remaining -lines in that segment will be ignored. - -

    - -MMA does not check to see if you are jumping into a repeat or -conditional section of code--but doing so will usually cause an -error. Jumping out of these sections is usually safe. - -

    -The following example shows the use of both types of label. In this -example only lines 2, 3, 5 and 6 will be processed. - -

    - - - -
    - Goto Foo -
    -1 Cm -
    -Label Foo -
    -2 Dm -
    -3 / -
    -Goto 5 -
    -4 Am -
    -5 Cm -
    -6 Dm
    - -
    - -

    -For an example of how to use some simple labels to simulate a ``DS al -Coda'' examine the file ``lullaby-of-Broadway'' in the sample songs -directory. +There must be one REPEATEND or ENDREPEAT for every +REPEAT. Any number of REPEATENDINGs can be included +before the REPEATEND.


    Footnotes

    -
    ... macros.18.1
    -
    The values - are dynamically created and reflect the current settings, and may - not be exactly the same as the value you originally set due to - internal roundings, etc. +
    ...ENDREPEAT18.1
    +
    The reason for both + ENDREPEAT and REPEATEND is to match IFEND and + ENDIF.
    -
    ...IFEND18.2
    -
    -MMA 's author probably suffers - from mild dyslexia and can't remember if the command is IFEND or - ENDIF, so both are permitted. Use whichever is more comfortable for - you. - -
    -
    ... strings.18.3
    -
    An attempt is made to convert each - string to a float. If conversion of both strings is successful, the - comparison is made between two floats, otherwise two strings are - used. - -
    -

    + +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node19.html b/mma/docs/html/ref/node19.html index 5f92dfa..703ee32 100644 --- a/mma/docs/html/ref/node19.html +++ b/mma/docs/html/ref/node19.html @@ -1,4 +1,4 @@ - + -Low Level MIDI Commands - +Variables, Conditionals and Jumps + @@ -25,365 +25,987 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next: Fine Tuning (Translations) - Up: Next: Low Level MIDI Commands + Up: Reference Manual - Previous: Variables, Conditionals and Jumps -
    + Previous: Repeats
    +
    Subsections +

    -processes the file test2.1 and creates -the MIDI file test.mid. +processes the file test2.1 and creates +the MIDI file test.mid. + +

    +When +MMA is finished it displays the name of the generated file, the +number of bars of music processed and an estimate of the song's +duration. Note: + +

      +
    • The duration is fairly accurate, but it does not +take into account any mid-bar TEMPO changes. +
    • +
    • The report shows minutes and hundredths of + minutes. This is done deliberately so that you can add a number of + times together. Converting the time to minutes and seconds is left + as an exercise for the user. +
    • +

    @@ -98,10 +116,10 @@ The following command line options are available:

    - - + + - + @@ -117,7 +135,7 @@ The following command line options are available: + HREF="#foot786">2.2 - +
    OptionDescription
    OptionDescription
    +
    Debugging and other @@ -109,7 +127,7 @@ The following command line options are available:
    -
    -v Show program's version number and exit.
    -d Enable LOTS of debugging messages. This option is mainly designed for program development and may not be useful to users.2.2
    -o A debug subset. This option forces the display of complete @@ -176,16 +194,16 @@ This makes perfect sense if you remember that the same line assignments after processing the input file. No output is generated.
    +
    Commands which modify -MMA 's behaviour. +MMA 's behavior.
    -
    -S Set a macro. If a value is needed, join the value to the name @@ -201,7 +219,7 @@ This makes perfect sense if you remember that the same line

    -will process the file myfile.mma with the variable $Tempo +will process the file myfile.mma with the variable $Tempo set with the value ``120''. You need not specify a value:

    @@ -220,25 +238,46 @@ just sets the variable $test with no value. Disable generation of MIDI output. This is useful for doing a test run or to check for syntax errors in your script. --mBARS +-m BARS Set the maximum number of bars which can be generated. The default setting is 500 bars (a long song!2.3). This setting is + HREF="#foot712">2.3). This setting is needed since you can create infinite loops by improper use of the GOTO command. If your song really is longer than 500 bars use this option to increase the permitted size. --Mx +-M x Generate type 0 or 1 MIDI files. The parameter ``x'' must be set to the single digit ``0'' or ''1''. For more details, see the - MIDISMF section here. + MIDISMF section here. + +-P +Play and delete MIDI file. Useful in testing, the generated + file will be played with the defined MIDI file player (see section + here). The file is created + in the current directory and has the name ``MMAtmpXXX.mid'' with + ``XXX'' set to the current PID. + + +

    +-T TRACKS +Generate only data for the tracks specified. The + tracks argument is a list of comma separated track names. For + example, the command ``mma mysong -T drum,chord'' will limit the + output to the Drum-HH and Chord tracks. This is useful in + separating tracks for multi-track recording. -0 -Generate a syncronization tick at the start of every MIDI - track. This is a one tick note on/off event at offset 0. It can be - useful in multi-track syncronization. +Generate a synchronization tick at the start of every MIDI + track. Note that the option character is a ``zero'', not a ``O''. For + more details see SYNCHRONIZE, here. - +-1 +Force all tracks to end at the same offset. Note that the + option character is a ``one'', not an ``L''. For more details see SYNCHRONIZE, + here. + +
    Maintaining @@ -246,7 +285,7 @@ just sets the variable $test with no value.
    - +

    @@ -255,10 +294,10 @@ just sets the variable $test with no value. LIBPATH. You should run this command after installing new library files or adding a new groove to an existing library file. If the database (stored in the files in each library under the name - .mmaDB) is not updated, + .mmaDB) is not updated, MMA will not be able to auto-load an unknown groove. Please refer to the detailed discussion - here for details. + here for details.


    @@ -276,9 +315,9 @@ The current installation of

    MMA will update the groove database with all files in the - current LIBPATH. All files must have a ``.mma'' - extension. Any directory containing a file named MMAIGNORE - will be ignored. Note, that MMAIGNORE consists of all + current LIBPATH. All files must have a ``.mma'' + extension. Any directory containing a file named MMAIGNORE + will be ignored. Note, that MMAIGNORE consists of all uppercase letters and is usually an empty file. -G @@ -286,29 +325,29 @@ The current installation of forces the creation of a new database file--an update from scratch just in case something really goes wrong. - +
    File commands.
    - +

    -i Specify the RC file to use. See -details here. + details here.

    --fFILE +-f FILE Set output to FILE. Normally the output is sent to a file with the name of the input file with the extension ``.mid'' appended - to it. This option lets you set the output MIDI file to any filename. + to it. This option lets you set the output MIDI file to any file name. - +
    The following commands @@ -317,20 +356,25 @@ The current installation of
    - +
    --Dk +-Dk Print list of MMA keywords. For editor extension writers. --Dxl +-Dxl Expand and print DOC commands used to generate the standard library reference for Latex processing. No MIDI output is generated when this command is given. Doc strings in RC files are not processed. Files included in other files are processed. --Dxh -Same as -Dxl, but generates HTML output. Used by the mklibdoc.py tool. +-Dxh +Same as -Dxl, but generates HTML output. Used by the mklibdoc.py tool. + +-Dv +Displays verbose information about the currently defined + grooves, sequences and patterns. This information could be used to + display (graphically) the different patterns in a file. @@ -353,7 +397,7 @@ line to create a longer line.

    Unless otherwise noted in this manual, the various parts of a line are -delimited from each other by runs of whitespace. Whitespace can be tab +delimited from each other by runs of white space. White space can be tab characters or spaces. Other characters may work, but that is not recommended, and is really determined by Python's definitions. @@ -367,77 +411,81 @@ Programming Comments MMA is designed to read and write files; it is not a filter.2.4 + HREF="#foot793">2.4

    As noted earlier in this manual, MMA has been written entirely in Python.There were some initial concerns about the speed of a ``scripting language'' when the project was started, but Python's -speed appears to be entirely acceptable. On an AMD Athlon 1900+ system -running Mandrake Linux 10.1, most of songs compile to MIDI in well +speed appears to be entirely acceptable. On my long-retired AMD Athlon 1900+ system +running Mandrake Linux 10.1, most songs compiled to MIDI in well under one second. If you need faster results, you're welcome to recode this program into C or C++, but it would be cheaper to buy a faster system, or spend a bit of time tweaking some of the more time intensive Python loops.

    -I've done a bit of testing with Psyco http://psyco.sourceforge.net/ and have found speed increases in the order of 15% to 20%. Output seems fine, so use it if speed is important to you. +If you have Psyco, http://psyco.sourceforge.net/, installed + +MMA will attempt to install the correct module. This will speed +up a compilation by about 30%.



    Footnotes

    -
    ...test2.1
    -
    Actually, the file test - or test.mma is processed. Please read section - file extensions. +
    ... CLASS="textbf">test2.1
    +
    Actually, the file test + or test.mma is processed. Please read section + file extensions.
    -
    ... users.2.2
    +
    ... users.2.2
    A number of the debugging commands can also be set dynamically in a - song. See the debug section here + song. See the debug section here for details.
    -
    ... song!2.3
    +
    ... song!2.3
    500 bars with 4 beats per bar at 200 BPM is about 10 minutes.
    -
    ... +
    ... filter.2.4
    + HREF="node2.html#tex2html13">2.4
    A filter mode could be added to MMA , but I'm not - sure why this would be needed). + sure why this would be needed.
    -

    + +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node20.html b/mma/docs/html/ref/node20.html index a16232f..d86e31c 100644 --- a/mma/docs/html/ref/node20.html +++ b/mma/docs/html/ref/node20.html @@ -1,4 +1,4 @@ - + -Fine Tuning (Translations) - +Low Level MIDI Commands + @@ -25,515 +25,1653 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next: Other Commands and Directives - Up: Next: Patch Management + Up: Reference Manual - Previous: Low Level MIDI Commands -
    + Previous: Variables, Conditionals and Jumps
    +
    Subsections +

    - +
    -Fine Tuning (Translations) +Low Level MIDI Commands

    -A program such as -MMA which is intended to be run of various -computers and synthesizers (both hardware keyboards and software -versions) suffers from a minor deficency of the MIDI standards: mainly -that the standard says nothing about what a certain instrument should -sound like, or the relative volumes between instruments. The GM -extension helps a bit, but only a bit, by saying that certain -instruments should be assigned certain program change values. This -means that all GM synths will play a "Piano" if instrument 000 is -selected. +The commands discussed in this chapter directly effect your MIDI +output devices.

    -But, if one plays a GM file on a Casio keyboard, then on PC -soft-synth, and then on a Yahama keyboard you will get three quite -different sounds. The files supplied in this distribution have been -created to sound good on the author's setup: A Casio WK-3000 keyboard. - -

    -But, what if your hardware is different? Well, there are solutions! -Later in this chapter commands are shown which will change the -preselected voice and tone commands and the default volumes. At this -time there are no example files supplied with -MMA , but your -contributions are welcome. - -

    -The general suggestion is that: +Not all MIDI devices are equal. Many of the effects in this chapter +may be ignored by your devices. Sorry, but that's just the way MIDI +is.

    -

      -
    1. You create a file with the various translations you need. For - example, the file might be called yamaha.mma and contain - lines like: +

      +
      +Channel +

      + +

      +As noted in Tracks and Channels +MMA assigns MIDI channels +dynamically as it creates tracks. In most cases this works fine; +however, you can if you wish force the assignment of a specific MIDI +channel to a track with the CHANNEL command. + +

      +You cannot assign a channel number to a track if it already defined +(well, see the section CHSHARE, below, for the inevitable +exception), nor can you change the channel assignments for any of the +DRUM tracks. + +

      +Let us assume that you want the Bass track assigned to MIDI +channel 8. Simply use:

      - VoiceTR Piano1=Piano2 -
      -ToneTr SnareDrum2=SnareDrum1 -
      -VoiceVolTr Piano2=120 BottleBlow=80 -
      -DrumVolTr RideBell=90 Tambourine=120
      + Bass Channel 8

      -Place this file in the directory /usr/local/share/mma/includes. +Caution: If the selected channel is already in use an error will be +generated. Due to the way +MMA allocates tracks, if you really need +to manually assign track it is recommended that you do this in a +MMARC file.

      -

    2. -
    3. Include this file in your ~/.mmarc file. Following the - above example, you would have a line: + +

      +You can disable a channel at any time by using a channel number of 0:

      - Include yamaha + Arpeggio-1 Channel 0

      -

    4. -
    +will disable the Arpeggio-1 channel, freeing it for use by other +tracks. A warning message is generated. Disabling a track without a +valid channel is fine. When you set a channel to 0 the track is also +disabled. You can restart the track with the ON command +(here).

    -That's it! Now, whenever you compile a -MMA file the translations -will be done. +You don't need to have a valid MIDI channel assigned to a track to do +things like: MIDIPAN, MIDIGLIS, MIDIVOLUME or +even the assignment of any music to a track. MIDI data is created in +tracks and then sent out to the MIDI buffers. Channel assignment is +checked and allocated at this point, and an error will be generated if +no channels are available.

    -All of the following translation settings follow a similar logic as to ``when'' -they take effect, and that is at the time the VOICE, -VOLUME, etc. command is issued. This may confuse the unwary if -GROOVES are being used. But, the following sequence: +It's quite acceptable to do channel reassignments in the middle of a +song. Just assign channel 0 to the unneeded track first.

    - - -
    - -
      -
    1. You set a voice with the VOICE command, -
    2. -
    3. You save that voice into a GROOVE with DEFGROOVE, -
    4. -
    5. You create a voice translation with VOICETR, -
    6. -
    7. You activate the previously defined GROOVE. -
    8. -
    - - - -
    Wrong!
    - -

    -does not have the desired effect. In the above sequence the -VOICETR will have no effect. For the desired -translations to work the VOICE (or whatever) command must come -after the translation command. +MIDI channel settings are not saved in GROOVEs.

    -

    -
    -VoiceTr +MMA inserts a MIDI ``track name'' meta event when the channel +buffers are first assigned at a MIDI offset of 0. If the MIDI channel +is reassigned, a new ``track name'' is inserted at the current song +offset. + +

    +A more general method is to use CHANNELPREF detailed below. + +

    +You can access the currently assigned channel with the +$_TRACK_CHANNEL macro. + +

    + +

    +ChannelPref

    -In previous section you saw how to set a voice for a track by using its -standard MIDI name. The VOICETR command sets up a translation -table that can be used in two different situations: +If you prefer to have certain tracks assigned to certain channels you +can use the CHANNELPREF command to create a custom set of +preferences. By default, +MMA assigns channels starting at 16 and +working down to 1 (with the expectation of drum tracks which are all +assigned channel 10). If, for example, you would like the Bass +track to be on channel 9, sustained bass on channel 3, and +Arpeggio on channel 5, you can have a command like:

    + + +
    + ChannelPref Bass=9 Arpeggio=5 Bass-Sus=3 + +
    + +

    +Most likely this will be in your MMARC file. + +

    +You can use multiple command lines, or have multiple assignments on a +single line. Just make sure that each item consists of a trackname, an +``='' and a channel number in the range 1 to 16. + +

    + +

    +
    +ChShare +

    + +

    + +MMA is fairly conservative in its use of MIDI tracks. ``Out of the +box'' it demands a separate MIDI channel for each of its tracks, but +only as they are actually used. In most cases, this works just fine. + +

    +However, there are times when you might need more tracks than the +available MIDI channels or you may want to free up some channels for +other programs. + +

    +If you have different tracks with the same voicing, it's quite simple. +For example, you might have an arpeggio and scale track: + +

    + + + +
    + Arpeggio Sequence A16 z +
    +Arpeggio Voice Piano1 +
    +Scale Sequence z S8 +
    +Scale Voice Piano1
    + +
    + +

    +In this example, +MMA will use different MIDI channels for the +Arpeggio and the Scale. Now, if you force channel +sharing: + +

    + + + +
    + Scale ChShare Arpeggio + +
    + +

    +both tracks will use the same MIDI channel. + +

    +This is really foolproof in the above example, especially since the +same voice is being used for both. Now, what if you wanted to use a +different voice for the tracks? + +

    + + + +
    + Arpeggio Sequence A16 z +
    +Arpeggio Voice Piano1 Strings +
    +Scale Sequence z S8 +
    +Scale ChShare Arpeggio
    + +
    + +

    +You might think that this would work, but it doesn't. +MMA ignores +voice changes for bars which don't have a sequence, so it will set +``Piano1'' for the first bar, then ``Strings'' for the second (so far, +so good). But, when it does the third bar (an ARPEGGIO) it will +not know that the voice has been changed to ``Strings'' by the +Scale track. + +

    +So, the general rule for track channel sharing is to use only one +voice. + +

    +One more example which doesn't work: + +

    + + + +
    + Arpeggio Sequence A8 +
    +Scale Sequence S4 +
    +Arpeggio Voice Piano1 +
    +Scale Voice Piano1 +
    +Scale ChShare Arpeggio
    + +
    + +

    +This example has an active scale and arpeggio sequence in each +bar. Since both use the same voice, you may think that it will work +just fine ...but it may not. The problem here is that +MMA will +generate MIDI on and off events which may overlap each other. One or +the other will be truncated. If you are using a different octave, it +will work much better. It may sound okay, but you should probably find +a better way to do this. + +

    +When a CHSHARE directive is parsed the ``shared'' channel is +first checked to ensure that it has been assigned. If not currently +assigned, the assignment is first done. What this means is that you +are subverting +MMA 's normal dynamic channel allocation scheme. This +may cause is a depletion of available channels. + +

    +Please note that that the use of the CHSHARE command is +probably never really needed, so it might have more problems than +outlined here. If you want to see how much a bother channel sharing +becomes, have a look at the standard library file +frenchwaltz.mma. All this so the accordion bass can use one +channel instead of 6. If I were to write it again I'd just let it suck +up the MIDI channels. + +

    +For another, simpler, way of reassigning MIDI tracks and letting +MMA do most of the work for you, refer to the +DELETE command. + +

    + +

    +ForceOut +

    + +

    +Under normal conditions +MMA only generates the MIDI tracks it thinks +are valid or relevant. So, if you create a track but insert no note +data into that track it will not be generated. An easy way to verify +this is by creating file and running +MMA with the -c command line +option. Lets start off by creating a file you might think will set the +keyboard channel on your synth to a TenorSax voice: + +

    + + + +
    + Begin Solo-Keyboard +
      Channel 1 +
      Voice TenorSax +
      MIDIVolume 100 +
    +End
    + +
    + +

    +If you compile this you should get: + +

    + + + +
    + $ mma test -c +
       +
    +File 'test' parsed, but no MIDI file produced! +
      +
    +Tracks allocated: +
     SOLO-KEYBOARD +
      +
    +Channel assignments: +
    +1 SOLO-KEYBOARD +
    + +
    + +

    +So, a +MMA track was created, but if you compile this file and +examine the resulting MIDI file you will find that the voice has + not been set. + +

    +To overcome this, insert the FORCEOUT command at the end of the +track setup. For example, here is a more complete file which will set +the keyboard track to TenorSax with a volume of 100, play a bar of +accompaniment, set a Trumpet voice with a louder volume, play another +bar, and finally reset the keyboard to the default Piano voice. + +

    + + + +
    + Groove BossaNova +
      +
    +Begin Solo +
      Channel 1 +
      Voice TenorSax +
      MIDIVolume 100 +
      ForceOut +
    +End +
      +
    +1 C +
      +
    +Begin Solo +
      Voice Trumpet +
      MIDIVolume 120 +
      ForceOut +
    +End +
      +
    +2 G +
      +
    +Begin Solo +
      Voice Piano1 +
      MIDIVolume 127 +
      ForceOut +
    +End +
    + +
    + +

    +Note: The same or similar results could be accomplished with the +MIDI command; however, it's a bit harder to use and the +commands would be in the Meta track. + +

    + +

    + +
    +MIDI +

    + +

    +The complete set of MIDI commands is not limitless--but from this end +it seems that adding commands to suit every possible configuration is +never-ending. So, in an attempt to satisfy everyone, a command which +will place any arbitrary MIDI stream in your tracks has been +implemented. In most cases this will be a MIDI ``Sysex'' or ``Meta'' +event. + +

    +For example, you might want to start a song off with a MIDI reset: + +

    + + + +
    + MIDI 0xF0 0x05 0x7e 0x7f 0x09 0x01 0xf7 + +
    + +

    +The values passed to the MIDI command are normal integers; however, +they must all be in the range of 0x00 to 0xff. In most cases it is +easiest to use hexadecimal numbers by using the ``0x'' prefix. But, +you can use plain decimal integers if you prefer. + +

    +In the above example: + +

    +

    +
      0xF0
    +
    Designates a SYSEX message + +

    +

    +
      0x05
    +
    The length of the message + +

    +

    +
      0x7e
    +
    ...The actual message + +

    +

    +
    + +

    +Another example places the key signature of F major (1 flat) in the +meta track:20.1 +

    + + + +
    + MIDI 0xff 0x59 0x02 0xff 0x00 + +
    + +

    +Some cautions: +

      -
    • It permits creation of your own names for voices (perhaps for a - foreign language), +
    • +MMA makes no attempt to verify the validity of the data!

    • -
    • It lets you override or change voices used in standard library +
    • The ``Length'' field must be manually calculated. + +

      +

    • +
    • Malformed sequences can create non-playable MIDI files. In extreme + situations, these might even damage your synth. You are on your own + with this command ...be careful. + +

      +

    • +
    • The MIDI directive always places data in the Meta + track at the current time offset into the file. This should not be a + problem. + +

      +

    • +
    + +

    +Cautions aside, includes/init.mma has been included in this +distribution. I use this without apparent problems; to use it add the +command line: + +

    + + + +
    + MMAstart init + +
    + +

    +in your MMARC file. The file is pretty well commented and it +sets a synth up to something reasonably sane. + +

    +If you need a brief delay after a raw MIDI command, it is possible to +insert a silent beat with the BEATADJUST + command. See +the file includes/reset.mma for an example. + +

    + +

    +
    +MIDIClear +

    + +

    +As noted earlier in this manual you should be very careful in +programming MIDI sequences into your song and/or library files. Doing +damage to a synthesizer is probably a remote possibility ...but +leaving it in a unexpected mode is likely. For this reason the +MIDICLEAR command has been added as a companion to the +MIDIVOICE and MIDISEQ commands. + +

    +Each time a MIDI track (not necessary the same as a +MMA track) is +ended or a new GROOVE is started, a check is done to see if any +MIDI data has been inserted in the track with a MIDIVOICE or +MIDISEQ command. If it has, a further check is done to see if +there is an ``undo'' sequence defined via a MIDICLEAR command. +That data is then sent; or, if data has not be defined for the track, +a warning message is displayed. + +

    +The MIDICLEAR command uses the same syntax as MIDIVOICE +and MIDISEQ; however, you can not specify different sequence +for different bars in the sequence: + +

    + + + +
    + Bass-Funky MIDIClear 1 Modulation 0; 1 ReleaseTime 0 + +
    + +

    +As in MIDIVOICE and MIDISEQ you can include sequences +defined in a MIDIDEF. The <beat>offsets +are required, but ignored. + +

    + +

    +
    +MIDIFile +

    + +

    +This option controls some fine points of the generated MIDI file. The +command is issued with a series of parameters in the form +``MODE=VALUE''. You can have multiple settings in a single +MIDIFILE command. + +

    + +MMA can generate two types of SMF (Standard MIDI Files): +

    +
    0.
    +
    This file contains only one track into which the data for + all the different channel tracks has been merged. A number of synths + which accept SMF (Casio, Yamaha and others) only accept type 0 files.

    -

  • - + +
    1.
    +
    This file has the data for each MIDI channel in its own + track. This is the default file generated by +MMA .

    -VOICETR works by setting up a simple translation table of -``name'' and ``alias'' pairs. Whenever -MMA encounters a voice name -in a track command it first attempts to translate this name though the -alias table. +

    +

    -To set a translation (or series of translations): +You can set the filetype in an RC file (or, for that matter, in any +file processed by +MMA ) with the command:

    - VoiceTr Piano1=Clavinet Hmmm=18 + MidiFile SMF=0

    -Note that you additional VOICETR commands will add entries to -the existing table. To clear the table use the command with no -arguments: +or

    - VoiceTr // Empty table + MidiFile SMF=1

    -Assuming the first command, the following will occur: +You can also set it on the command line with the -M option. Using the +command line option will override the MIDISMF command if it is +in a RC file. + +

    +By default +MMA uses ``running status'' when generating MIDI files. +This can be disabled with the command:

    - Chord-Main Voice Hmmm + MidiFile Running=0

    -The VOICE for the Chord-Main track will be set to ``18'' -or ``Organ3''. +or enabled (but this is the default) with:

    - Chord-2 Voice Piano1 + MidiFile Running=1

    -The VOICE for the Chord-2 track will be set to -``Clavinet''. - -

    -If your synth does not follow standard GM-MIDI voice naming -conventions you can create a translation table which can be included -in all your -MMA song files via an RC file. But, do note that the -resulting files will not play properly on a synth conforming to the -GM-MIDI specification. - -

    -Following is an abbreviated and untested example for using an obsolete and unnamed synth: +Files generated without running status will be about 20 to 30% larger +than their compressed counterparts. They may be useful for use with +brain-dead sequencers and in debugging generated code. There is no +command line equivalent for this option.

    - - -
    - VoiceTr Piano1=3 \ -
    -Piano2=4 \ -
    -Piano3=5 \ -
    ... \ -
    -Strings=55 \ -
    ...
    - -
    - -

    -Notes: the translation is only done one time and no verification is -done when the table is created. - -

    -For translating drum tone values, see -DRUMTR. - -

    - -

    -
    -DrumTr +

    +MIDIGlis

    -It is possible to create a translation table which will substitute one -Drum Tone for another. This can be useful in a variety of -situations, but consider: +This sets the MIDI portamento20.2 (in case you're new to all this, portamento is like +glissando between notes--wonderful, if you like trombones! To enable +portamento: + +

    + + + +
    + Arpeggio MIDIGlis 30 + +
    + +

    +The parameter can be any value between 1 and 127. To turn the sliding +off: + +

    + + + +
    + Arpeggio MIDIGlis 0 + +
    + +

    +This command will work with any track (including drum tracks). +However, the results may be somewhat ``interesting'' or +``disappointing'', and many MIDI devices don't support portamento at +all. So, be cautious. The data generated is not sent into the MIDI +stream until musical data is created for the relevant MIDI channel. + +

    + +

    +MIDIInc +

    + +

    + +MMA has the ability to include a user supplied MIDI file at any +point of its generated files. These included files can be used to play +a melodic solo over a +MMA pattern or to fill a section of a song +with something like a drum solo. + +

    +When the MIDIINC command is encountered the current line is +parsed for options, the file is inserted into the stored MIDI stream, +and processing continues. The include has no effect on any song +pointers, etc. + +

    +MIDIINC has a number of options, all set in the form +OPTION=VALUE. Following are the recognized options: + +

    +

    +
    FILENAME
    +
    The filename of the file to be included. This must be + a complete filename. The filename will be expanded by the Python + os.path.expanduser() function for tilde expansion. No prefixes or + extensions are added by +MMA . Examples: + FILENAME=/home/bob/midi/myfile.mid. or + FILENAME= /sounds/myfile.mid. + +

    +

    +
    VOLUME
    +
    An adjustment for the volume of all the note on events + in the included MIDI file. The adjustment is specified as a + percentage with values under 100 decreasing the volume and over 100 + increasing it. If the resultant volume (velocity) is less than 1 a + velocity of 1 will be used; if it is over 127, 127 will be + used. Example: VOLUME=80. + +

    +

    +
    OCTAVE
    +
    Octave adjustment for all notes in the file. Values in + the range -4 to 4 are permitted. Notes in drum tracks (channel 10) + will not be effected. Example: OCTAVE=2. + +

    +

    +
    TRANSPOSE
    +
    Transposition adjustment settings in the range -24 to + 24 are permitted. If you do not set a value for this the global + transpose setting will be applied (expecting channel 10, drum, + notes). Example: TRANSPOSE=-2. + +

    +

    +
    LYRIC
    +
    This option will copy any Lyric events to the + +MMA meta track. The valid settings are ``On'' or ``Off''. By + default this is set to ``Off''. Example LYRIC=On. + +

    +

    +
    TEXT
    +
    This option will copy any Text events to the +MMA meta track. The valid settings are ``On'' or ``Off''. By default + this is set to ``Off''. Example TEXT=On. + +

    +

    +
    START
    +
    Specifies the start point of the file to be + included in beats. For example, ``Start=22'' would start the + include process 22 beats into the file. The data will be inserted at + the current song position in your MMA file. The value used must + greater or equal to 0 and may be a fractional beat value (18.456 if + fine). + +

    +

    +
    END
    +
    Specifies the end point of the file to be included + in beats. For example, ``End=100'' would discard all data after 100 + beats in the file. The value used must be greater that the + Start position and can be fractional. + +

    +

    +
    TRACK
    +
    A trackname must be set into which notes + are inserted. You can set more than one track/channel if you + wish. For example, if you had the option DRUM=10 any notes in + the MIDI file with a channel 10 setting would be inserted into the + +MMA Drum track. Similarity, Solo-Tenor=1 will copy + notes from channel 1 into the Solo-Tenor track. If the track + doesn't exist, it will be created. Note: this means that the channel + assignment in your included file and the new +MMA generated file + will most likely be different. + +

    +At least one TRACK option is required to include a MIDI + file. It is up to the user to examine existing MIDI files to + determine the tracks being used and which to include into +MMA 's + output. + +

    +

    +
    + +

    +A complete example of usage is shown in the files in the directory +egs/frankie in the distribution. A short example: + +

    + + + +
    + MIDIinc File=test.mid Solo-Piano=1 Drum=10 Volume=70 + +
    + +

    +will include the MIDI file ``test.mid'' at the current position and +assign all notes in channel 1 to the Solo-Piano track and the +notes from channel 10 to the Drum track. The volumes for all +the notes will be adjusted to 70% of that in the original. + +

    +A few notes:

      -
    • Your syth lacks certain drum tones--in this case you may want - to set certain DRUMTR commands in a MMARC file. +
    • MIDI files to be included do not have to have the same tempo. + MIDIINC adjusts this automatically during the importation. + However, the internal setting for beat division should be the same. + +MMA assumes a beat division of 192 (this is set in bytes 12 and 13 + of the MIDI file). If the included file differs a warning is printed + and +MMA will attempt to adjust the timings.

    • -
    • You are using an existing GROOVE in a song, but don't - like one or more of the Drum Tones selected. Rather than - editing the library file you can set a translation right in the - song. Note, do this before any GROOVE commands. +
    • All files are parsed to find the offset of the first note-on + event; notes to be included are set with their offsets compensated + by that time. This means that any silence at the start of the + included file is skipped (this may surprise you if you have used the + optional Start setting). If you want the included file to + start somewhere besides the start of the current bar you can use a + BEATADJUST before the MIDIINC--use another to move + the pointer back right after the include to keep the song pointer + correct. + +

      +

    • +
    • Not all events in the included files are transferred: notably + all system and meta events (other than text and lyric, see above) + are ignored. + +

      +

    • +
    • If you want to apply different VOLUME or other options to + different tracks, just do multiple includes of the same file (with + each include using a different track and options). + +

    -To set a translation (or set of translations) just use a list of -drumtone values or symbolic names with each pair separated by -white space. For example: -

    - - - -
    - ToneTR SnareDrum2=SnareDrum1 HandClap=44 - -
    - -

    -will use a ``SnareDrum1'' instead of a ``SnareDrum2'' and the value -``44'' (actually a ``PedalHiHat'') instead of a ``HandClap''. - -

    -You can turn off all drum tone translations with an empty line: - -

    - - - -
    - ToneTR - -
    - -

    -The syntax and usage of DRUMTR is quite similar to -VOICETR. - -

    - -

    -
    -VoiceVolTr +

    +MIDIMark

    -If you find that a particular voice, i.e., Piano2, is too loud or soft -you can create an entry in the ``Voice Volume Translation Table''. The -concept is quite simple: -MMA checks the table whenever a -track-specific VOLUME command is processed. The table is -created in a similar manner to the VOICETR command: +You can insert a MIDI Marker event into the Meta track with this +command. The mark can be useful in debugging your MIDI output with a +sequencer or editor which supports Mark events (most do).

    - VoiceVolTr Piano2=120 105=75 + MidiMark Label

    -Each voice pair must contain a valid MIDI voice (or numeric value), -an ``='' and a volume adjustment factor. The factor is a percentage -value which is applied to the normal volume. In the above example two -adjustments are created: +will insert the text ``Label'' at the current position. You can add an +optional negative or positive offset in beats: + +

    + + + +
    + MidiMark 2 Label4 + +
    + +

    +will insert ``Label4'' 2 beats into the next bar. + +

    + +

    +MIDIPan +

    + +

    +In MIDI-speak ``pan'' is the same as ``balance'' on a stereo. By +adjusting the MIDIPAN for a track you can direct the output to +the left, right or both speakers. Example: + +

    + + + +
    + Bass MIDIPan 4 + +
    + +

    +This command is only available in track mode. The data generated is +not sent into the MIDI stream until musical data is created for the +relevant MIDI channel. + +

    +The value specified must be in the range 0 to 127, and must be an +integer. + +

    +A variation for this command is to have the pan value change over a +range of beats: + +

    + + + +
    + Solo MidiPan 10 120 4 + +
    + +

    +in this case you must give exactly 3 arguments:

      -
    1. Piano2 will be played at %120 of the normal value, - -

      +

    2. The initial pan value (0 to 127),
    3. -
    4. Banjo (voice 105) will be played at %75 of the normal value. +
    5. The final pan value (0 to 127), +
    6. +
    7. The number of beats to apply the pan over.

    -The adjustments are made when a track VOLUME command is -encountered. For example, if the above translation has be set and +Using a beat count you can create interesting effects with different +instruments moving between the left and right channels. -MMA encounters the following commands: +

    +MIDIPAN is not saved or restored by GROOVE commands, nor +is it effected by SEQCLEAR. A MIDIPAN is inserted +directly into the MIDI track at the point at which it is encountered +in the music file. This means that the effect of MIDIPAN will +be in use until another MIDIPAN is encountered. +

    +MIDIPAN can be used in MIDI compositions to emulate the sound +of an orchestra. By assigning different values to different groups of +instruments, you can get the feeling of strings, horns, etc. all +placed in the ``correct'' position on the stage. + +

    +MIDIPAN can be used for much cruder purposes. When creating +accompaniment tracks for a mythical jazz group, you might set all the +bass tracks (Bass, Walk, Bass-1, etc) set to aMIDIPAN 0. Now, +when practicing at home you have a ``full band''; and the bass player +can practice without the generated bass lines simply by turning off +the left speaker. + +

    +Because most MIDI keyboard do not reset between tunes, there should be +a MIDIPAN to undo the effects at the end of the +file. Example:20.3

    - Begin Chord -
       Voice Piano2 -
       Volume mp -
       Sequence 1 4 90 + Include swing
    -End
    +Groove Swing +
    +Bass MIDIPan 0 +
    +Walk MIDIPan 0 +
    +1 C +
    +2 C +
    ... +
    +123 C +
    +Bass MIDIPan 64 +
    +Walk MIDIPan 64

    -the following adjustments are made: + +

    +MIDISeq +

    + +

    +It is possible to associate a set of MIDI controller messages with +certain beats in a sequence. For example, you might want to have the +Modulation Wheel set for the first beats in a bar, but not for the +third. The following example shows how: + +

    + + + +
    + Seqsize 4 +
    +Begin Bass-2 +
    +Voice NylonGuitar +
    +Octave 4 +
    +Sequence { 1 4 1 90; 2 4 3 90; 3 4 5 90; 4 4 1+ 90} +
    +MIDIDef WheelStuff 1 1 0x7f ; 2 1 0x50; 3 1 0 +
    +MidiSeq WheelStuff +
    +Articulate 90 +
    +End +
    +
    +C $*$ 4
    + +
    + +

    +The MIDISEQ command is specific to a track and is saved as part +of the GROOVE definition. This lets style file writers use +enhanced MIDI features to dress up their sounds. + +

    +The command has the following syntax: + +

    + + + +
    + TrackName MidiSeq <Beat> <Controller> <Datum> [ ; ...] + +
    + +

    +where: +

    +
    Beat
    +
    is the Beat in the bar. This can be an integer (1,2, etc.) + or a floating point value (1.2, 2.25, etc.). It must be 1 or greater + and less than the end of bar (in 4/4 it must be less than + 5). + +

    +

    +
    Controller
    +
    A valid MIDI controller. This can be a value in the + range 0x00 to 0x7f or a symbolic name. See the appendix + , here, for a list of + defined names. + +

    +

    +
    Datum
    +
    All controller messages use a single byte ``parameter'' + in the range 0x00 to 0x7f. + +

    +

    +
    + +

    +You can enter the values in either standard decimal notation or in +hexadecimal with the prefixed ``0x''. In most cases, your code will be +clearer if you use values like ``0x7f'' rather than the equivalent +``127''. + +

    +The MIDI sequences specified can take several forms:

      -
    1. A lookup is done in the global volume table. The volume ``mf'' - is determined to be %85 for the set MIDI velocity, +
    2. A simple series like:

      -

    3. -
    4. the adjusment of %120 is applied to the %85, changing that to %102. + + + +
      + MIDISeq 1 ReleaseTime 50; 3 ReleaseTime 0 + +

      -

    5. -
    6. Assuming that no other volume adjustments are being made - (probably there will be a global volume and, perhaps, a - RVOLUME) the MIDI velocity in the sequence will be changed - from 90 to 91. Without the translation the 90 would have been changed to 76. +in this case the commands are applied to beats 1 and 3 in each bar + of the sequence.

    +

    . + +

    -To disable all volume translations: +As a set of names predefined in an MIDIDEF command:

    +
    - VoiceVolTr // Empty table + MIDIdef Rel1 1 ReleaseTime 50; 3 ReleaseTime 0 +
    +MIDIdef Rel2 2 ReleaseTime 50; 4 ReleaseTime 0 +
    +MIDISeq Rel1 Rel2
    + +
    + +

    +Here, the commands defined in ``Rel1'' are applied to the first bar + in the sequence, ``Rel2'' to the second. And, if there are more bars + in the sequence than definitions in the line, the series will be + repeated for each bar. + +

    +A set of series enclosed in { } braces. Each braced series is + applied to a different bar in the sequence. The example above could + have been does as: + +

    + + + +
    + MIDISeq { 1 ReleaseTime 50; 3 ReleaseTime 0 } \ +
    { 2 ReleaseTime 50; 4 ReleaseTime 0 }
    + +
    + +

    +Finally, you can combine the above into different combinations. + For example: + +

    + + +
    + MIDIDef Rel1 1 ReleaseTime 50 +
    +MIDIDef Rel2 2 ReleaseTime 50 +
    +MIDISeq { Rel1; 3 ReleaseTime 0 } { Rel2; 4 ReleaseTime 0 }

    -

    -
    -DrumVolTr +

    +You can have specify different messages for different beats (or +different messages/controllers for the same beat) by listing them on +the same MIDISEQ line separated by ``;''s. + +

    +If you need to repeat a sequence for a measure in a sequence you can +use the special notation ``/'' to force the use of the previous line. +The special symbol ``z'' or ''-'' can be used to disable a bar (or +number of bars). For example: + +

    + + + +
    + Bass-Dumb MIDISeq 1 ReleaseTime 20 z / FOOBAR + +
    + +

    +would set the ``ReleaseTime'' sequence for the first bar of the +sequence, no MIDISeq events for the second and third, and the contents +of ``FOOBAR'' for the fourth. + +

    +To disable the sending of messages just use a single ``-'': + +

    + + + +
    + Bass-2 MidiSeq - // disable controllers + +
    + +

    + +

    +MIDISplit

    -You can change the volumes of indvidual drum tones with the -DRUMVOLTR translation. This command works just like the -VOICEVOLTR command desribed above. It just uses drum tones -instead of instrument voices. +For certain post-processing effects it is convenient to have each +different drum tone in a separate MIDI track. This makes it easier to +apply an effect to, for example, the snare drum. Just to make this a +bit more fun you can split any track created by +MMA .

    -For example, if you wish to make the drum tones ``SnareDrum1'' and -``HandClap'' a bit louder: +To use this feature:

    - DrumVolTr SnareDrum1=120 HandClap=110 + MIDISplit <list of channels>

    -The drum tone names can be symbolic constants, or MIDI values as in -the next example: +So, to split out just the drum channel20.4 you would have the command:

    - DrumVolTr 44=90 31=55 + MIDISplit 10

    -All drum tone translations can be disabled with: +somewhere in your song file. + +

    +When processing +MMA creates an internal list of MIDI note-on events +for each tone or pitch in the track. It then creates a separate MIDI +track for each list. Any other events are written to another track. + +

    + +

    +MIDITname +

    + +

    +When creating a MIDI track, +MMA inserts a MIDI Track Name event at +the start of the track. By default, this name is the same as the +associated +MMA track name. You can change this by issuing the +MIDITNAME command. For example, to change the CHORD +track name you might do something like:

    - DrumVolTr // Empty table + Chord MidiTname Piano
    +

    +Please note that this only effects the tracks in the generated +MIDI file. You still refer to the track in your file as CHORD.

    -


    + +

    +MIDIVoice +

    + +

    +Similar to the MIDISEQ command discussed in the previous +section, the MIDIVOICE command is used to insert MIDI +controller messages into your files. Instead of sending the data for +each bar as MIDISEQ does, this command just sends the listed +control events at the start of a track and then, if needed, at the +start of each bar. + +

    +Again, a short example. Let us assume that you want to use the +``Release Time'' controller to sustain notes in a bass line: + +

    + + + +
    + Seqsize 4 +
    +Begin Bass-2 +
    +Voice NylonGuitar +
    +MidiVoice 1 ReleaseTime 50 +
    +Octave 4 +
    +Sequence { 1 4 1 90; 2 4 3 90; 3 4 5 90; 4 4 1+ 90} +
    +Articulate 60 +
    +End +
    +
    +C $*$ 4
    + +
    + +

    +should give an interesting effect. + +

    +The syntax for the command is: + +

    + + + +
    + Track MIDIVoice <beat> <controller> <Datum> [; ...] + +
    + +

    +This syntax is identical to that discussed in the section for +MIDISEQ, above. The <beat>value is +required for the command--it determines if the data is sent before or +after the VOICE command is sent. Some controllers are reset by +a voice, others not. My experiments show that BANK should be +sent before, most others after. Using a ``beat'' of ``0'' forces the +MidiVoice data to be sent before the Voice control; any other ``beat'' +value causes the data to be sent after the Voice control. In this +silly example: + +

    + + + +
    + Voice Piano1 +
    +MidiVoice {0 Bank 5; 1 ReleaseTime 100}
    + +
    + +

    +the MIDI data is created in an order like: + +

    +

    +

    0 Param Ch=xx Con=00 val=05 +
    +0 ProgCh Ch=xx Prog=00 +
    +0 Param Ch=xx Con=72 val=80 + +
    + +

    +All the MIDI events occur at the same offset, but the order is (may +be) important. + +

    +By default +MMA assumes that the MIDIVoice data is to be used only +for the first bar in the sequence. But, it's possible to have a +different sequence for each bar in the sequence (just like you can +have a different VOICE for each bar). In this case, group the +different data groups with {} brackets: + +

    + + + +
    + Bass-1 MIDIVoice {1 ReleaseTime 50} {1 ReleaseTime 20} + +
    + +

    +This list is stored with other GROOVE data, so is ideal for +inclusion in a style file. + +

    +If you want to disable this command after it has been issued you can +use the form: + +

    + + + +
    + Track MIDIVoice - // disable + +
    + +

    +Some technical notes: + +

    + +

      +
    • +MMA tracks the events sent for each bar and will not duplicate + sequences. + +

      +

    • +
    • Be cautious in using this command to switch voice banks. If you + don't switch the voice bank back to a sane value you'll be playing + the wrong instruments! + +

      +

    • +
    • Do use the MIDICLEAR command + ((details)) to + ``undo'' anything you've done via a MIDIVOICE command. + +

      +

    • +
    + +

    + +

    +
    +MIDIVolume +

    + +

    +MIDI devices equipped with mixer settings can make use of the +``Channel'' or ``Master'' volume settings.20.5 +

    + +MMA doesn't set any channel volumes without your knowledge. If you +want to use a set of reasonable defaults, look at the file +includes/init.mma which sets all channels other than ``1'' to +``100''. Channel ``1'' is assumed to be a solo/keyboard track and is +set to the maximum volume of ``127''. + +

    +You can set selected MIDIVOLUMEs: + +

    + + + +
    + Chord MIDIVolume 55 + +
    + +

    +will set the Chord track channel. For most users, the use of this +command is not recommended since it will upset the balance of +the library grooves. If you need a track softer or louder you should +use the volume setting for the track. + +

    +The data generated is not sent into the MIDI stream until musical data +is created for the relevant MIDI channel. + +

    +Caution: If you use the command with ALLTRACKS you should note +that only existing +MMA tracks will be effected. + +

    +


    Footnotes

    +
    +
    ... track:20.1
    +
    This is much easier to do with the KeySig + command, here + +
    +
    ... portamento20.2
    +
    The name ``Glis'' is used + because ``MIDIPortamento'' gets to be a bit long to type and + ``MIDIPort'' might be interpreted as something to do with + ``ports''. + +
    +
    ... Example:20.3
    +
    This is much easier to do with the MMAStart + and MMAEnd options (details). + +
    +
    ... channel20.4
    +
    In +MMA this will + always be channel 10. + +
    +
    ... settings.20.5
    +
    I discovered this + on my keyboard after many frustrating hours attempting to balance + the volumes in the library. Other programs would change the keyboard + settings, and not being aware of the changes, I'd end up scratching + my head. + +
    +
    +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node21.html b/mma/docs/html/ref/node21.html index 3091b9c..e9588a6 100644 --- a/mma/docs/html/ref/node21.html +++ b/mma/docs/html/ref/node21.html @@ -1,4 +1,4 @@ - + -Other Commands and Directives - +Patch Management + @@ -25,1384 +25,67 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next: Begin/End Blocks - Up: Next: Fine Tuning (Translations) + Up: Reference Manual - Previous: Fine Tuning (Translations) -
    + Previous: Low Level MIDI Commands
    +
    Subsections +

    - +
    -Other Commands and Directives +Patch Management

    -In addition to the ``Pattern'', ``Sequence'', ``Groove'' and -``Repeat'' and other directives discussed earlier, and chord data, - -MMA supports a number of directives which affect the flavor of your -music. - -

    -The subjects presented in this chapter are ordered alphabetically. - -

    - -

    -
    -AllTracks -

    - -

    -Sometimes you want to apply the same command to all the currently -defined tracks; for example, you might want to ensure that no -tracks have SEQRND set. Yes, you could go though each track -(and hope you don't miss any) and explicitly issue the command: - -

    - - - -
    - Bass SeqRnd Off - .... -
    -Chord SeqRnd Off
    - -
    - -

    -But, - -

    - - - -
    - AllTracks SeqRnd Off - -
    - -

    -is much simpler. Similarly, you can set the articulation for all -tracks with: - -

    - - - -
    - AllTracks Articulate 80 - -
    - -

    -You can even combine this with a BEGIN/END like: - -

    - - - -
    - Begin AllTracks -
      Articulate 80 -
      SeqRnd Off -
      Rskip 0 -
    -End
    - -
    - -

    -This command is handy when you are changing an existing GROOVE. - -

    -Note that only currently defined tracks are effected by this command. - -

    -A further option is to limit ALLTRACKS to specific tracks -type. For example, you might want to set all the DRUM track -volumes to ``FF'': - -

    - - - -
    - AllTracks Drum Volume ff - -
    - -

    -Or to set the articulation on BASS and WALK tracks: - -

    - - - -
    - AllTracks Bass Walk Articulate 55 - -
    - -

    -It is assumed that all the arguments following the initial command -which are valid track types (Bass, Chord, Arpeggio, Scale, Drum, Walk, -Melody, or Solo) are track type limiters. - -

    - -

    -
    -Articulate -

    - -

    -When -MMA processes a music file, all the note lengths specified in a -pattern are converted to MIDI lengths. - -

    -For example in: - -

    - - - -
    - Bass Define BB 1 4 1 100; 2 4 5 90; 3 4 1 80; 4 4 5 90 - -
    - -

    -bass notes on beats 1, 2, 3 and 4 are define. All are quarter notes. - -MMA , being quite literal about things, will make each note exactly -192 MIDI ticks long--which means that the note on beat 2 will start -at the same time as the note on beat 1 ends. - -

    - -MMA has an articulate setting for each voice. This value is applied -to shorten or lengthen the note length. By default, the setting is 90. -Each generated note duration is taken to be a percentage of this -setting, So, a quarter note with a MIDI tick duration of 192 will -become 172 ticks long. - -

    -If articulate is applied to a short note, you are guaranteed that the -note will never be less than 1 MIDI tick in length. - -

    -To set the value, use a line like: - -

    - - - -
    - Chord-1 Articulate 96 - -
    - -

    -Articulate values must be greater than 0 and less than or -equal to 200. Values over 100 will lengthen the note. Settings -greater than 120 will generate a warning. - -

    -You can specify a different ARTICULATE for each bar in a -sequence. Repeated values can be represented with a ``/'': - -

    - - - -
    - Chord Articulate 50 60 / 30 - -
    - -

    -Notes: The full values for the notes are saved with the -pattern definition. The articulation adjustment is applied at -run time. The ARTICULATE setting is saved with a -GROOVE. - -

    - -

    -
    -Copy -

    - -

    -Sometimes it is useful to duplicate the settings from one voice to -another. The COPY command does just that: - -

    - - - -
    - Bass-1 Copy Bass - -
    - -

    -will copy the settings from the Bass track to the Bass-1 track. - -

    -The COPY command only works between tracks of the same type. - -

    -The following settings are copied: - -

    - -

    - -

    -Warning: You are probably better off to use internal macros for -this. - -

    - -

    -
    -Comment -

    - -

    -As previously discussed, a comment in -MMA is anything following a -``//'' in a line. A second way of marking a comment is with the -COMMENT directive. This is quite useful in combination the -BEGIN and END directives. For example: - -

    - - - -
    - Begin Comment -
        This is a description spanning -
            several lines which will be -
            ignored by MMA. -
    -End
    - -
    - -

    -You could achieve the same with: - -

    - - - -
    - // This is a description spanning -
    // several lines which will be -
    // ignored by MMA.
    - -
    - -

    -or even: - -

    - - - -
    - Comment This is a description spanning -
    -Comment several lines which will be -
    -Comment ignored by MMA.
    - -
    - -

    -One minor difference between // and -COMMENT is that the first is discarded when the -input stream is read; the more verbose version is -discarded during line processing. - -

    -Quite often it is handy to delete large sections of a song with a -BEGIN COMMENT/END on a temporary basis. - -

    - -

    -
    -Debug -

    - -

    -To enable you to find problems in your song files (and, perhaps, even -find problems with -MMA itself) various debugging messages can be -displayed. These are normally set from the command line -command line. - -

    -However, it is possible to enable various debugging messages -dynamically in a song file using the DEBUG directive. In a -debug statement you can enable or disable any of a variety of -messages. A typical directive is: - -

    - - - -
    - Debug Debug=On Expand=Off Patterns=On - -
    - -

    -Each section of the debug directive consists of a mode -and the command word ON or OFF. The two parts -must be joined by a single ``$=$''. You may use the -values ``0'' for ``Off'' and ``1'' for ``On'' if desired. - -

    -The available modes with the equivalent command line switches are: - -

    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ModeCommand Line Equivalent
    Debug-ddebugging messages
    Filenames-odisplay filenames
    Patterns-ppattern creation
    Sequence-ssequence creation
    Runtime-rrunning progress
    Warnings-wwarning messages
    Expand-edisplay expanded lines
    -
    - -

    -The modes and command are case-insensitive (although the command line switches are not). - -

    -The current state of the debug flags is saved in the variable -$_Debug and the state prior to a change is saved in $_LastDebug. - -

    - -

    -
    -Delete -

    - -

    -If you are using a track in only one part of your song, especially if -it is at the start, it may be wise to free that track's resources when -you are done with it. The DELETE command does just that: - -

    - - - -
    - Solo Delete - -
    - -

    -If a MIDI channel has been assigned to that track, it is -marked as ``available'' and the track is deleted. Any data -already saved in the MIDI track will be written when -MMA is -finished processing the song file. - -

    - -

    -
    -Direction -

    - -

    -In tracks using chords or scales you can change the direction in which -they are applied: - -

    - - - -
    - Scale Direction UP - -
    - -

    -The effects differ in different track types. For SCALE and ARPEGGIO tracks: - -

    -

    - - - - - - - - - - - - - -
    UPPlays in upward direction only
    DOWNPlays in downward direction only
    BOTHPlays upward and downward (default)
    RANDOMPlays notes from the chord or scale randomly
    -
    -

    -

    When this command is encountered in a SCALE track the start -point of the scale is reset. -
    -

    - -

    -A WALK track recognizes the following option settings: - -

    -

    - - - - - - - - - - - - - -
    BOTHThe default. The bass pattern - will go up and down a partial scale. Some notes may be repeated.
    UPNotes will be chosen sequentially from an ascending, partial scale.
    DOWNNotes will be chosen sequentially from a descending, partial scale.
    RANDOMNotes will be chosen in a random direction from a partial scale.
    -
    -

    -

    All four patterns are useful and create quite different effects. - -
    - -

    -The CHORD tracks DIRECTION only has an effect when the -STRUM setting has a non-zero value. In this case the following -applies: - -

    -

    - - - - - - - - - - - - - -
    UPThe default. Notes are sounded from the lowest tone to the highest.
    DOWNNotes are sounded from the highest to the lowest.
    BOTHThe UP and DOWN values are alternated.
    RANDOMIgnored (uses UP).
    -
    - -

    -You can specify a different DIRECTION for each bar in a -sequence. Repeated values can be represented with a ``/'': - -

    - - - -
    - Arpeggio Direction Up Down / Both - -
    - -

    -The setting is ignored by BASS, DRUM and SOLO tracks. - -

    - -

    -Mallet -

    - -

    -Some instruments (Steel-drums, banjos, marimbas, etc.) are normally -played with rapidly repeating notes. Instead of painfully inserting -long lists of these notes, you can use the MALLET directive. -The MALLET directive accepts a number of options, each an -OPTION=VALUE pair. For example: - -

    - - - -
    - Solo-Marimba Mallet Rate=16 Decay=-5 - -
    - -

    -This command is also useful in creating drum rolls. For example: - -

    - - - -
    - Begin Drum-Snare2 -
      Tone SnareDrum1 -
      Volume F -
      Mallet Rate=32 Decay=-3 -
      Rvolume 3 -
      Sequence z z z 1 1 100 -
    -End
    - -
    - -

    -The following options are supported: - -

    - -

    -Rate -

    - -

    -The RATE must be a valid note length (i.e., 8, 16, or even -16.+8). - -

    -For example: - -

    - - - -
    - Solo-Marimba Mallet Rate=16 - -
    - -

    -will set all the notes in the ``Solo-Marimba'' track to be sounded a -series of 16th notes. - -

    - -

      -
    • Note duration modifiers such as articulate are applied to each - resultant note, - -

      -

    • -
    • It is guaranteed that the note will sound at least once, - -

      -

    • -
    • The use of note lengths assures a consistent sound independent - of the song tempo. - -

      -

    • -
    - -

    -To disable this setting use a value of ``0''. - -

    - -

    -Decay -

    - -

    -You can adjust the volume (velocity) of the notes being repeated when -MALLET is enabled: - -

    - - - -
    - Drum-Snare Mallet Decay=-15 - -
    - -

    -The argument is a percentage of the current value to add to the note -each time it is struck. In this example, assuming that the note length -calls for 4 ``strikes'' and the initial velocity is 100, the note will -be struck with a velocity of 100, 85, 73 and 63. - -

    -Important: a positive value will cause the notes to get louder, -negative values cause the notes to get softer. - -

    -Note velocities will never go below 1 or above 255. Note, however, -that notes with a velocity of 1 will most likely be inaudible. - -

    -The decay option value must be in the range -50 to 50; however, be -cautious using any values outside the range -5 to 5 since the volume -(velocity) of the notes will change quite quickly. The default -value is 0 (no decay). - -

    - -

    -
    -Octave -

    - -

    -When -MMA initializes and after the SEQCLEAR command all track -octaves are set to ``4''. This will place most chord and bass notes in -the region of middle C. - -

    -You can change the octave for any voice with OCTAVE command. For example: - -

    - - - -
    - Bass-1 Octave 3 - -
    - -

    -Sets the notes used in the ``Bass-1'' track one octave lower than normal. - -

    -The octave specification can be any value from 0 to 10. Various -combinations of INVERT, TRANSPOSE and OCTAVE can -force notes to be out of the valid MIDI range. In this case the lowest -or highest available note will be used. - -

    -You can specify a different OCTAVE for each bar in a sequence. -Repeated values can be represented with a ``/'': - -

    - - - -
    - Chord Octave 4 5 / 4 - -
    - -

    - -

    -
    -Off -

    - -

    -To disable the generation of MIDI output on a specific track: - -

    - - - -
    - Bass Off - -
    - -

    -This can be used anywhere in a file. Use it to override the effect of -a predefined groove, if you wish. This is simpler than resetting a -voice in a groove. The only way to reset this command is with a -ON directive. - -

    - -

    -
    -On -

    - -

    -To enable the generation of MIDI output on a specific track which has -been disabled with an OFF directive: - -

    - - - -
    - Bass On - -
    - -

    - -

    -Print -

    - -

    -The PRINT directive will display its argument to the screen -when it is encountered. For example, if you want to print the filename -of the input file while processing, you could insert: - -

    - - - -
    - Print Making beautiful music for MY SONG - -
    - -

    -No control characters are supported. - -

    -This can be useful in debugging input files. - -

    - -

    -PrintActive -

    - -

    -The PRINTACTIVE directive will the currently active -GROOVE and the active tracks. This can be quite useful when -writing groove files and you want to modify and existing groove. - -

    -Any parameters given are printed as single comment at the end of the header line. - -

    -This is strictly a debugging tool. No PRINTACTIVE statements -should appear in finalized grooves or song files. - -

    - -

    -RndSeed -

    - -

    -All of the random functions (RTIME, RSKIP, etc.) in -MMA depend -on the Python random module. Each time -MMA generates a track the values generated -by the random functions will be different. In most cases this is a ``good thing''; however, -you may want -MMA to use the same sequence of random values21.1 each time it generates a track. Simple: just use: - -

    - - - -
    - RndSeed 123.56 - -
    - -

    -at the top of your song file. You can use any value you want: it really doesn't -make any difference, but different values will generate different sequences. - -

    -You can also use this with no value, in which case Python uses its own value (see -the Python manual for details). Essentially, using no value undoes the effect which -permits the mixing of random and not-so-random sections in the same song. - -

    -One interesting use of RNDSEED could be to ensure that a repeated section -is identical: simply start the section with something like: - -

    - - - -
    - Repeat -
    -RndSeed 8 -
    ... chords
    - -
    - -

    -It is highly recommended that you do not use this command in library files. - -

    - -

    -
    -RSkip -

    - -

    -To aid in creating syncopated sounding patterns, you can use the -RSKIP directive to randomly silence or skip notes. The command -takes a value in the range 0 to 99. The ``0'' argument disables -skipping. For example: - -

    - - - -
    - Begin Drum -
        Define D1 1 0 90 -
        Define D8 D1 * 8 -
        Sequence D8 -
        Tone OpenHiHat -
        RSkip 40 -
    -End
    - -
    - -

    -In this case a drum pattern has been defined to hit short ``OpenHiHat'' -notes 8 per bar. The RSKIP argument of ``40'' causes the -note to be NOT sounded (randomly) only 40% of the time. - -

    -Using a value of ``10'' will cause notes to be skipped 10% of the -time (they are played 90% of the time), ``90'' means to skip the -notes 90% of the time, etc. - -

    -You can specify a different RSKIP for each bar in a sequence. -Repeated values can be represented with a ``/'': - -

    - - - -
    - Scale RSkip 40 90 / 40 - -
    - -

    -If you use the RSKIP in a chord track, the entire chord -will not be silenced. The option will be applied to the -individual notes of each chord. This may or may not be what you are -after. You cannot use this option to generate entire chords randomly. -For this effect you need to create several chord patterns and select -them with SEQRND. - -

    - -

    -
    -RTime -

    - -

    -One of the biggest problem with computer generated drum and rhythm -tracks is that, unlike real musicians, the beats are precise and ``on -the beat''. The RTIME directive attempts to solve this. - -

    -The command can be applied to all tracks. - -

    - - - -
    - Drum-4 Rtime 4 - -
    - -

    -The value passed to the RTime directive are the number of MIDI ticks -with which to vary the start time of the notes. For example, if you -specify ``5'' the start times will vary from -5 to +5 ticks) on each -note for the specified track. There are 192 MIDI ticks in each quarter -note. - -

    -Any value from 0 to 100 can be used; however values in the range 0 to -10 are most commonly used. Exercise caution in using large values! - -

    -You can specify a different RTIME for each bar in a sequence. -Repeated values can be represented with a ``/'': - -

    - - - -
    - Chord RTime 4 10 / 4 - -
    - -

    -RTIME is guaranteed never to start a note before the start of a bar. - -

    - -

    -
    -ScaleType -

    - -

    -This option is only used by SCALE tracks. It can be set for -other tracks, but the setting is not used. - -

    -By default, the SCALETYPE is set to AUTO. The settings -permissible are: - -

    -

    - - - - - - - -
    CHROMATICForces use of a chromatic scale
    AUTOUses scale based on the current chord (default)
    -
    - -

    -When this command is encountered in a SCALE track the start -point of the scale is reset. - -

    - -

    - -
    -Seq -

    - -

    -If your sequence, or groove, has more than one pattern (i.e., you have -set SeqSize to a value other than 1), you can use this directive to -force a particular pattern point to be used. The directive: - -

    - - - -
    - Seq - -
    - -

    -resets the sequence counter to 1. This means that the next bar -will use the first pattern in the current sequence. You can force a -specific pattern point by using an optional value after the directive. -For example: - -

    - - - -
    - Seq 8 - -
    - -

    -forces the use of pattern point 8 for the next bar. This can be quite -useful if you have a multi-bar sequence and, perhaps, the eight bar is -variation which you want used every eight bars, but also for a -transition bar, or the final bar. Just put a SEQ 8 at those -points. You might also want to put a SEQ at the start of -sections to force the restart of the count. - -

    -If you have enable sequence randomization with the SEQRND ON -command, the randomization will be disabled by a SEQ -command.21.2 However, -settings of track SEQRND will not be effected. One difference -between SEQRND OFF and SEQ is that the current sequence -point is set with the latter; with SEQRND OFF it is left at a -random point. - -

    -Note: Using a value greater than the current SEQSIZE is not -permitted. - -

    -This is a very useful command! For example, look at the four bar -introduction of the song ``Exactly Like You'': - -

    - - - -
    - Groove BossanovaEnd -
    -seq 3 -
    -1 C -
    -seq 2 -
    -2 Am7 -
    -seq 1 -
    -3 Dm7 -
    -seq 3 -
    -4 G7 / G7#5
    - -
    - -

    -In this example the four bar ``ending groove'' has been used to create -an interesting introduction. - -

    - -

    -
    -Strum -

    - -

    -By default -MMA plays all the notes in a chord at the same time. To -make the chord more like something a guitar or banjo might play, use -the STRUM directive. For example: - -

    - - - -
    - Chord-1 Strum 5 - -
    - -

    -sets the strumming factor to 5 for track Chord-1. - -

    -Setting the STRUM in any track other than a CHORD track -will generate a warning message and the command will be ignored. - -

    -The strum factor is specified in MIDI ticks. Usually values around 10 -to 15 work just fine. The valid range for STRUM is 0 to 100. - -

    -You can specify a different STRUM for each bar in a sequence. -Repeated values can be represented with a ``/'': - -

    - - - -
    - Chord Strum 20 5 / 10 - -
    - -

    -Note: When chords have both a STRUM and INVERT applied, -the order of the notes played will not necessarily be root, third, -etc. The notes are sorted into ascending order, so for a C major scale -with and INVERT of 1 the notes played would be ``E G C''. That -is, unless the DIRECTION has been set to ``DOWN'' in which case -the order would be reversed (but the notes would be the same). - -

    - -

    -Transpose -

    - -

    -You can change the key of a piece with the ``Transpose'' command. For -example, if you have a piece notated in the key of ``C'' and you want -it played back in the key of ``D'': - -

    - - - -
    - Transpose 2 - -
    - -

    -will raise the playback by 2 semi-tones. Since -MMA 's author plays tenor saxophone - -

    - - - -
    - Transpose -2 - -
    - -

    -which puts the MIDI keyboard into the same key as the horn, is not an -uncommon directive - -

    -You can use any value between -12 and 12. All tracks (with the logical -exception of the drum tracks) are effected by this command. - -

    - -

    -Unify -

    - -

    -The UNIFY command is used to force multiple notes of the same -voice and pitch to be combined into a single, long, tone. This is very -useful when creating a sustained voice track. For example, consider -the following which might be used in real groove file: - -

    - - - -
    - Begin Bass-Sus -
    -Sequence 1 1 1 90 4 -
    -Articulate 100 -
    -Unify On -
    -Voice TremoloStrings -
    -End
    - -
    - -

    -Without the UNIFY ON command the strings would be sounded (or -hit) four times during each bar; with it enabled the four hits are -combined into one long tone. This tone can span several bars if the -note(s) remain the same. - -

    -The use of this command depends on a number of items: - -

    - -

      -
    • The VOICE being used. It makes sense to use enable the - setting if using a sustained tone like ``Strings"; it probably - doesn't make sense if using a tone like ``Piano1''. - -

      -

    • -
    • For tones to be combined you will need to have ARTICULATE - set to a value of 100. Otherwise the on/off events will have small - gaps in them which will cancel the effects of UNIFY. - -

      -

    • -
    • Ensure that RTIME is not set for UNIFY tracks - since the start times may cause gaps. - -

      -

    • -
    • If your pattern or sequence has different volumes in different - beats (or bars) the effect of a UNIFY will be to ignore - volumes other than the first. Only the first NOTE ON and the - last NOTE OFF events will appear in the MIDI file. - -

      -

    • -
    - -

    -You can specify a different UNIFY for each bar in a sequence. -Repeated values can be represented with a ``/'': - -

    - - - -
    - Chord Unify On / / Off - -
    - -

    -But, you probably don't want to use this particular feature. - -

    -Valid arguments are ``On'' or ``1'' to enable; ``Off'' or ``0'' to -disable. - -

    - -

    +Modern music keyboards and synthesizers are capable of producing a +bewildering variety of sounds. Many consumer units priced well under +$1000.00 contain several hundred or more unique voices. But, ``out of +the box'' +MMA supports only 128 ``General MIDI''21.1 preset voices. These voices are assigned the values 0 +to 127. We refer to the various voices as ``tones'', ``instruments'', +or ``patches''.21.2 +

    + +


    Voice

    @@ -1421,15 +104,16 @@ The MIDI instrument or voice used for a track is set with:

    Voices apply only to the specified track. The actual instrument can be -specified via the MIDI instrument number, or with the symbolic name. -See the tables in the MIDI voicing section for lists of the recognized +specified via the MIDI instrument number, an ``extended'' value, or +with the symbolic name. See the tables in the MIDI +voicing section for lists of the standard, recognized names.

    You can create interesting effects by varying the voice used with drum tracks. By default ``Voice 0'' is used. However, you can change the -drum voices. The supplied library files do not change the voices since this -appears to be highly dependent on the MIDI synth you are using. +drum voices. The supplied library files do not change the voices since +this is highly dependent on the MIDI synth you are using.

    You can specify a different VOICE for each bar in a sequence. @@ -1446,45 +130,502 @@ Repeated values can be represented with a ``/'':

    It is possible to set up translations for the selected voice: see -VOICETR. +VOICETR. + +

    + +

    +Patch +

    + +

    +In addition to the 128 standard voices mandated by the MIDI standards +(referred to as the GM voices) +MMA also supports extended voice +banks. + +

    +

    + + + +
    +
    +
    The rest of this + chapter presents features which are highly dependent your hardware. + It is quite possible to create midi files which sound very + different (or even awful, or perhaps not at all) on other + hardware. We recommend that you do not use these + features to create files you want to share! + +
    + +
    + +

    +A typical keyboard will assign instruments to different voice +banks. The first, default, bank will contain the standard set of 128 +GM instruments. However, you can select different banks, each with a +variety of voices, by changing the current voice bank. This switching +is done by changing the value of MIDI Controller 0, 32 or both. You'll +need to read the manual for your hardware to figure this out. + +

    +In order to use voices outside of the normal GM range +MMA uses an +extended addressing mode which includes values for the patch and +controllers 0 and 32. Each value is separated from the others with a +single ``.''. Two examples would include 22.33.44 and 22.33. The first +value is the Patch Number, the second is a value for Controller 0. The +third value, if present, is the setting for Controller 32. + +

    +My Casio Wk-3000 lists Bank-53, Program-27 as "Rotary Guitar". It's easy to use +this voice directly in a VOICE command: + +

    + + + +
    + Chord Voice 27.53 + +
    + +

    +Yes, but who wants all those ``funny'' numbers in their +MMA files? +Well, no one that I know. For this reason the PATCH command has +been developed. This command lets you modify existing patch names, +list names and create new ones. + +

    +PATCH takes a variety of options. We suggest you read this +section and examine some of the included example files before +venturing out on your own. But, really, it's not that complicated. + +

    +Unless otherwise noted, you can stack a number of different options +onto the same PATCH line. + +

    + +

    +Patch Set +

    + +

    +The SET option is used to assign one or more patch values to +symbolic names. Going back to my Casio example, above, I could use the +following line to register the voice with +MMA +

    + + + +
    + Patch Set 27.53=RotaryGuitar + +
    + +

    +The assignment consists of two parts or keys joined by a ``='' +sign. No spaces are permitted. The left part of the assignment is a +value. It can be a single number in the range 0 to 127; or 2 or 3 numbers +joined by ``.''s. The right right part is a symbolic name. Any characters +are permitted (but no spaces!). + +

    +After the assignment you can use ``RotaryGuitar'' just like any other +instrument name: + +

    + + + +
    + Chord Voice rotaryguitar + +
    + +

    +Note that once the voice has been registered you don't need to worry +about the case of individual letters. + +

    +It's even possible to register a number of voices in this manner: + +

    + + + +
    + Patch set 27.53=RotaryGuitar 61.65=BASS+TROMBONE + +
    + +

    +Just make sure that the SET assignments are the last thing on +the PATCH line. + +

    +It is relatively easy to load entire sets of extended patch names by +creating special +MMA include files. For example, for a Casio +WK-3000 keyboard you might have the file includes/casio-wk3.mma +with a large number of settings. Here's a snippet: + +

    + + + +
    + Begin Patch Set +
    +0.48=GrandPiano +
    +1.48=BrightPiano +
    +2.48=ElecGrandPiano +
    +3.48=Honky-Tonk1 +
    ... +
    +End
    + +
    + +

    +Now, at the top of your song file or in a MMARC file insert the +command: + +

    + + + +
    + include casio-wk30021.3 + +
    + +

    +A file like this can be created by hand or you can convert existing an +existing file to a format understands. A number of ``patch'' +files exist for the popular ``Band in a Box'' program from +PGMusic. There files may be subject to copyright, so use them with +respect. No patch files are included in this distribution, but many +are freely available on the internet. For a start you might want to +look at http://www.pgmusic.com/support_miscellaneous.htm. These +files cannot be read my +MMA , so we have included a +little conversion utility util/pg2mma.py. There is a short +file with instructions util/README.pg2mma. + +

    +The SET option will issue warning messages if you redefine +existing instrument names or addresses. We suggest that you edit any +configuration files so that they have unique names and that you do not +rename any of the standard GM names. + +

    + +

    +Patch Rename +

    + +

    +The naming of patches is actually quite arbitrary. You'll find that +different manufacturers use different names to refer to the same +voices. Most of the time this isn't a major concern, but you have the +freedom in +MMA to change any patch name you want. For example, +MMA calls the first voice in the GM set ``Piano1''. Maybe you want to use +the name ``AcousticGrand''. Easy: + +

    + + + +
    + Patch Rename Piano1=AcousticGrand + +
    + +

    +Each RENAME option has a left and right part joined by an ``='' +sign. The left part is the current name; the right is the new +name. Please note that after this command the name ``Piano1'' will not +be available. + +

    +You can have any number of items in a list; however, they must be the +last items on the PATCH line. + +

    + +

    +Patch List +

    + +

    +After making changes to +MMA 's internal tables you might want to +check to make sure that what you meant is what you got. For this +reason there are three different versions of the LIST +command. + +

    +

    +
    List=GM
    +
    Lists the current values of the GM voices, +
    +
    List=EXT
    +
    Lists the extended voices, +
    +
    List=All
    +
    Lists both the GM and extended voices. +
    +
    + +

    +For example, the command: + +

    + + + +
    + Patch List=EXT + +
    + +

    +will produce a listing something like: + +

    + + + +
    + 0.48=GrandPiano +
    +1.48=BrightPiano +
    +2.48=ELEC.GrandPiano +
    ...
    + +
    + +

    + +

    +Ensuring It All Works +

    + +

    +If you are going to use any of the extended patches in your MIDI files +you may need to do some additional work. + +

    +Your hardware may need to be in a ``special'' mode for any of the +extended patches to take effect. What we suggest is that you use the +MIDI command (details here) to do some initialization. For an example please +look at the file includes/init.mma which we include in our +personal files. This file sets the volume, pan and controller values +to known settings. It's easy to modify this file to match your +hardware setup. + +

    +To use a file like includes/init.mma just include a line like: + +

    + + + +
    + include init + +
    + +

    +in your mmarc file. See the Path section of this manual for details +(here). + +

    +To help keep things sane, +MMA checks each track as it is closed. If +an extended voice has been used in that track it resets the effected +controllers to a zero state. In most cases this means that if you +finish playing the file your keyboard will be returned to a +``default'' state. + +

    +However, you might wish to generate some explicit MIDI sequences at the +end of a generated file. Just write another file like the +init.mma file we discussed above. You can insert this file by +placing a line like: + +

    + + + +
    + include endinit + +
    + +

    +at the end of your song file. Or, use the MMAEND command +detailed here. + +

    +You can get about as complicated as you want with all this. One scheme +you might consider is to use macros to wrap your extended patch +code. For example: + +

    + + + +
    + if def Casio +
    +include casio-wk3000 +
    +include init.file.for.casio.mma +
    +endif +
    +
    +Groove somegroove +
    +
    +if def Casio +
    +Chord Voice ROtaryGuitar +
    +Endif +
    +
    +1 Cm +
    +2 Dm +
    ...more chords +
    +if def Casio +
    +include restore-file-for-casio.mma +
    +endif
    + +
    + +

    +Now, when you compile the file define the macro on the command line: + +

    + + + +
    + $ mma -SCASIO filename + +
    + +

    +This defines the macro so that your wrappers work. To compile for the +GM voicing, just skip the ``-SCASIO''. + +

    +An alternate method is to use the VOICETR command +(details here). Using a similar example we'd create a song +file like: + +

    + + + +
    + if def Casio +
    +include casio-wk3000 +
    +include init.file.for.casio.mma +
    +VoiceTR Piano1=RotaryGuitar ChoralAhhs=VoxHumana +
    +endif +
    +Groove somegroove +
    +
    +1 Cm +
    +2 Dm +
    ...more chords +
    +if def Casio +
    +include restore-file-for-casio.mma +
    +endif
    + +
    + +

    +Notice how, in this example, we don't need to wrap each and every +VOICE line. We just create a translation table with the +alternate voices we want to use. Now, when the GROOVE is loaded +the various voices will be changed.



    Footnotes

    -
    ... values21.1
    -
    Yes, this is -a contradiction of terms. +
    ... MIDI''21.1
    +
    The + General MIDI or GM standard was developed by the MIDI Manufactures + Association.
    -
    ... -command.21.2
    -
    A warning message will also be displayed. +
    ... ``patches''.21.2
    +
    ``Patch'' a bit of a historical term dating + back to the times when synthesizers cost a lot of money and used + bits of wire and cable to ``patch'' different oscillators, filters, + etc. together.
    -

    +
    ... casio-wk30021.3
    +
    Refer to INCLUDE (here) for details on file placement. + +
    + +
    bob -2007-03-07 +2008-09-28
    diff --git a/mma/docs/html/ref/node22.html b/mma/docs/html/ref/node22.html index b3ba144..0ce7043 100644 --- a/mma/docs/html/ref/node22.html +++ b/mma/docs/html/ref/node22.html @@ -1,4 +1,4 @@ - + -Begin/End Blocks - +Fine Tuning (Translations) + @@ -25,89 +25,400 @@ original version by: Nikos Drakos, CBLU, University of Leeds - - + next - up - previous
    - Next: Documentation Strings - Up: Next: Other Commands and Directives + Up: Reference Manual - Previous: Other Commands and Directives -
    + Previous: Patch Management
    +
    Subsections -