public void LoadToneFile(string toneSavePath, bool verbose = true) { try { switch (CurrentGameVersion) { case GameVersion.RS2012: toneControl.Tone = Tone.LoadFromXmlTemplateFile(toneSavePath); break; case GameVersion.RS2014: toneControl.Tone = Tone2014.LoadFromXmlTemplateFile(toneSavePath); break; } } catch (Exception ex) { toneControl.Tone = null; MessageBox.Show("Can't load saved tone. \n" + ex.Message, DLCPackageCreator.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (verbose) { MessageBox.Show("Tone was loaded.", DLCPackageCreator.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void loadButton_Click(object sender, EventArgs e) { string toneSavePath; using (var ofd = new OpenFileDialog()) { ofd.Filter = CurrentOFDFilter; if (ofd.ShowDialog() != DialogResult.OK) { return; } toneSavePath = ofd.FileName; } dynamic tone = null; try { switch (CurrentGameVersion) { case GameVersion.RS2012: tone = Tone.LoadFromXmlTemplateFile(toneSavePath); break; case GameVersion.RS2014: tone = Tone2014.LoadFromXmlTemplateFile(toneSavePath); break; } } catch (Exception ex) { MessageBox.Show("Can't load saved tone. \n" + ex.Message, DLCPackageCreator.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } toneControl1.Tone = tone; MessageBox.Show("Tone was loaded.", DLCPackageCreator.MESSAGEBOX_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Information); }
public Tone Tone2014toTone(Tone2014 rs2014Tone) { Tone tone = new Tone(); Pedal amp = new Pedal(); Pedal cabinet = new Pedal(); Pedal loopPedal = new Pedal(); Pedal prePedal = new Pedal(); Pedal postPedal = new Pedal(); // use Tone Key for better conversion tone.Name = rs2014Tone.Name ?? "Default"; tone.Key = rs2014Tone.Key ?? "DEFAULT"; tone.Volume = rs2014Tone.Volume; tone.IsDLC = true; tone.Description = "$[-1] "; // setup some possible tone approximation conversions // no direct mapping for RS2 -> RS1 Tones // so check IEnumerable<ToneDescriptor> List() // TODO: figure out better method for tone mapping if (tone.Key.ToUpper().Contains("COMBO")) { tone.Key = "Combo_OD"; } if (tone.Key.ToUpper().Contains("OD")) { amp.PedalKey = "Cab_4X12_RangerVintageGreen_Tube_Cone"; cabinet.PedalKey = "Amp_Ranger65"; prePedal.PedalKey = "Pedal_CustomFuzz"; prePedal.KnobValues = new Dictionary <string, decimal>() { { "Pedal_CustomFuzz_Fuzz", (decimal)25.0 }, { "Pedal_CustomFuzz_Lo", (decimal)60.0 }, { "Pedal_CustomFuzz_Hi", (decimal)0.0 }, { "Pedal_CustomFuzz_Rectify", (decimal)1.0 } }; tone.PedalList = new Dictionary <string, Pedal>() { { "Amp", amp }, { "Cabinet", cabinet }, // pedals have three slots (Pedal3 to Pedal1) // so this is just faking a close approximation of the truth { "PrePedal3", prePedal } }; } else if (tone.Key.ToUpper().Contains("LEAD")) { amp.PedalKey = "Amp_SoloTenor"; amp.KnobValues = new Dictionary <string, decimal>() { { "Amp_SoloTenor_Bass", (decimal)45.0 }, { "Amp_SoloTenor_Treble", (decimal)75.0 }, { "Amp_SoloTenor_Volume", (decimal)48.0 } }; cabinet.PedalKey = "Cab_1X12_Tenor_Condenser_Cone"; postPedal.PedalKey = "Pedal_HolyCow"; postPedal.KnobValues = new Dictionary <string, decimal>() { { "Pedal_HolyCow_Mix", (decimal)32.0 }, { "Pedal_HolyCow_Reverb", (decimal)54.0 } }; tone.PedalList = new Dictionary <string, Pedal>() { { "Amp", amp }, { "Cabinet", cabinet }, { "PostPedal3", postPedal } }; } else if (tone.Key.ToUpper().Contains("DIS")) { amp.PedalKey = "Amp_MegaDuel"; amp.KnobValues = new Dictionary <string, decimal>() { { "Amp_MegaDuel_Low", (decimal)95.0 }, { "Amp_MegaDuel_Mid", (decimal)55.0 }, { "Amp_MegaDuel_Hi", (decimal)25.0 }, { "Amp_MegaDuel_Gain", (decimal)72.0 } }; cabinet.PedalKey = "Cab_4X10_Baritone_Condenser_Cone"; prePedal.PedalKey = "Pedal_EQ6"; prePedal.KnobValues = new Dictionary <string, decimal>() { { "Pedal_EQ6_200", (decimal)1.0 }, { "Pedal_EQ6_400", (decimal)0.0 }, { "Pedal_EQ6_1600", (decimal)0.0 }, { "Pedal_EQ6_3200", (decimal) - 3.0 }, { "Pedal_EQ6_800", (decimal)1.0 }, { "Pedal_EQ6_100", (decimal)2.0 } }; postPedal.PedalKey = "Pedal_EQ7"; postPedal.KnobValues = new Dictionary <string, decimal>() { { "Pedal_EQ7_1600", (decimal)1.0 }, { "Pedal_EQ7_800", (decimal)1.0 }, { "Pedal_EQ7_200", (decimal)1.0 }, { "Pedal_EQ7_3200", (decimal) - 4.0 }, { "Pedal_EQ7_100", (decimal)0.0 }, { "Pedal_EQ7_400", (decimal)0.0 }, { "Pedal_EQ7_6400", (decimal) - 6.0 } }; tone.PedalList = new Dictionary <string, Pedal>() { { "Amp", amp }, { "Cabinet", cabinet }, { "PrePedal3", prePedal }, { "PostPedal3", postPedal } }; } else if (tone.Key.ToUpper().Contains("CLEAN")) { amp.PedalKey = "Amp_Hitone"; amp.KnobValues = new Dictionary <string, decimal>() { { "Amp_Hitone_Bright", (decimal)65.0 }, { "Amp_Hitone_Hi", (decimal)65.0 }, { "Amp_Hitone_Lo", (decimal)55.0 }, { "Amp_Hitone_Volume", (decimal)90.0 } }; cabinet.PedalKey = "Cab_4X12_Hitone_Condenser_Cone"; tone.PedalList = new Dictionary <string, Pedal>() { { "Amp", amp }, { "Cabinet", cabinet } }; } else if (tone.Key.ToUpper().Contains("ACOU")) { amp.PedalKey = "Amp_Ranger81"; amp.KnobValues = new Dictionary <string, decimal>() { { "Amp_Ranger81_Gain", (decimal)100.0 }, { "Amp_Ranger81_Treble", (decimal)100.0 }, { "Amp_Ranger81_Bass", (decimal)84.0 }, { "Amp_Ranger81_Mid", (decimal)100.0 } }; cabinet.PedalKey = "Cab_4X12_Ranger_Condenser_Cone"; loopPedal.PedalKey = "Pedal_EQ7"; loopPedal.KnobValues = new Dictionary <string, decimal>() { { "Pedal_EQ7_1600", (decimal)2.0 }, { "Pedal_EQ7_800", (decimal) - 2.0 }, { "Pedal_EQ7_200", (decimal)2.0 }, { "Pedal_EQ7_3200", (decimal)0.0 }, { "Pedal_EQ7_100", (decimal) - 1.0 }, { "Pedal_EQ7_400", (decimal) - 1.0 }, { "Pedal_EQ7_6400", (decimal)2.0 } }; tone.PedalList = new Dictionary <string, Pedal>() { { "Amp", amp }, { "Cabinet", cabinet }, { "LoopPedal3", loopPedal } }; } else if (tone.Key.ToUpper().Contains("BASS")) { amp.PedalKey = "Amp_Bass_NPN500"; amp.KnobValues = new Dictionary <string, decimal>() { { "Amp_Bass_NPN500_HiBoost", (decimal)1.0 }, { "Amp_Bass_NPN500_Volume", (decimal)25.0 }, { "Amp_Bass_NPN500_HiMid", (decimal)60.0 }, { "Amp_Bass_NPN500_Low", (decimal)100.0 }, { "Amp_Bass_NPN500_LoCut", (decimal)0.0 }, { "Amp_Bass_NPN500_LoMid", (decimal)40.0 }, { "Amp_Bass_NPN500_High", (decimal)60.0 }, { "Amp_Bass_NPN500_MidContour", (decimal)0.0 } }; cabinet.PedalKey = "Cab_Bass_2X10_HF_RE20_Edge"; prePedal.PedalKey = "Pedal_EQ7"; prePedal.KnobValues = new Dictionary <string, decimal>() { { "Pedal_EQ7_1600", (decimal)4.0 }, { "Pedal_EQ7_800", (decimal)2.0 }, { "Pedal_EQ7_200", (decimal) - 1.0 }, { "Pedal_EQ7_3200", (decimal)3.0 }, { "Pedal_EQ7_100", (decimal)5.0 }, { "Pedal_EQ7_400", (decimal)0.0 }, { "Pedal_EQ7_6400", (decimal) - 3.0 } }; tone.PedalList = new Dictionary <string, Pedal>() { { "Amp", amp }, { "Cabinet", cabinet }, // pedals have three slots (Pedal3 to Pedal1) // so this is just faking a close approximation of the truth { "PrePedal3", prePedal }, }; } else // set a default tone { // this is fix for unknown RS2 CDLC tones amp.PedalKey = "Amp_Baritone"; amp.KnobValues = new Dictionary <string, decimal>() { { "Amp_Baritone_Volume", (decimal)30.0 }, { "Amp_Baritone_Bass", (decimal)60.0 }, { "Amp_Baritone_Treble", (decimal)60.0 } }; cabinet.PedalKey = "Cab_1X15_Tweed_57_Back"; tone.PedalList = new Dictionary <string, Pedal>() { { "Amp", amp }, { "Cabinet", cabinet } }; } return(tone); }
static int Main(string[] args) { try { Console.SetWindowSize(85, 40); Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.Green; } catch { /* DO NOTHING */ } #if (DEBUG) // give the progie some dumby file to work on args = new string[] { "D:\\Temp\\PeppaPig_p.psarc" }; Console.WriteLine("Running in Debug Mode ... help is not available"); #endif // catch if there are no cmd line arguments if (args.GetLength(0) == 0) { args = new string[] { "?" } } ; if (args[0].Contains("?") || args[0].ToLower().Contains("help")) { Console.WriteLine(@"Tone Liberator DropletApp for Rocksmith 2014 CDLC"); Console.WriteLine(); Console.WriteLine(@" - Version: " + ProjectVersion()); Console.WriteLine(@" Copyright (C) 2016 CST Developers, Cozy1"); Console.WriteLine(); Console.WriteLine(@" - Purpose: Extracts Reusable Tones from CDLC Archive Files"); Console.WriteLine(@" Creates 'SongName_Arrangement_ToneKey.tone2014.xml' files"); Console.WriteLine(@" and copies them to the 'dlc/toneliberator' output folder"); Console.WriteLine(); Console.WriteLine(@" - Usage: Drag/Drop CDLC archive file(s)"); Console.WriteLine(@" or folder(s) onto the console executable icon"); Console.Read(); return(0); } var errorMsg = String.Empty; var srcDir = args[0]; var rootDir = Path.GetDirectoryName(srcDir); var destFolder = Path.Combine("dlc", "toneliberator"); var destDir = Path.Combine(rootDir, destFolder); // create destination 'dlc/tones' directory if (!Directory.Exists(destDir)) { Directory.CreateDirectory(destDir); } Console.WriteLine(@"Initializing Tone Liberator CLI ..."); Console.WriteLine(); // iterate through folders and/or files foreach (var arg in args) { string[] filePaths; if (IsDirectory(arg)) { filePaths = Directory.GetFiles(arg, "*.psarc", SearchOption.AllDirectories).ToArray(); if (!filePaths.Any()) { Console.WriteLine(@"<ERROR> No valid PSARC archives found: " + arg); Console.WriteLine(); continue; } } else if (arg.IsValidPSARC()) { filePaths = new string[1]; filePaths[0] = arg; } else { Console.WriteLine(@"<ERROR> Invalid PSARC archive: " + arg); Console.WriteLine(); continue; } foreach (var filePath in filePaths) { Console.WriteLine(); Console.WriteLine(@"Liberating tones from: " + filePath); using (var browser = new PsarcLoader(filePath, true)) { var jsonEntries = browser.ExtractJsonManifests(); foreach (var manifest2014 in jsonEntries) { var preToneKey = String.Empty; var attr = manifest2014.Entries.ToArray()[0].Value.ToArray()[0].Value; for (int i = 0; i < attr.Tones.Count; i++) { var toneKey = attr.Tones[i].Key; if (toneKey == preToneKey) { continue; } else { preToneKey = toneKey; } var toneFileName = String.Format("{0}_{1}.tone2014.xml", attr.FullName, toneKey); var toneFilePath = Path.Combine(destDir, toneFileName); Console.WriteLine(@" - Writing tone: " + toneFilePath); var tone = new Tone2014(); tone = attr.Tones[i]; tone.Serialize(toneFilePath); } } } } } Console.WriteLine(); Console.WriteLine(@"Done creating tone2014.xml files ..."); Console.WriteLine(@" - Saved to directory: " + Path.Combine(rootDir, destDir) + @"\"); Console.WriteLine(); Console.WriteLine(); Console.WriteLine(@"Press any key to continue ..."); Console.Read(); return(0); }