Changeset 32952 for lang/actionscript
- Timestamp:
- 04/30/09 00:46:36 (3 years ago)
- Location:
- lang/actionscript/flmml/trunk/src
- Files:
-
- 6 modified
-
com/txt_nifty/sketch/flmml/MChannel.as (modified) (10 diffs)
-
com/txt_nifty/sketch/flmml/MEvent.as (modified) (2 diffs)
-
com/txt_nifty/sketch/flmml/MML.as (modified) (1 diff)
-
com/txt_nifty/sketch/flmml/MStatus.as (modified) (1 diff)
-
com/txt_nifty/sketch/flmml/MTrack.as (modified) (2 diffs)
-
flmml.swf (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MChannel.as
r30714 r32952 8 8 private var m_envelope1:MEnvelope; // for VCO 9 9 private var m_envelope2:MEnvelope; // for VCF 10 private var m_oscSet1:MOscillator; // for original wave10 private var m_oscSet1:MOscillator; // for original wave 11 11 private var m_oscMod1:MOscMod; 12 private var m_oscSet2:MOscillator; // for Pitch LFO12 private var m_oscSet2:MOscillator; // for Pitch LFO 13 13 private var m_oscMod2:MOscMod; 14 14 private var m_osc2Connect:int; … … 17 17 private var m_filterConnect:int; 18 18 private var m_formant:MFormant; 19 private var m_velocity:Number; // velocity (max:1.0) 19 private var m_expression:Number; // expression (max:1.0) 20 private var m_velocity:Number; // velocity (max:1.0) 21 private var m_ampLevel:Number; // amplifier level (max:1.0) 20 22 private var m_panL:Number; 21 23 private var m_panR:Number; … … 58 60 m_filterConnect = 0; 59 61 m_formant = new MFormant(); 60 m_velocity = 100.0 / 127.0; 62 m_volMode = 0; 63 setExpression(127); 64 setVelocity(100); 61 65 setPan(64); 62 66 m_onCounter = 0; … … 67 71 m_lpfFrq = 0; 68 72 m_lpfRes = 0; 69 m_volMode = 0;70 73 setInput(0, 0); 71 74 setOutput(0, 0); … … 101 104 freqNo = (freqNo < 0) ? 0 : (freqNo >= s_frequencyLen) ? s_frequencyLen-1 : freqNo; 102 105 return s_frequencyMap[freqNo]; 106 } 107 public function setExpression(ex:int):void { 108 m_expression = (m_volMode) ? s_volumeMap[ex] : ex / 127.0; 109 m_ampLevel = m_velocity * m_expression; 110 } 111 public function setVelocity(velocity:int):void { 112 m_velocity = (m_volMode) ? s_volumeMap[velocity] : velocity / 127.0; 113 m_ampLevel = m_velocity * m_expression; 103 114 } 104 115 public function setNoteNo(noteNo:int):void { … … 119 130 m_oscMod2.resetPhase(); 120 131 m_filter.reset(); 121 m_velocity = (m_volMode) ? s_volumeMap[velocity] : velocity / 127.0;132 setVelocity(velocity); 122 133 m_onCounter = 0; 123 134 … … 244 255 // no input, no LFO 245 256 m_oscMod1.getSamples(s_samples, start, end); 246 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, start, end, m_ velocity);247 else m_envelope1.ampSamplesNonLinear(s_samples, start, end, m_ velocity);257 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, start, end, m_ampLevel); 258 else m_envelope1.ampSamplesNonLinear(s_samples, start, end, m_ampLevel); 248 259 } 249 260 else { … … 261 272 m_oscMod1.setFrequency(getFrequency(freqNo)); 262 273 m_oscMod1.getSamples(s_samples, s, e); 263 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, s, e, m_ velocity);264 else m_envelope1.ampSamplesNonLinear(s_samples, s, e, m_ velocity);274 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, s, e, m_ampLevel); 275 else m_envelope1.ampSamplesNonLinear(s_samples, s, e, m_ampLevel); 265 276 m_onCounter += e - s; 266 277 s = e; … … 278 289 s_samples[i] = m_oscMod1.getNextSampleOfs(s_pipeArr[m_inPipe][i] * m_inSens); 279 290 } 280 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, start, end, m_ velocity);281 else m_envelope1.ampSamplesNonLinear(s_samples, start, end, m_ velocity);291 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, start, end, m_ampLevel); 292 else m_envelope1.ampSamplesNonLinear(s_samples, start, end, m_ampLevel); 282 293 } 283 294 else { … … 292 303 m_onCounter++; 293 304 } 294 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, start, end, m_ velocity);295 else m_envelope1.ampSamplesNonLinear(s_samples, start, end, m_ velocity);305 if (m_volMode == 0) m_envelope1.ampSamplesLinear(s_samples, start, end, m_ampLevel); 306 else m_envelope1.ampSamplesNonLinear(s_samples, start, end, m_ampLevel); 296 307 } 297 308 } -
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MEvent.as
r29200 r32952 42 42 public function setInput(sens:int, pipe:int):void { set(MStatus.INPUT, sens, pipe); } 43 43 public function setOutput(mode:int, pipe:int):void { set(MStatus.OUTPUT, mode, pipe); } 44 public function setExpression(ex:int):void { set(MStatus.EXPRESSION, ex, 0); } 44 45 public function setDelta(delta:int):void { m_delta = delta; } 45 46 public function getStatus():int { return m_status; } … … 75 76 public function getOutputMode():int { return m_data0; } 76 77 public function getOutputPipe():int { return m_data1; } 78 public function getExpression():int { return m_data0; } 77 79 } 78 80 } -
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MML.as
r32797 r32952 94 94 m_velocity = getUInt(m_velocity); 95 95 if (m_velocity > 127) m_velocity = 127; 96 break; 97 case 'x': // Expression 98 next(); 99 o = getUInt(127); 100 if (o > 127) o = 127; 101 m_tracks[m_trackNo].recExpression(o); 96 102 break; 97 103 case 'e': // Envelope -
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MStatus.as
r29200 r32952 27 27 public static const INPUT:int = 24; 28 28 public static const OUTPUT:int = 25; 29 public static const EXPRESSION:int = 26; 29 30 } 30 31 } -
lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MTrack.as
r31640 r32952 137 137 m_ch.setOutput(e.getOutputMode(), e.getOutputPipe()); 138 138 break; 139 case MStatus.EXPRESSION: 140 m_ch.setExpression(e.getExpression()); 141 break; 139 142 case MStatus.CLOSE: 140 143 m_ch.close(); … … 372 375 recDelta(e); 373 376 e.setOutput(mode, pipe); 377 m_events.push(e); 378 } 379 380 public function recExpression(ex:int):void { 381 var e:MEvent = new MEvent(); 382 recDelta(e); 383 e.setExpression(ex); 374 384 m_events.push(e); 375 385 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)