チェンジセット 874

差分発生行の前後
無視リスト:
コミット日時:
2008/07/23 00:56:52 (4 年前)
コミッタ:
zk33
ログメッセージ:

Spark勉強会でデモったTenoranソースをコミットしてみる。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/sazameki/branches/fp10/sazamekiFP10.as3proj

    r649 r874  
    4646  <!-- External Libraries --> 
    4747  <externalLibraryPaths> 
    48     <element path="C:\lib\flex31728\frameworks\libs\player\10\playerglobal.swc" /> 
     48    <element path="C:\lib\flex_sdk_3.1.0.2418\frameworks\libs\player\10\playerglobal.swc" /> 
    4949  </externalLibraryPaths> 
    5050  <!-- Runtime Shared Libraries --> 
     
    6262  <!-- Class files to compile (other referenced classes will automatically be included) --> 
    6363  <compileTargets> 
    64     <compile path="src\samples\SamplerSample.as" /> 
     64    <compile path="src\samples\TenoranSample.as" /> 
    6565  </compileTargets> 
    6666  <!-- Paths to exclude from the Project Explorer tree --> 
  • as3/sazameki/branches/fp10/src/org/sazameki/audio/core/AudioSamples.as

    r649 r874  
    1313                 
    1414                private var _setting:AudioSetting; 
    15                  
     15                //TODO: サンプルがmonoのときは、rightにleftのサンプルの参照を入れておくようにする。 
    1616                public function AudioSamples(setting:AudioSetting,length:int=0)  
    1717                { 
  • as3/sazameki/branches/fp10/src/org/sazameki/audio/engine/MultiSamplePlayer/Instrument.as

    r649 r874  
    1616                public var name:String; 
    1717                 
    18                 public function Instrument(samples:AudioSamples,loopStartIdx:uint=0,loopEndIdx:uint=0,sampleMIDINoteNum:uint=255,samplePitchFine:Number=0)  
     18                public function Instrument(samples:AudioSamples=null,loopStartIdx:uint=0,loopEndIdx:uint=0,sampleMIDINoteNum:uint=255,samplePitchFine:Number=0)  
    1919                { 
    2020                        _samples = samples; 
  • as3/sazameki/branches/fp10/src/org/sazameki/audio/engine/MultiSamplePlayer/NoteRange.as

    r649 r874  
    2929                        _max = (value < 128)? value : 127; 
    3030                } 
    31                  
     31                public function toString():String 
     32                { 
     33                        return (_min + "," +_max); 
     34                } 
    3235        } 
    3336         
  • as3/sazameki/branches/fp10/src/org/sazameki/audio/engine/MultiSamplePlayer/Voice.as

    r649 r874  
    8989                        var instLeft:Vector.<Number>=_inst.samples.left; 
    9090                        var instRight:Vector.<Number>=_inst.samples.right; 
     91                        var instLen:int = instLeft.length; 
    9192                        var prev:Number; 
    9293                        var next:Number; 
     
    103104                                                //補間する。とりあえずシンプルに線形補間で試してみる。 
    104105                                                prev = instLeft[nearIdx]; 
    105                                                 if (nearIdx+1 < loopEnd) 
    106                                                 { 
    107                                                         next = instLeft[nearIdx + 1]; 
     106                                                 
     107                                                if(loopEnd){ 
     108                                                        if (nearIdx+1 < loopEnd) 
     109                                                        { 
     110                                                                next = instLeft[nearIdx + 1]; 
     111                                                        }else 
     112                                                        { 
     113                                                                next = instLeft[loopStart]; 
     114                                                        } 
    108115                                                }else 
    109116                                                { 
    110                                                         next = instLeft[loopStart]; 
    111                                                 } 
    112                                                  
     117                                                        if (nearIdx + 1 < instLen) 
     118                                                        { 
     119                                                                next = instLeft[nearIdx + 1]; 
     120                                                        }else 
     121                                                        { 
     122                                                                next = 0; 
     123                                                        } 
     124                                                } 
    113125                                                tmpLeft = (prev + (next - prev) * diff) * _velocity; 
    114126                                                 
     
    120132                                                        { 
    121133                                                                prev = instRight[nearIdx]; 
    122                                                                 if (nearIdx < loopEnd) 
     134                                                                if (loopEnd) 
    123135                                                                { 
    124                                                                         next = instRight[nearIdx + 1]; 
     136                                                                        if (nearIdx < loopEnd) 
     137                                                                        { 
     138                                                                                next = instRight[nearIdx + 1]; 
     139                                                                        }else 
     140                                                                        { 
     141                                                                                next = instRight[loopStart]; 
     142                                                                        } 
    125143                                                                }else 
    126144                                                                { 
    127                                                                         next = instRight[loopStart]; 
     145                                                                        if (nearIdx + 1 < instLen) 
     146                                                                        { 
     147                                                                                next = instLeft[nearIdx + 1]; 
     148                                                                        }else 
     149                                                                        { 
     150                                                                                next = 0; 
     151                                                                        } 
    128152                                                                } 
    129153                                                                bufRight[i] += (prev+(next-prev) * diff)*_velocity; 
  • as3/sazameki/branches/fp10/src/org/sazameki/audio/format/riff/LIST.as

    r649 r874  
    22{ 
    33        import flash.utils.ByteArray; 
    4         import org.sazameki.audio.processor.utility.LengthChanger; 
    54         
    65        /** 
     
    6059                         
    6160                        var obj:Object = new Object(); 
    62                         var total:int; 
    6361                        var current:int; 
    6462                        var currentName:String; 
     
    6664                        bytes.position = 0; 
    6765                        bytes.endian = ENDIAN; 
    68                         bytes.readUTFBytes(4);//id 
    69                         total = bytes.readInt(); 
    70                         bytes.readUTFBytes(4);//type 
    71                          
     66                        //'RIFF'のときはとばす 
     67                        if (bytes.readUTFBytes(4) == 'RIFF') 
     68                        { 
     69                                bytes.readInt(); 
     70                                bytes.readUTFBytes(4);//type 
     71                        }else 
     72                        { 
     73                                //戻す。 
     74                                bytes.position = 0; 
     75                        } 
    7276                        //チャンク抜き出し 
    7377                        while (bytes.position < bytes.length) 
    7478                        { 
    7579                                currentName = bytes.readUTFBytes(4); 
     80                                 
     81                                 
    7682                                current = bytes.readInt(); 
     83 
     84                                if (currentName == 'LIST') 
     85                                { 
     86                                        currentName = bytes.readUTFBytes(4); 
     87                                        current -= 4; 
     88                                } 
    7789                                 
    7890                                var tmpByte:ByteArray = new ByteArray(); 
    7991                                 
    80  
    8192                                bytes.readBytes(tmpByte, 0, current); 
    8293                                //currentが奇数の時は1バイト余分に取る 
     
    8697                                } 
    8798 
    88                                  
     99                                //trace(currentName); 
    89100                                obj[currentName] = tmpByte; 
    90101