Example #1
0
        /// <param name="defaultSettings">TrackCCSettings, that initially apply to all output voices. MidiChannel must be null.</param>
        /// <param name="overrideSettings">A list of TrackCCSettings that override the default setting.\n
        ///                                Each MidiChannel must be unique and not null.</param>
        public CCSettings(TrackCCSettings defaultSettings, List<TrackCCSettings> overrideSettings)
        {
            #region check args
            // There must be a _defaultSettings and/or an _overrideSettings
            // Note that if the DefaultSettings are not defined, voices having no TrackCCSettings will be unaffected.
            Debug.Assert(defaultSettings != null || overrideSettings != null);

            List<byte?> channels = new List<byte?>();
            if(defaultSettings != null)
            {
                Debug.Assert(defaultSettings.MidiChannel == null);
            }
            if(overrideSettings != null)
            {
                foreach(TrackCCSettings tccs in overrideSettings)
                {
                    Debug.Assert(tccs.MidiChannel != null);
                    Debug.Assert(!channels.Contains(tccs.MidiChannel));
                    channels.Add(tccs.MidiChannel);
                }
            }
            #endregion check args

            _defaultSettings = defaultSettings;
            _overrideSettings = overrideSettings;
        }
Example #2
0
 private static void SetTrackCCSettings(InputVoiceDef inputVoiceDef)
 {
     InputChordDef inputChordDef1 = (InputChordDef)inputVoiceDef[0]; // no need to check for null here.
     #region set ccSettings
     TrackCCSettings defaultCCSettings = new TrackCCSettings(null, new List<CCSetting>()
     {
         new PitchWheelPitchControl(5),
         new PressureControl(CControllerType.channelPressure),
         new ModWheelVolumeControl(20,127)
     });
     inputChordDef1.CCSettings = new CCSettings(defaultCCSettings, null);
     #endregion
 }