- Timestamp:
- 10/26/07 02:12:19 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MML.as
r655 r718 66 66 var o:int = 1, a:int = 0, d:int = 64, s:int = 32, r:int = 0; 67 67 switch(c) { 68 case 'e': 68 case 'v': // Volume 69 m_letter++; 70 m_velocity = getUInt(m_velocity); 71 if (m_velocity > 127) m_velocity = 127; 72 break; 73 case 'e': // Envelope 69 74 m_letter++; 70 75 o = getUInt(o); … … 80 85 m_tracks[m_trackNo].recEnvelope(a, d, s, r); 81 86 break; 82 case 'n': 87 case 'n': // Noise frequency 83 88 m_letter++; 84 89 o = getUInt(0); … … 86 91 m_tracks[m_trackNo].recNoiseFreq(o); 87 92 break; 88 case 'w': 93 case 'w': // pulse Width modulation 89 94 m_letter++; 90 95 o = getUInt(50); … … 92 97 if (o > 99) o = 99; 93 98 m_tracks[m_trackNo].recPWM(o); 99 break; 100 case '\'': // formant filter 101 m_letter++; 102 o = m_string.indexOf('\'', m_letter); 103 if (o >= 0) { 104 var vstr:String = m_string.substring(m_letter, o); 105 var vowel:int = 0; 106 switch(vstr) { 107 case 'a': vowel = MFormant.VOWEL_A; break; 108 case 'e': vowel = MFormant.VOWEL_E; break; 109 case 'i': vowel = MFormant.VOWEL_I; break; 110 case 'o': vowel = MFormant.VOWEL_O; break; 111 case 'u': vowel = MFormant.VOWEL_U; break; 112 default: vowel = -1; break; 113 } 114 m_tracks[m_trackNo].recFormant(vowel); 115 m_letter = o + 1; 116 } 94 117 break; 95 118 default: … … 118 141 break; 119 142 case "v": 120 m_velocity = getUInt(m_velocity) * 8 + 7; 143 m_velocity = getUInt((m_velocity-7)/8) * 8 + 7; 144 if (m_velocity < 0) m_velocity = 0; 121 145 if (m_velocity > 127) m_velocity = 127; 122 146 break; … … 209 233 210 234 public function createTrack():MTrack { 235 m_octave = 4; 236 m_velocity = 100; 211 237 return new MTrack(); 212 238 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)