Example #1
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="parentModule"></param>
            /// <param name="noteOnEvent"></param>
            /// <param name="programNumber"></param>
            /// <param name="slot"></param>
            public C140Sound(C140 parentModule, C140SoundManager manager, TimbreBase timbre, int tindex, TaggedNoteOnEvent noteOnEvent, int slot, byte timbreIndex) : base(parentModule, manager, timbre, tindex, noteOnEvent, slot)
            {
                this.parentModule = parentModule;
                this.timbreIndex  = timbreIndex;
                this.timbre       = (C140Timbre)timbre;

                lastSoundType = this.timbre.SoundType;
                if (lastSoundType == SoundType.INST)
                {
                    baseFreq   = this.timbre.BaseFreqency;
                    sampleRate = this.timbre.SampleRate;
                    loopPoint  = this.timbre.LoopPoint;
                    loopEn     = this.timbre.LoopEnable;
                }

                /*
                 * else if (lastSoundType == SoundType.DRUM)
                 * {
                 *  var pct = (C140PcmTimbre)parentModule.DrumSoundTable.PcmTimbres[noteOnEvent.NoteNumber];
                 *  baseFreq = pct.BaseFreqency;
                 *  sampleRate = pct.SampleRate;
                 *  loopPoint = pct.LoopPoint;
                 *  loopEn = pct.LoopEnable;
                 * }*/
            }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        public C140(uint unitNumber) : base(unitNumber)
        {
            Timbres = new C140Timbre[256];
            for (int i = 0; i < 256; i++)
            {
                Timbres[i] = new C140Timbre();
            }

            //DrumSoundTable = new C140PcmSoundTable();

            setPresetInstruments();

            this.soundManager = new C140SoundManager(this);

            f_read_byte_callback = new delg_callback(read_byte_callback);
            C140SetCallback(UnitNumber, f_read_byte_callback);

            GainLeft  = DEFAULT_GAIN;
            GainRight = DEFAULT_GAIN;

            readSoundFontForTimbre        = new ToolStripMenuItem("Import PCM from SF2 for &Timbre...");
            readSoundFontForTimbre.Click += ReadSoundFontForTimbre_Click;

            readSoundFontForDrumTimbre        = new ToolStripMenuItem("Import PCM from SF2 for &DrumTimbre...");
            readSoundFontForDrumTimbre.Click += ReadSoundFontForDrumTimbre_Click;
        }