/// <summary> /// /// </summary> /// <param name="parentModule"></param> /// <param name="noteOnEvent"></param> /// <param name="programNumber"></param> /// <param name="slot"></param> public SN76496Sound(SN76496 parentModule, SN76496SoundManager manager, TimbreBase timbre, int tindex, TaggedNoteOnEvent noteOnEvent, int slot) : base(parentModule, manager, timbre, tindex, noteOnEvent, slot) { this.parentModule = parentModule; this.timbre = (SN76496Timbre)timbre; lastSoundType = this.timbre.SoundType; }
/// <summary> /// /// </summary> public SN76496(uint unitNumber) : base(unitNumber) { GainLeft = DEFAULT_GAIN; GainRight = DEFAULT_GAIN; Timbres = new SN76496Timbre[InstrumentBase.DEFAULT_MAX_TIMBRES]; for (int i = 0; i < InstrumentBase.DEFAULT_MAX_TIMBRES; i++) { Timbres[i] = new SN76496Timbre(); } setPresetInstruments(); this.soundManager = new SN76496SoundManager(this); }
/// <summary> /// /// </summary> /// <returns></returns> private (SN76496 inst, int slot) searchEmptySlot(TaggedNoteOnEvent note, SN76496Timbre timbre) { var emptySlot = (parentModule, -1); switch (timbre.SoundType) { case SoundType.PSG: { emptySlot = SearchEmptySlotAndOffForLeader(parentModule, psgOnSounds, note, 3); break; } case SoundType.NOISE: { emptySlot = SearchEmptySlotAndOffForLeader(parentModule, noiseOnSounds, note, 1); break; } } return(emptySlot); }