Ejemplo n.º 1
0
        /// <summary>
        /// Only used when command line arguments are used.
        /// </summary>
        private void FilterBanks()
        {
            if (FilterProgramBankNames != null)
            {
                for (int index = SelectedProgramBanks.Count - 1; index >= 0; index--)
                {
                    IProgramBank bank = SelectedProgramBanks[index];

                    if (!FilterProgramBankNames.Contains(bank.Id))
                    {
                        SelectedProgramBanks.Remove(bank);
                    }
                }
            }

            if (FilterCombiBankNames != null)
            {
                for (int index = SelectedCombiBanks.Count - 1; index >= 0; index--)
                {
                    ICombiBank bank = SelectedCombiBanks[index];
                    if (!FilterCombiBankNames.Contains(bank.Id))
                    {
                        SelectedCombiBanks.Remove(bank);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        private void FillDictionaryWithCombis()
        {
            foreach (ICombiBank combiBank in SelectedCombiBanks)
            {
                foreach (IPatch combi in combiBank.Patches)
                {
                    if (!combiBank.IsLoaded || (IgnoreInitCombis && combi.IsEmptyOrInit))
                    {
                        continue;
                    }

                    IPatch     combi1 = combi;
                    ICombiBank bank   = combiBank;
                    foreach (Tuple <IProgramBank, IProgram> key in from timbre in ((ICombi)combi).Timbres.TimbresCollection
                             where !bank.IsLoaded || (bank.IsLoaded && !IgnoreMutedOffTimbres ||
                                                      (((timbre.GetParam(ParameterNames.TimbreParameterName.Mute) == null) ||
                                                        !timbre.GetParam(ParameterNames.TimbreParameterName.Mute).Value) &&
                                                       (new List <string> {
                        "Int", "On", "Both"
                    }.Contains(
                                                            timbre.GetParam(ParameterNames.TimbreParameterName.Status).Value))))
                             select new Tuple <IProgramBank, IProgram>(timbre.UsedProgramBank, timbre.UsedProgram)
                             into key
                             where _dict.ContainsKey(key) && !_dict[key].Contains(combi1)
                             select key)
                    {
                        _dict[key].AddLast(combi);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="combiPatchSize"></param>
        /// <param name="startCombiBank"></param>
        private void ReadCombis(int combiPatchSize, int startCombiBank)
        {
            if ((ContentType == PcgMemory.ContentType.All) ||
                (ContentType == PcgMemory.ContentType.AllCombis))
            {
                // Read combi data.
                CombiBank combiBank = (CombiBank)CurrentPcgMemory.CombiBanks[0];

                for (int bankIndex = startCombiBank; bankIndex < CurrentPcgMemory.CombiBanks.BankCollection.Count;
                     bankIndex++)
                {
                    ICombiBank bank = (ICombiBank)(CurrentPcgMemory.CombiBanks[bankIndex]);
                    if (bank.Type != BankType.EType.Virtual)
                    {
                        bank.ByteOffset = Index;
                        bank.ByteLength = combiPatchSize;
                        bank.IsWritable = true;
                        bank.IsLoaded   = true;

                        foreach (IPatch combi in bank.Patches)
                        {
                            combi.ByteOffset = Index;
                            combi.ByteLength = combiBank.PatchSize;
                            combi.IsLoaded   = true;

                            // Skip to next.
                            Index += bank.ByteLength;
                        }
                    }

                    // When virtual banks are used, here needs to be checked to stop reading combi banks.
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Copies combi and set list slot.
        /// </summary>
        /// <param name="setListTarget"></param>
        /// <param name="combiBankTarget"></param>
        /// <param name="mainMidiChannel"></param>
        /// <param name="secondaryMidiChannel"></param>
        /// <param name="sourceSetListSlot"></param>
        /// <param name="currentTargetCombiIndex"></param>
        /// <param name="finishedPrematurely"></param>
        /// <param name="currentTargetSetListSlotIndex"></param>
        /// <returns></returns>
        private static bool CopySecondaryPatches(ISetList setListTarget, ICombiBank combiBankTarget, int mainMidiChannel,
                                                 int secondaryMidiChannel, ISetListSlot sourceSetListSlot, ref int currentTargetCombiIndex,
                                                 ref bool finishedPrematurely, ref int currentTargetSetListSlotIndex)
        {
            ICombi sourceCombi = (ICombi)sourceSetListSlot.UsedPatch;

            if (sourceCombi.UsesMidiChannel(secondaryMidiChannel))
            {
                // Create second combi with changed name and MIDI channels switched.
                if (currentTargetCombiIndex >= combiBankTarget.CountPatches)
                {
                    finishedPrematurely = true;
                    return(true);
                }
                sourceCombi.PcgRoot.CopyPatch(sourceCombi, combiBankTarget.Patches[currentTargetCombiIndex]);
                ICombi combi = (ICombi)combiBankTarget.Patches[currentTargetCombiIndex];
                combi.SetNameSuffix($"/MC{secondaryMidiChannel}");
                combi.SwitchMidiChannels(mainMidiChannel, secondaryMidiChannel);
                currentTargetCombiIndex++;

                // Copy set list slot with changed name and referencing to combi.
                if (currentTargetSetListSlotIndex >= setListTarget.Patches.Count)
                {
                    finishedPrematurely = true;
                    return(true);
                }

                sourceSetListSlot.PcgRoot.CopyPatch(sourceSetListSlot, setListTarget.Patches[currentTargetSetListSlotIndex]);
                ISetListSlot setListSlotSecondary = (ISetListSlot)setListTarget.Patches[currentTargetSetListSlotIndex];
                setListSlotSecondary.SetNameSuffix($"/MC{secondaryMidiChannel}");
                setListSlotSecondary.UsedPatch = combi;
                currentTargetSetListSlotIndex++;
            }
            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="combiBank"></param>
        /// <param name="index"></param>
        public Zero3RwCombi(ICombiBank combiBank, int index)
            : base(combiBank, index)
        {
            if (combiBank.Type == BankType.EType.Int)
            {
                Id = $"{combiBank.Id}{(index).ToString("00")}";
            }
            else
            {
                throw new NotSupportedException("Unsupported bank type");
            }

            Timbres = new Zero3RwTimbres(this);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offset"></param>
        private void ReadSingleCombi(int offset)
        {
            ICombiBank bank = (ICombiBank)(CurrentPcgMemory.CombiBanks[0]);

            bank.ByteOffset = 0;
            bank.ByteLength = 240;
            bank.IsWritable = true;
            bank.IsLoaded   = true;

            ICombi combi = (ICombi)bank[0];

            combi.ByteOffset = offset;
            combi.ByteLength = bank.ByteLength;
            combi.IsLoaded   = true;
        }
Ejemplo n.º 7
0
        private void ReadSingleCombi(int offset)
        {
            ICombiBank bank = (ICombiBank)(CurrentPcgMemory.CombiBanks[_bank]);

            bank.ByteOffset = 0;
            bank.ByteLength = 0x7bc;
            bank.IsWritable = true;
            bank.IsLoaded   = true;

            ICombi combi = (ICombi)bank[_patchIndex];

            combi.ByteOffset = offset;
            combi.ByteLength = bank.ByteLength;
            combi.IsLoaded   = true;

            IncreaseCombi();
        }
Ejemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="combiBankIndex"></param>
        /// <returns></returns>
        private int ReadCombiData(int combiBankIndex)
        {
            ICombiBank combiBank = (ICombiBank)CurrentPcgMemory.CombiBanks[combiBankIndex];

            combiBank.ByteOffset = Index;
            combiBank.ByteLength = 128;
            combiBank.IsWritable = true;
            combiBank.IsLoaded   = true;

            foreach (Common.Synth.Meta.IPatch combi in combiBank.Patches)
            {
                combi.ByteOffset = Index;
                combi.ByteLength = combiBank.ByteLength;
                combi.IsLoaded   = true;

                // Skip to next.
                Index += combiBank.ByteLength;
            }

            combiBankIndex += 1;
            return(combiBankIndex);
        }
Ejemplo n.º 9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public M50Combi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Timbres = new M50Timbres(this);
 }
Ejemplo n.º 10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public M3RCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Id      = $"{combiBank.Id}{(index).ToString("00")}";
     Timbres = new M3RTimbres(this);
 }
Ejemplo n.º 11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 protected TritonCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
 }
Ejemplo n.º 12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public MicroStationCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Timbres = new MicroStationTimbres(this);
 }
Ejemplo n.º 13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 protected KronosOasysCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public KrossCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Timbres = new KrossTimbres(this);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public M3RCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Id      = string.Format("{0}{1}", combiBank.Id, (index).ToString("00"));
     Timbres = new M3RTimbres(this);
 }
Ejemplo n.º 16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public TritonLeCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Timbres = new TritonLeTimbres(this);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public TritonTrClassicStudioRackCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Timbres = new TritonTrClassicStudioRackTimbres(this);
 }
Ejemplo n.º 18
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="combiBank"></param>
 /// <param name="index"></param>
 public OasysCombi(ICombiBank combiBank, int index)
     : base(combiBank, index)
 {
     Timbres = new OasysTimbres(this);
 }