public void Init(byte ownerIdx, Note note, ADSR adsr, WrappedSample sample, byte vol, sbyte pan, int pitch, bool bFixed) { State = ADSRState.Initializing; pos = 0; processStep = 0; interPos = 0; OwnerIdx = ownerIdx; Note = note; this.adsr = adsr; this.sample = sample; this.bFixed = bFixed; bGoldenSun = (ROM.Instance.Game.Engine.HasGoldenSunSynths && sample.bLoop && sample.LoopPoint == 0 && sample.Length == 0); if (bGoldenSun) { gsPSG = ROM.Instance.Reader.ReadObject <GoldenSunPSG>(sample.GetOffset()); } SetVolume(vol, pan); SetPitch(pitch); }
internal void Init(byte ownerIdx, Note note, ADSR adsr, Sample sample, byte vol, sbyte pan, int pitch, bool bFixed) { State = ADSRState.Initializing; pos = 0; processStep = 0; interPos = 0; OwnerIdx = ownerIdx; Note = note; this.adsr = adsr; this.sample = sample; this.bFixed = bFixed; bGoldenSun = (sample.bLoop && sample.LoopPoint == 0 && sample.Length == 0); if (bGoldenSun) { gsPSG = ROM.Instance.ReadStruct <GoldenSunPSG>(sample.Offset); } SetVolume(vol, pan); SetPitch(pitch); }