예제 #1
0
        public VoiceManager(int voiceCount)
        {
            Polyphony = voiceCount;

            _voicePool   = new Voice[voiceCount];
            _vNodes      = new LinkedList <VoiceNode>();
            FreeVoices   = new LinkedList <Voice>();
            ActiveVoices = new LinkedList <Voice>();

            for (int i = 0; i < voiceCount; i++)
            {
                var v = new Voice();
                _voicePool[i] = v;
                _vNodes.AddLast(new VoiceNode());
                FreeVoices.AddLast(v);
            }

            Registry = new VoiceNode[SynthConstants.DefaultChannelCount][];
            for (int i = 0; i < Registry.Length; i++)
            {
                Registry[i] = new VoiceNode[SynthConstants.DefaultKeyCount];
            }
        }
예제 #2
0
        public VoiceManager(int voiceCount)
        {
            StealingMethod = VoiceStealingMethod.Quietest;
            Polyphony = voiceCount;

            _voicePool = new Voice[voiceCount];
            _vNodes = new LinkedList<VoiceNode>();
            FreeVoices = new LinkedList<Voice>();
            ActiveVoices = new LinkedList<Voice>();

            for (int i = 0; i < voiceCount; i++)
            {
                var v = new Voice();
                _voicePool[i] = v;
                _vNodes.AddLast(new VoiceNode());
                FreeVoices.AddLast(v);
            }

            Registry = new VoiceNode[SynthConstants.DefaultChannelCount][];
            for (int i = 0; i < Registry.Length; i++)
            {
                Registry[i] = new VoiceNode[SynthConstants.DefaultKeyCount];
            }
        }