Show
Ignore:
Timestamp:
10/26/07 02:12:19 (6 years ago)
Author:
tekisuke
Message:

MML.as フォルマントフィルタと@v音量調整を追加。
MChannel.as フォルマントフィルタ追加。
MEvent.as
MStatus.as
MTrack.as
MFormant.as

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/flmml/trunk/src/com/txt_nifty/sketch/flmml/MML.as

    r655 r718  
    6666                        var o:int = 1, a:int = 0, d:int = 64, s:int = 32, r:int = 0; 
    6767                        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 
    6974                                m_letter++; 
    7075                                o = getUInt(o); 
     
    8085                                m_tracks[m_trackNo].recEnvelope(a, d, s, r); 
    8186                                break; 
    82             case 'n': 
     87            case 'n': // Noise frequency 
    8388                m_letter++; 
    8489                o = getUInt(0); 
     
    8691                m_tracks[m_trackNo].recNoiseFreq(o); 
    8792                break; 
    88             case 'w': 
     93            case 'w': // pulse Width modulation 
    8994                m_letter++; 
    9095                o = getUInt(50); 
     
    9297                if (o > 99) o = 99; 
    9398                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                } 
    94117                break; 
    95118                        default: 
     
    118141                                break; 
    119142                        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; 
    121145                                if (m_velocity > 127) m_velocity = 127; 
    122146                                break; 
     
    209233 
    210234                public function createTrack():MTrack { 
     235                        m_octave = 4; 
     236                        m_velocity = 100; 
    211237                        return new MTrack(); 
    212238                }