public override void OnRegister()
        {
            base.OnRegister();

            InstrumentsImportedSignal.AddListener(RefreshInstruments);
            EditedInstrumentChangedSignal.AddListener(EditedInstrumentChangedHandler);
            InstrumentGeneralSettingsChangedSignal.AddListener(RefreshInstruments);

            View.InstrumentDropdown.onValueChanged.AddListener(OnDropdownChangedHandler);
            RefreshInstruments();

            AddButtonListener(View.ImportButton, ImportButtonHandler);
            AddButtonListener(View.ExportButton, ExportButtonHandler);
            AddButtonListener(View.NewButton, NewButtonHandler);
        }
        private void UpdateInstrument()
        {
            var inst = InstrumentsModel.GetEditedInstrument();

            if (inst == null)
            {
                return;
            }

            inst.Name        = View.InstrumentNameInput.text;
            inst.MidiPort    = View.MidiPortDropdown.value + 1;
            inst.MidiChannel = View.MidiChannelDropdown.value + 1;

            inst.DefaultNote    = new Note(View.DefaultNoteDropdown.value, View.DefaultNoteOctaveDropdown.value);
            inst.DefaultPattern = (PatternType)View.DefaultPatternDropdown.value;

            inst.Multi      = View.MultiToggle.isOn;
            inst.PolySpread = View.PolySpreadToggle.isOn;
            inst.NoXpose    = View.NoTransposeToggle.isOn;
            inst.NoFts      = View.NoFtsToggle.isOn;

            InstrumentGeneralSettingsChangedSignal.Dispatch();
        }