Пример #1
0
        public static ITimedWave16 Get
        (
            UInt32[] tones,
            Int32 instrumentNumber,
            Int16 volume                    = 24576,
            UInt32 SampleRate               = 44100,
            Boolean doFadeout               = false,
            Double fadeoutStrength          = 1.0,
            Double fadeoutPosition          = 1.0,
            Boolean keepVolumeBeforeFadeout = true
        )
        {
            List <ITimedWave16> l = new List <ITimedWave16>();

            foreach (UInt32 x in tones)
            {
                l.Add(Instruments16.GetTimedWave(x, instrumentNumber, volume, SampleRate, doFadeout, fadeoutStrength, fadeoutPosition, keepVolumeBeforeFadeout));
            }

            Polyphony16 p = new Polyphony16(l[0], ((UInt16)(l.Count * 8)));

            for (int i = 1; i < l.Count; i++)
            {
                p += l[i];
            }

            return(new Mixer16(p));
        }
Пример #2
0
        public void Export(Sequencer16 sq16)
        {
            Snap();
            sq16.Snap();
            Int32 l = Length;

            for (int i = 0; i < l; i++)
            {
                List <Extract16> lst = new List <Extract16>();

                for (int x = 0; x < KeyMap.Length; x++)
                {
                    Extract16 ex = Channels[x][i];
                    if (!ex.Blank)
                    {
                        lst.Add(ex);
                    }
                }

                if (lst.Count == 0)
                {
                    sq16.Skip(TactTime);
                    continue;
                }

                Polyphony16 ph = new Polyphony16(lst[0], (UInt16)(lst.Count * 8));

                for (int h = 1; h < lst.Count; h++)
                {
                    ph += lst[h];
                }

                Mixer16 mx = new Mixer16(ph);

                sq16.Push(mx, TactTime);
            }
        }