Exemplo n.º 1
0
        public void AddSoundfont(RiffChunkListLrgn aLrgnList, List <WaveformBase> aWaveformList, int aTuning)
        {
            for (int l = 0; l < aLrgnList.rgn_ListList.Count; l++)
            {
                RiffChunkListRgn_ rgn_List = ( RiffChunkListRgn_ )aLrgnList.rgn_ListList[l];

                AddSoundfont(new SoundfontDls(rgn_List, aWaveformList, aTuning));
            }

            for (int l = 0; l < aLrgnList.rgn2ListList.Count; l++)
            {
                RiffChunkListRgn2 rgn2List = ( RiffChunkListRgn2 )aLrgnList.rgn2ListList[l];

                AddSoundfont(new SoundfontDls(rgn2List, aWaveformList, aTuning));
            }
        }
Exemplo n.º 2
0
        public SoundfontDls(RiffChunkListRgn2 rgn2List, List <WaveformReaderPcm> waveformList, int tuning)
        {
            RiffDls_Rgnh rgnhChunk = rgn2List.rgnhBody;
            RiffDls_Wsmp wsmpChunk = rgn2List.wsmpBody;
            RiffDls_Wlnk wlnkChunk = rgn2List.wlnkBody;

            byte  lokey          = ( byte )rgnhChunk.rangeKey.low;
            byte  hikey          = ( byte )rgnhChunk.rangeKey.high;
            bool  loopMode       = wsmpChunk.GetLoopType() != 0 ? true : false;
            int   loopStart      = ( int )wsmpChunk.GetLoopStart();
            int   loopEnd        = ( int )(wsmpChunk.GetLoopStart() + wsmpChunk.GetLoopLength());
            int   tune           = wsmpChunk.fineTune;
            int   pitchKeyCenter = wsmpChunk.unityNote;
            float volume         = 0.0f;

            soundinfo = new Soundinfo(lokey, hikey, loopMode, loopStart, loopEnd, 0, 0x7FFFFFFF, tune, pitchKeyCenter, 0, 0, volume);
            ampeg     = new Ampeg(0.0d, 0.0d, 0.0d, 0.0d, 0.0d, 1.0d, 0.25d);
            waveform  = waveformList[( int )wlnkChunk.tableIndex];
        }