- Timestamp:
- 12/19/07 03:00:18 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MML.as
r2293 r3299 10 10 protected var m_trackNo:int; 11 11 protected var m_octave:int; 12 protected var m_velocity:int; // default velocity 13 protected var m_length:int; // default length 12 protected var m_relativeDir:Boolean; // 13 protected var m_velocity:int; // default velocity 14 protected var m_length:int; // default length 14 15 protected var m_tempo:int; 15 16 protected var m_letter:int; … … 138 139 break; 139 140 case 'l': // Low frequency oscillator (LFO) 140 next(); 141 o = getUInt(o); 142 if (getChar() == ',') next(); 143 a = getUInt(a); 144 if (getChar() == ',') next(); 145 d = getUInt(d); 146 if (getChar() == ',') next(); 147 s = getUInt(s); 148 if (getChar() == ',') next(); 149 r = getUInt(r); 150 //trace("FR"+a+",DP"+d+",DL"+s+",TM"+r); 151 m_tracks[m_trackNo].recLFO(a, d, s, r); 141 { 142 var dp:int = 0, wd:int = 0, fm:int = 1, rv:int = 1, dl:int = 0, tm:int = 0, cn:int = 0; 143 next(); 144 dp = getUInt(dp); 145 if (getChar() == ',') next(); 146 wd = getUInt(wd); 147 if (getChar() == ',') { 148 next(); 149 if (getChar() == '-') { rv = -1; next(); } 150 fm = (getUInt(fm) + 1) * rv; 151 if (getChar() == ',') { 152 next(); 153 dl = getUInt(dl); 154 if (getChar() == ',') { 155 next(); 156 tm = getUInt(tm); 157 } 158 } 159 } 160 //trace("DePth"+dp+",WiDth"+wd+",ForM"+fm+",DeLay"+dl+",TiMe"+tm); 161 m_tracks[m_trackNo].recLFO(dp, wd, fm, dl, tm); 162 } 152 163 break; 153 164 default: … … 194 205 break; 195 206 case "<" : 196 m_octave++;207 if (m_relativeDir) m_octave++; else m_octave--; 197 208 break; 198 209 case ">": 199 m_octave--;210 if (m_relativeDir) m_octave--; else m_octave++; 200 211 break; 201 212 case ';': … … 403 414 var valArr:Array = new Array(); 404 415 var i:int; 416 var last:int; 405 417 // [a-zA-Z][a-zA-Z0-9#\+\(\)_]* 406 418 // ex.) $Am =/:4a<ce>a:/; … … 415 427 // macro definition? 416 428 if (top) { 417 var last:int = m_string.indexOf(";", m_letter);429 last = m_string.indexOf(";", m_letter); 418 430 if (last > m_letter) { 419 431 var macro:String = m_string.substring(m_letter, last); … … 457 469 replaceMacro(idArr, valArr); 458 470 } 471 top = 0; 459 472 break; 460 473 case ';': … … 465 478 break; 466 479 } 480 } 481 // 482 var exp:RegExp = /[\n\r\f]*#OCTAVE\s+REVERSE\s*[\n\r\f]/; 483 if (m_string.match(exp)) { 484 m_string = m_string.replace(exp, ""); 485 m_relativeDir = false; 467 486 } 468 487 } … … 519 538 m_trackNo = MTrack.FIRST_TRACK; 520 539 m_octave = 4; 540 m_relativeDir = true; 521 541 m_velocity = 100; 522 542 m_length = 4;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)