Exemple #1
0
            internal override void ProcessAllSoundOff()
            {
                var me = new ControlChangeEvent((SevenBitNumber)120, (SevenBitNumber)0);

                ProcessControlChange(me);

                parentModule.hardReset();
            }
Exemple #2
0
            /// <summary>
            ///
            /// </summary>
            public override void KeyOn()
            {
                base.KeyOn();

                parentModule.hardReset();

                //START
                parentModule.Tms5220DataW((byte)(0x60));

                // Set freq
                if (timbre.BaseFreqency != 0)
                {
                    parentModule.SetClock(parentModule.UnitNumber,
                                          (uint)Math.Round(640000 * (CalcCurrentFrequency() / timbre.BaseFreqency)));
                }

                // Send commands
                if (timbre.ToneType == ToneType.Custom)
                {
                    var lpcd = timbre.RawCustomLpcData;
                    if (lpcd != null)
                    {
                        foreach (var line in lpcd)
                        {
                            sendCommand(line);
                        }
                    }
                }
                else
                {
                    var lpcd = timbre.PresetLpcData;
                    if (lpcd != null)
                    {
                        foreach (var data in lpcd)
                        {
                            parentModule.Tms5220DataW(data);
                        }
                    }
                }

                //STOP
                sendCommand(0, 15, 0, 0, 0, 0, 0);
            }