ProjectDowngrade.cpp 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548
  1. #include "engine/ProjectDowngrade.h"
  2. #include "engine/ProjectFile.h"
  3. #include "core/ApexLimiter.h"
  4. #include "core/DirectWaveState.h"
  5. #include "core/DynamicsSuite.h"
  6. #include "core/EchoSuite.h"
  7. #include "core/FacetEq.h"
  8. #include "core/GeneratorPresets.h"
  9. #include "core/Harmor.h"
  10. #include "core/KiloheartsDsp.h"
  11. #include "core/Effects.h"
  12. #include "core/LimiterLaw.h"
  13. #include "core/LowLifterFl.h"
  14. #include "core/LuxeVerb.h"
  15. #include "core/LynxTune.h"
  16. #include "core/LynxVerbs.h"
  17. #include "core/MixSuite.h"
  18. #include "core/NewtoneFx.h"
  19. #include "core/PeakShapes.h"
  20. #include "core/RackRenderer.h"
  21. #include "core/Reeverb2.h"
  22. #include "core/VoiceShift.h"
  23. #include "core/VoiceTools.h"
  24. #include <cmath>
  25. #include <functional>
  26. // TR_NOOP marks the loss texts for translation (tools/i18n_keys.py); the UI translates them
  27. #ifndef TR_NOOP
  28. #define TR_NOOP(text) text
  29. #endif
  30. namespace lynx::olderlynx
  31. {
  32. namespace
  33. {
  34. using Losses = std::vector<Loss>;
  35. juce::DynamicObject* objectOf (const juce::var& v) { return v.getDynamicObject(); }
  36. juce::Array<juce::var>* arrayOf (const juce::var& v) { return v.getArray(); }
  37. bool drop (juce::DynamicObject& o, const char* key)
  38. {
  39. if (! o.hasProperty (key))
  40. return false;
  41. o.removeProperty (key);
  42. return true;
  43. }
  44. juce::String channelName (const juce::var& c, int index)
  45. {
  46. const auto name = c["name"].toString();
  47. return name.isNotEmpty() ? "\"" + name + "\"" : "#" + juce::String (index + 1);
  48. }
  49. juce::String insertName (const juce::var& mixer, int track)
  50. {
  51. // (language-neutral: "#3 \"Kick\"", the Master as "#0")
  52. const auto name = mixer[track]["name"].toString();
  53. return "#" + juce::String (track) + (name.isNotEmpty() ? " \"" + name + "\"" : juce::String());
  54. }
  55. // "a, b, c" (at most four, then "…")
  56. juce::String listOf (const juce::StringArray& names)
  57. {
  58. juce::StringArray shown;
  59. for (int i = 0; i < names.size() && i < 4; ++i)
  60. shown.add (names[i]);
  61. return shown.joinIntoString (", ") + (names.size() > 4 ? juce::String::fromUTF8 (", \u2026") : juce::String());
  62. }
  63. void forEachChannel (const juce::var& root, const std::function<void (juce::DynamicObject&, int)>& fn)
  64. {
  65. if (auto* channels = arrayOf (root["channels"]))
  66. for (int i = 0; i < channels->size(); ++i)
  67. if (auto* c = objectOf ((*channels)[i]))
  68. fn (*c, i);
  69. }
  70. // every clip array of the project: the Playlist, the stored arrangements, the clip grid's slots
  71. void forEachClip (const juce::var& root, const std::function<void (juce::Array<juce::var>&)>& fn)
  72. {
  73. auto list = [&] (const juce::var& clips) {
  74. if (auto* a = arrayOf (clips))
  75. for (auto& c : *a)
  76. if (auto* fields = arrayOf (c))
  77. fn (*fields);
  78. };
  79. list (root["playlist"]);
  80. if (auto* arrangements = arrayOf (root["arrangements"]))
  81. for (const auto& a : *arrangements)
  82. list (a["clips"]);
  83. if (auto* slots = arrayOf (root["clipGrid"]["clips"]))
  84. for (const auto& s : *slots)
  85. list (s["clip"]);
  86. }
  87. // Every effect object below `v` (the mixer's slots, a Patcher's nodes, a rack's branches): `fn (effect, where)`, `where`
  88. // the insert ("#3 \"Vox\"") of a mixer slot, else "Patcher"
  89. void forEachEffect (const juce::var& root, const std::function<void (juce::DynamicObject&, const juce::String&)>& fn)
  90. {
  91. std::function<void (const juce::var&, const juce::String&)> walk = [&] (const juce::var& v, const juce::String& where) {
  92. if (auto* a = arrayOf (v))
  93. {
  94. for (auto& item : *a)
  95. walk (item, where);
  96. return;
  97. }
  98. auto* o = objectOf (v);
  99. if (o == nullptr)
  100. return;
  101. if (o->getProperty ("kind").isString() && o->getProperty ("params").isArray())
  102. fn (*o, where);
  103. for (auto& p : o->getProperties())
  104. walk (p.value, "Patcher");
  105. };
  106. if (auto* mixer = arrayOf (root["mixer"]))
  107. for (int t = 0; t < mixer->size(); ++t)
  108. if (auto* fx = arrayOf ((*mixer)[t]["effects"]))
  109. for (auto& e : *fx)
  110. {
  111. if (auto* o = objectOf (e); o != nullptr && o->getProperty ("kind").isString() && o->getProperty ("params").isArray())
  112. fn (*o, insertName (root["mixer"], t));
  113. if (auto* o = objectOf (e))
  114. for (auto& p : o->getProperties())
  115. walk (p.value, "Patcher");
  116. }
  117. if (auto* channels = arrayOf (root["channels"]))
  118. for (auto& c : *channels)
  119. if (auto* o = objectOf (c))
  120. for (auto& p : o->getProperties())
  121. walk (p.value, "Patcher");
  122. }
  123. void addOnce (juce::StringArray& list, const juce::String& item)
  124. {
  125. if (! list.contains (item))
  126. list.add (item);
  127. }
  128. void flattenEffects (juce::var& root, const juce::StringArray& kinds, const char* loss, Losses& lost);
  129. // Rollup 0.1.30 (round 190il): what the other 0.1.30 rounds save that 0.1.28 cannot hold (round 190hq's step above
  130. // knew only its own). Each loss is reported only when the project has it.
  131. void toRelease0128FromRollup030 (juce::var& root, Losses& lost)
  132. {
  133. auto& o = *objectOf (root);
  134. // round 190kk: the engines Live's Erosion (and the next lot) open on are not in 0.1.28
  135. flattenEffects (root, { "corrode" },
  136. TR_NOOP ("Corrode (an imported Live Erosion) is not in this release: it becomes a switched-off Utility in its slot, and its automation does nothing ({0})"),
  137. lost);
  138. flattenEffects (root, { "platter" },
  139. TR_NOOP ("Platter (an imported Live Vinyl Distortion) is not in this release: it becomes a switched-off Utility in its slot, and its automation does nothing ({0})"),
  140. lost);
  141. flattenEffects (root, { "soundboard" },
  142. TR_NOOP ("Soundboard (an imported Live Corpus) is not in this release: it becomes a switched-off Utility in its slot, and its automation does nothing ({0})"),
  143. lost);
  144. // round 190ko: Live's Spectral Time / Spectral Resonator engines
  145. flattenEffects (root, { "timeprism" },
  146. TR_NOOP ("Timeprism (an imported Live Spectral Time) is not in this release: it becomes a switched-off Utility in its slot, and its automation does nothing ({0})"),
  147. lost);
  148. flattenEffects (root, { "harmonia" },
  149. TR_NOOP ("Harmonia (an imported Live Spectral Resonator) is not in this release: it becomes a switched-off Utility in its slot, and its automation does nothing ({0})"),
  150. lost);
  151. // channels: Tetra (round 190hs) is not in 0.1.28, which would play its channels as its basic synth: an empty Sampler
  152. // (silent) keeps the channel, its notes and its routing; DirectWave states (rounds 190hz / 190ii) get their short zone
  153. // records completed as DirectWave reads them, since 0.1.28 skipped them (FL's version-36 programs lost their loops)
  154. {
  155. juce::StringArray tetra, helix, braid;
  156. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  157. const auto instrument = c.getProperty ("instrument").toString();
  158. if (instrument == "tetra" || instrument == "helix" || instrument == "braid") // (rollup step 3: Helix, round 190ja, as Tetra; Braid, 190ko; LYNX Model, 190ni: the 0.1.30 step)
  159. {
  160. (instrument == "tetra" ? tetra : instrument == "helix" ? helix : braid).add (channelName (juce::var (&c), i));
  161. c.setProperty ("instrument", "sampler");
  162. drop (c, "modelParams");
  163. drop (c, "pluginState");
  164. drop (c, "samplePath");
  165. }
  166. else if (instrument == "directwave")
  167. {
  168. juce::MemoryOutputStream decoded;
  169. if (! juce::Base64::convertFromBase64 (decoded, c.getProperty ("pluginState").toString()))
  170. return;
  171. const auto* bytes = static_cast<const std::uint8_t*> (decoded.getData());
  172. auto doc = dw::readDoc (std::vector<std::uint8_t> (bytes, bytes + decoded.getDataSize()));
  173. if (doc && dw::completeShortZoneRecords (*doc) > 0)
  174. {
  175. const auto state = dw::writeDoc (*doc);
  176. c.setProperty ("pluginState", juce::Base64::toBase64 (state.data(), state.size()));
  177. }
  178. }
  179. });
  180. if (! tetra.isEmpty())
  181. lost.push_back ({ TR_NOOP ("Tetra is not in this release: its channels become empty Samplers and play nothing: {0}"), listOf (tetra), true });
  182. if (! helix.isEmpty())
  183. lost.push_back ({ TR_NOOP ("Helix is not in this release: its channels become empty Samplers and play nothing: {0}"), listOf (helix), true });
  184. if (! braid.isEmpty())
  185. lost.push_back ({ TR_NOOP ("Braid is not in this release: its channels become empty Samplers and play nothing: {0}"), listOf (braid), true });
  186. }
  187. // notes: index 19 holds a note's MPE curves (round 190hy); rollup step 11: index 20 its FL note repeat (round 190ma,
  188. // issue #208), written with a null curves slot when the note has no curves
  189. {
  190. int curved = 0, repeated = 0;
  191. if (auto* patterns = arrayOf (root["patterns"]))
  192. for (auto& p : *patterns)
  193. if (auto* notes = arrayOf (p["notes"]))
  194. for (auto& n : *notes)
  195. if (auto* fields = arrayOf (n); fields != nullptr && fields->size() > 19)
  196. {
  197. if (! (*fields)[19].isVoid() && ! (*fields)[19].isUndefined())
  198. ++curved;
  199. if (fields->size() > 20 && (int) (*fields)[20] != 0)
  200. ++repeated;
  201. fields->removeRange (19, fields->size() - 19);
  202. }
  203. if (curved > 0)
  204. lost.push_back ({ TR_NOOP ("{0} note(s) lose their MPE curves (pitch bend, slide, pressure)"), juce::String (curved), true });
  205. if (repeated > 0)
  206. lost.push_back ({ TR_NOOP ("{0} note(s) play once instead of repeating (FL's note Repeat)"), juce::String (repeated), true });
  207. }
  208. // Pattern Blocks: a third element marks a muted block (round 190ht); 0.1.28 reads only [pattern, start] and drops
  209. // any other block. A muted block plays nothing, so it is left out (the sound stays); the rest keep their two.
  210. {
  211. int muted = 0;
  212. auto blocks = [&muted] (const juce::var& list) {
  213. if (auto* a = arrayOf (list))
  214. for (int i = a->size(); --i >= 0;)
  215. if (auto* b = arrayOf ((*a)[i]); b != nullptr && b->size() > 2)
  216. {
  217. if ((int) (*b)[2] != 0)
  218. {
  219. a->remove (i);
  220. ++muted;
  221. }
  222. else
  223. b->removeRange (2, b->size() - 2);
  224. }
  225. };
  226. blocks (root["blocks"]);
  227. if (auto* arrangements = arrayOf (root["arrangements"]))
  228. for (const auto& a : *arrangements)
  229. blocks (a["blocks"]);
  230. if (muted > 0)
  231. lost.push_back ({ TR_NOOP ("{0} muted Pattern Block(s) are left out (they play nothing)"), juce::String (muted), false });
  232. }
  233. // clips: index 13 is the clip's pitch, ±48 semitones since round 190hr (0.1.28 holds ±12)
  234. {
  235. int transposed = 0;
  236. forEachClip (root, [&] (juce::Array<juce::var>& clip) {
  237. if (clip.size() > 13)
  238. if (const auto pitch = (double) clip[13]; std::abs (pitch) > 12.0)
  239. {
  240. clip.set (13, juce::jlimit (-12.0, 12.0, pitch));
  241. ++transposed;
  242. }
  243. });
  244. if (transposed > 0)
  245. lost.push_back ({ TR_NOOP ("{0} clip(s) transposed by more than 12 semitones play at ±12"), juce::String (transposed), true });
  246. }
  247. // clip slots (round 190hr): the Start marker inside the loop, the clip's own scale
  248. {
  249. int markers = 0, scales = 0;
  250. if (auto* slots = arrayOf (root["clipGrid"]["clips"]))
  251. for (auto& slot : *slots)
  252. if (auto* so = objectOf (slot))
  253. {
  254. markers += drop (*so, "startMarker") ? 1 : 0;
  255. scales += drop (*so, "clipScale") ? 1 : 0;
  256. }
  257. if (markers > 0)
  258. lost.push_back ({ TR_NOOP ("{0} clip slot(s) launch from their loop start (the Start marker inside the loop)"), juce::String (markers), true });
  259. if (scales > 0)
  260. lost.push_back ({ TR_NOOP ("Clip scales (Scale Mode) of {0} clip slot(s)"), juce::String (scales), false });
  261. }
  262. // effects (round 190ho): Voice Shift's Measured law revision 1, Ridge Strip's 4K Pink EQ; (round 190iq) Hush De-esser's
  263. // measured Allround timing (hidden parameters 0.1.28 ignores: it plays revision 0, Black, and the earlier timing)
  264. {
  265. juce::StringArray thump, pink, consoleFilters, lineLaw, hybridLoop, valhallaLoop, luxeSpace, hushTiming, hushVocal, echoVoicings, latticeTaps, luxeDucking, verbRevisions,
  266. omni, hushRen, gLaw;
  267. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  268. auto* params = arrayOf (e.getProperty ("params"));
  269. if (params == nullptr) // (a slot written without parameters)
  270. return;
  271. const auto kind = e.getProperty ("kind").toString();
  272. if (kind == "voiceShift" && params->size() > voiceshift::revision)
  273. {
  274. if ((float) (double) (*params)[voiceshift::law] >= 0.5f && (float) (double) (*params)[voiceshift::revision] >= 0.5f)
  275. addOnce (thump, where);
  276. params->removeRange (voiceshift::revision, params->size() - voiceshift::revision);
  277. }
  278. else if (kind == "ridgeStrip" && params->size() > mixsuite::ridge::k4Pink)
  279. {
  280. if ((float) (double) (*params)[mixsuite::ridge::k4Pink] >= 0.5f)
  281. addOnce (pink, where);
  282. // rollup step 12: round 190mm's omni law [100 …] (set only by the Waves Scheps Omni Channel translator)
  283. if (params->size() > mixsuite::ridge::omniLaw && (float) (double) (*params)[mixsuite::ridge::omniLaw] >= 0.5f)
  284. addOnce (omni, where);
  285. // rollup step 13: round 190mt's G-Channel EQ law [93 …] (set only by the Waves SSL G-Channel translator)
  286. if (params->size() > mixsuite::ridge::gEqLaw && (float) (double) (*params)[mixsuite::ridge::gEqLaw] >= 0.5f)
  287. addOnce (gLaw, where);
  288. // rollup step 8: round 190lb's SSL 4K G / 4K E filters (and the G's ceiling), round 190le's 32C voicing
  289. for (const auto hidden : { mixsuite::ridge::k4gLaw, mixsuite::ridge::k4eHpLaw, mixsuite::ridge::h32 })
  290. if (params->size() > hidden && (float) (double) (*params)[hidden] >= 0.5f)
  291. addOnce (consoleFilters, where);
  292. params->removeRange (mixsuite::ridge::k4Pink, params->size() - mixsuite::ridge::k4Pink);
  293. }
  294. else if (kind == "hushDeEsser" && params->size() > mixsuite::hush::timing)
  295. {
  296. // rollup step 12: round 190mm's Renaissance de-esser law [essLaw …] (set only by the RDeEsser translator)
  297. if (params->size() > mixsuite::hush::essLaw && (float) (double) (*params)[mixsuite::hush::essLaw] >= 0.5f)
  298. addOnce (hushRen, where);
  299. // (the timing is the Allround law's: Single Vocal plays the same either way)
  300. if ((float) (double) (*params)[mixsuite::hush::timing] >= 0.5f && (float) (double) (*params)[mixsuite::hush::allround] >= 0.5f)
  301. addOnce (hushTiming, where);
  302. // rollup step 5, round 190js: Single Vocal's "stands out" revision (hidden, after the timing; Allround ignores it)
  303. if (params->size() > mixsuite::hush::vocalRevision && (float) (double) (*params)[mixsuite::hush::vocalRevision] >= 0.5f
  304. && (float) (double) (*params)[mixsuite::hush::allround] < 0.5f)
  305. addOnce (hushVocal, where);
  306. params->removeRange (mixsuite::hush::timing, params->size() - mixsuite::hush::timing);
  307. }
  308. // rollup step 3: round 190is's Echoform voicings revision (heard only with an echo voicing), round 190it's
  309. // reverb revisions (the Measured law's: Law 1), Lattice Mod's tap network and LuxeVerb's Space ducking
  310. else if (kind == "echoform" && params->size() > echosuite::echoform::revision)
  311. {
  312. if ((float) (double) (*params)[echosuite::echoform::revision] >= 0.5f && (float) (double) (*params)[echosuite::echoform::voicing] >= 0.5f)
  313. addOnce (echoVoicings, where);
  314. // rollup step 8: round 190kw's line law (set only by a translated FabFilter Timeless 3 state)
  315. if (params->size() > echosuite::echoform::lineLaw && (float) (double) (*params)[echosuite::echoform::lineLaw] >= 0.5f)
  316. addOnce (lineLaw, where);
  317. // rollup step 9: round 190lf's H-Delay loop law (set only by a translated Waves H-Delay state; read with the
  318. // hybrid engine on)
  319. if (params->size() > echosuite::echoform::hybridLaw && (float) (double) (*params)[echosuite::echoform::hybridLaw] >= 0.5f)
  320. addOnce (hybridLoop, where);
  321. // rollup step 10: round 190ly's ValhallaDelay loop law (set only by a translated ValhallaDelay; without a voicing)
  322. if (params->size() > echosuite::echoform::valhallaLaw && (float) (double) (*params)[echosuite::echoform::valhallaLaw] >= 0.5f)
  323. addOnce (valhallaLoop, where);
  324. params->removeRange (echosuite::echoform::revision, params->size() - echosuite::echoform::revision);
  325. }
  326. else if (kind == "latticeMod" && params->size() > echosuite::lattice::revision)
  327. {
  328. if ((float) (double) (*params)[echosuite::lattice::revision] >= 0.5f)
  329. addOnce (latticeTaps, where);
  330. params->removeRange (echosuite::lattice::revision, params->size() - echosuite::lattice::revision);
  331. }
  332. else if (kind == "luxeVerb" && params->size() > luxeVerbSpaceDucking)
  333. {
  334. if ((float) (double) (*params)[luxeVerbSpaceDucking] > 0.0f)
  335. addOnce (luxeDucking, where);
  336. // rollup step 10: round 190kw / 190lp / 190lz's Space engine revision 1 (every new LuxeVerb; heard only with
  337. // the Space engine on) and its Stereo Width past 100 % go with it
  338. if (params->size() > luxeVerbSpaceRevision && (float) (double) (*params)[luxeVerbSpaceRevision] >= 0.5f
  339. && (float) (double) (*params)[luxeVerbSpaceFirst] >= 0.5f)
  340. addOnce (luxeSpace, where);
  341. params->removeRange (luxeVerbSpaceDucking, params->size() - luxeVerbSpaceDucking);
  342. }
  343. else
  344. {
  345. const auto verb = [&] (const char* id, int law, int revision) {
  346. if (kind != id || params->size() <= revision)
  347. return;
  348. if ((float) (double) (*params)[revision] >= 0.5f && (float) (double) (*params)[law] >= 0.5f)
  349. addOnce (verbRevisions, where);
  350. params->removeRange (revision, params->size() - revision);
  351. };
  352. verb ("epochVerb", verbs::epoch::engineLaw, verbs::epoch::revision);
  353. verb ("atrium", verbs::atrium::engineLaw, verbs::atrium::revision);
  354. verb ("foilPlate", verbs::foil::engineLaw, verbs::foil::revision);
  355. verb ("halo", verbs::halo::engineLaw, verbs::halo::revision);
  356. }
  357. });
  358. if (! thump.isEmpty())
  359. lost.push_back ({ TR_NOOP ("Voice Shift's Measured law plays its earlier version (a low thump at sung onsets): {0}"), listOf (thump), true });
  360. if (! pink.isEmpty())
  361. lost.push_back ({ TR_NOOP ("Ridge Strip's 4K Pink EQ plays as the Black EQ: {0}"), listOf (pink), true });
  362. if (! consoleFilters.isEmpty())
  363. lost.push_back ({ TR_NOOP ("Ridge Strip's measured SSL 4K G / 4K E filters and its 32C voicing are left out: {0}"), listOf (consoleFilters), true });
  364. if (! lineLaw.isEmpty())
  365. lost.push_back ({ TR_NOOP ("Echoform's Timeless 3 line law plays as its own echo: {0}"), listOf (lineLaw), true });
  366. if (! valhallaLoop.isEmpty())
  367. lost.push_back ({ TR_NOOP ("Echoform's ValhallaDelay loop law (the ValhallaDelay stand-in) plays as its own echo: {0}"), listOf (valhallaLoop), true });
  368. if (! luxeSpace.isEmpty())
  369. lost.push_back ({ TR_NOOP ("LuxeVerb's Space engine plays its earlier version (not the Pro-R 2 laws): {0}"), listOf (luxeSpace), true });
  370. if (! hybridLoop.isEmpty())
  371. lost.push_back ({ TR_NOOP ("Echoform's H-Delay loop law (the Waves H-Delay stand-in) plays as its plain hybrid echo: {0}"), listOf (hybridLoop), true });
  372. if (! hushTiming.isEmpty())
  373. lost.push_back ({ TR_NOOP ("Hush De-esser's Allround mode plays its earlier timing: {0}"), listOf (hushTiming), true });
  374. if (! hushVocal.isEmpty())
  375. lost.push_back ({ TR_NOOP ("Hush De-esser's Single Vocal mode plays its earlier version: {0}"), listOf (hushVocal), true });
  376. if (! omni.isEmpty())
  377. lost.push_back ({ TR_NOOP ("Ridge Strip's omni law (the Waves Scheps Omni Channel stand-in) is left out: it plays Ridge's own strip: {0}"), listOf (omni), true });
  378. if (! gLaw.isEmpty())
  379. lost.push_back ({ TR_NOOP ("Ridge Strip's G-Channel EQ law (the Waves SSL G-Channel stand-in) plays Ridge's own E bands: {0}"), listOf (gLaw), true });
  380. if (! hushRen.isEmpty())
  381. lost.push_back ({ TR_NOOP ("Hush De-esser's Renaissance law (the Waves RDeEsser stand-in) plays Hush's own de-esser: {0}"), listOf (hushRen), true });
  382. if (! echoVoicings.isEmpty())
  383. lost.push_back ({ TR_NOOP ("Echoform's echo voicings play their earlier loop: {0}"), listOf (echoVoicings), true });
  384. if (! verbRevisions.isEmpty())
  385. lost.push_back ({ TR_NOOP ("Epoch Verb, Atrium, Foil Plate and Halo play the 0.1.27 version of their Measured law: {0}"), listOf (verbRevisions), true });
  386. if (! latticeTaps.isEmpty())
  387. lost.push_back ({ TR_NOOP ("Lattice Mod plays its earlier tap network: {0}"), listOf (latticeTaps), true });
  388. if (! luxeDucking.isEmpty())
  389. lost.push_back ({ TR_NOOP ("LuxeVerb's Space ducking is not in this release: {0}"), listOf (luxeDucking), true });
  390. }
  391. // rollup step 3, round 190ik (warp engines): an 11-number warpModes list (the Texture / Complex Pro law), Beats'
  392. // pitch-aware law (0.1.28 reads it as Measured), Complex Pro / Texture transpositions rendered offline (0.1.28
  393. // renders a baked pitch only for Beats: it goes to the Pitch knob, as 0.1.28 itself moves it)
  394. {
  395. juce::StringArray pitchAware, newEngines, knobPitch;
  396. bool warped = false;
  397. // (a project saved by this build has the mark; a channel without its own list then plays the pitch-aware Beats
  398. // and the Measured Texture / Complex Pro laws, which 0.1.28 reads as Measured Beats and its Classic engines)
  399. const auto marked = (bool) root.getProperty ("warpLaw190ik", false);
  400. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  401. auto* sampler = objectOf (c.getProperty ("samplerSettings"));
  402. if (sampler == nullptr)
  403. return;
  404. const juce::var sv (sampler);
  405. const auto method = (int) sv.getProperty ("stretchMethod", 0); // (StretchMethod: 3 Beats, 5 Texture, 6 Complex)
  406. const auto stretched = (double) sv.getProperty ("stretchBeats", 0.0) > 0.0;
  407. const auto keepsPitch = (bool) sv.getProperty ("keepPitch", false);
  408. warped = warped || stretched;
  409. auto* list = arrayOf (sampler->getProperty ("warpModes"));
  410. const auto listed = list != nullptr && list->size() >= 9;
  411. const auto beatsLaw = listed && list->size() > 9 ? (double) (*list)[9] : 2.0;
  412. const auto warpLaw = listed && list->size() > 10 ? (double) (*list)[10] : 1.0;
  413. const auto complexPro = listed && (double) (*list)[8] != 0.0;
  414. if (marked && stretched && keepsPitch && method == 3 && beatsLaw >= 1.5)
  415. pitchAware.add (channelName (juce::var (&c), i));
  416. if (marked && stretched && keepsPitch && warpLaw >= 0.5 && (method == 5 || (method == 6 && complexPro)))
  417. newEngines.add (channelName (juce::var (&c), i));
  418. if (list != nullptr && list->size() > 10)
  419. {
  420. if (beatsLaw >= 1.5)
  421. list->set (9, 1.0);
  422. list->removeRange (10, list->size() - 10);
  423. }
  424. if (const auto baked = (double) sv.getProperty ("stretchPitch", 0.0); baked != 0.0 && method != 3)
  425. {
  426. sampler->setProperty ("pitch", juce::jlimit (-24.0, 24.0, (double) sv.getProperty ("pitch", 0.0) + baked));
  427. sampler->removeProperty ("stretchPitch");
  428. knobPitch.add (channelName (juce::var (&c), i));
  429. }
  430. });
  431. if (! pitchAware.isEmpty())
  432. lost.push_back ({ TR_NOOP ("Beats' pitch-aware cuts play as the Measured law: {0}"), listOf (pitchAware), true });
  433. if (! newEngines.isEmpty())
  434. lost.push_back ({ TR_NOOP ("Texture and Complex Pro play their earlier engine (no grains or formants): {0}"), listOf (newEngines), true });
  435. if (! knobPitch.isEmpty())
  436. lost.push_back ({ TR_NOOP ("Complex Pro and Texture transpositions play through the Pitch knob: {0}"), listOf (knobPitch), true });
  437. // issue #187 (round 190ik): engine behaviour, nothing to drop; reported when warped samples meet tempo automation
  438. bool tempoAutomation = false;
  439. if (auto* automations = arrayOf (root["automations"]))
  440. for (const auto& a : *automations)
  441. tempoAutomation = tempoAutomation || a["target"][0].toString() == "tempo";
  442. if (warped && tempoAutomation)
  443. lost.push_back ({ TR_NOOP ("Warped samples do not follow tempo changes in this release: they keep the project tempo"), {}, true });
  444. }
  445. // rollup step 3, round 190im (R12): Live's deactivated clip slots ("inactive"); 0.1.28 plays them
  446. {
  447. int inactive = 0;
  448. if (auto* slots = arrayOf (root["clipGrid"]["clips"]))
  449. for (auto& slot : *slots)
  450. if (auto* so = objectOf (slot))
  451. inactive += drop (*so, "inactive") ? 1 : 0;
  452. if (inactive > 0)
  453. lost.push_back ({ TR_NOOP ("{0} deactivated clip slot(s) play again"), juce::String (inactive), true });
  454. }
  455. // round 190lr (DL-14): Live's scene follow actions ("follow" on a scene); 0.1.28 has none
  456. {
  457. int follows = 0;
  458. if (auto* scenes = arrayOf (root["clipGrid"]["scenes"]))
  459. for (auto& scene : *scenes)
  460. if (auto* so = objectOf (scene))
  461. follows += drop (*so, "follow") ? 1 : 0;
  462. if (follows > 0)
  463. lost.push_back ({ TR_NOOP ("{0} scene follow action(s) are left out"), juce::String (follows), true });
  464. }
  465. // rollup step 4, round 190jh: Facet EQ's automatic dynamic thresholds (hidden parameters past its count; 0.1.28 plays
  466. // those bands with their manual threshold)
  467. {
  468. juce::StringArray autoBands, dispersion, puig, wavesEq, api560;
  469. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  470. auto* params = arrayOf (e.getProperty ("params"));
  471. if (params == nullptr || e.getProperty ("kind").toString() != "facetEq" || params->size() <= facet::autoThresholdParam0)
  472. return;
  473. for (int b = 0; b < 8 && facet::autoThresholdParam0 + b < params->size(); ++b)
  474. if ((float) (double) (*params)[facet::autoThresholdParam0 + b] >= 0.5f)
  475. addOnce (autoBands, where);
  476. // rollup step 9: round 190lg's automatic-threshold revision [125] goes with the bands' automatic thresholds (above);
  477. // round 190ln's all-pass dispersion [126 … 128] (set only by a translated Kilohearts Disperser state)
  478. if (params->size() > facet::dispersionCountParam && facet::dispersionSections ((float) (double) (*params)[facet::dispersionCountParam]) > 0)
  479. addOnce (dispersion, where);
  480. // rollup step 11: round 190mg's PuigTec law [129] (set only by a translated Waves PuigTec EQP1A state)
  481. if (params->size() > facet::puigLawParam && facet::puigLaw ((float) (double) (*params)[facet::puigLawParam]) > 0)
  482. addOnce (puig, where);
  483. // rollup step 12: round 190mm's Waves design law [130] + band codes [131 …] (set only by the Renaissance EQ /
  484. // Q10 / RChannel translators)
  485. if (params->size() > facet::wavesLawParam && (float) (double) (*params)[facet::wavesLawParam] >= 0.5f)
  486. addOnce (wavesEq, where);
  487. // rollup step 13: round 190mt's API-560 law [139] + slider gains [140 …] (set only by the Waves API-560 translator;
  488. // its Q10 codes 14 / 15 go with the Waves design law above)
  489. if (params->size() > facet::api560LawParam && (float) (double) (*params)[facet::api560LawParam] >= 0.5f)
  490. addOnce (api560, where);
  491. params->removeRange (facet::autoThresholdParam0, params->size() - facet::autoThresholdParam0);
  492. });
  493. if (! autoBands.isEmpty())
  494. lost.push_back ({ TR_NOOP ("Facet EQ's automatic dynamic thresholds play with the bands' manual threshold: {0}"), listOf (autoBands), true });
  495. if (! dispersion.isEmpty())
  496. lost.push_back ({ TR_NOOP ("Facet EQ's all-pass dispersion (the Kilohearts Disperser stand-in) is left out: {0}"), listOf (dispersion), true });
  497. if (! puig.isEmpty())
  498. lost.push_back ({ TR_NOOP ("Facet EQ's PuigTec law (the Waves PuigTec stand-in: its output stage and mains hum) is left out: {0}"), listOf (puig), true });
  499. if (! wavesEq.isEmpty())
  500. lost.push_back ({ TR_NOOP ("Facet EQ's Waves design law (the Renaissance EQ and Q10 stand-ins) plays Facet's own band shapes: {0}"), listOf (wavesEq), true });
  501. if (! api560.isEmpty())
  502. lost.push_back ({ TR_NOOP ("Facet EQ's API-560 law (the Waves API-560 stand-in) plays Facet's own bands: {0}"), listOf (api560), true });
  503. }
  504. // rollup step 4, round 190jl: MIDI Out channels and the plugin wrappers' Output port reach hardware MIDI outputs from
  505. // 0.1.30 on (0.1.28 sends them to plugins on that port only); engine behaviour, nothing to drop
  506. {
  507. juce::StringArray hardware;
  508. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  509. // (the wrapper's "midiOutPort" is written only when it has a port)
  510. if (c.getProperty ("instrument").toString() == "midiOut" || c.getProperty ("plugin").hasProperty ("midiOutPort"))
  511. addOnce (hardware, channelName (juce::var (&c), i));
  512. });
  513. if (! hardware.isEmpty())
  514. lost.push_back ({ TR_NOOP ("MIDI Out channels and plugins' MIDI output reach only plugins in this release, not hardware MIDI outputs: {0}"), listOf (hardware), true });
  515. }
  516. // rollup step 4, round 190jg: sample-accurate automation of hosted CLAP / VST3 plugins (0.1.28 applies a change once
  517. // per piece of up to 128 samples); engine behaviour, reported when automation drives such a plugin's parameter
  518. {
  519. const auto hosted = [] (const juce::var& plugin) {
  520. const auto id = plugin["id"].toString();
  521. return id.startsWith ("VST3-") || id.startsWith ("CLAP-");
  522. };
  523. bool timed = false;
  524. std::function<void (const juce::var&)> walk = [&] (const juce::var& v) {
  525. if (timed)
  526. return;
  527. if (auto* a = arrayOf (v))
  528. {
  529. for (const auto& item : *a)
  530. walk (item);
  531. return;
  532. }
  533. auto* o = objectOf (v);
  534. if (o == nullptr)
  535. return;
  536. if (const auto& target = o->getProperty ("target"); target.isArray() && target.size() >= 4)
  537. {
  538. const auto kind = target[0].toString();
  539. const auto index = (int) target[1], slot = (int) target[2];
  540. if (kind == "channelParam")
  541. timed = root["channels"][index]["instrument"].toString() == "plugin" && hosted (root["channels"][index]["plugin"]);
  542. else if (kind == "effectParam")
  543. timed = root["mixer"][index]["effects"][slot]["kind"].toString() == "plugin" && hosted (root["mixer"][index]["effects"][slot]["plugin"]);
  544. }
  545. for (const auto& p : o->getProperties())
  546. walk (p.value);
  547. };
  548. walk (root["automations"]);
  549. walk (root["patterns"]);
  550. walk (root["playlistTracks"]);
  551. if (timed)
  552. lost.push_back ({ TR_NOOP ("Automation of hosted CLAP and VST3 plugins changes once per 128 samples in this release (0.1.30 places each change at its own sample)"), {}, true });
  553. }
  554. // rollup step 5, round 190jv: on FL's native generators a slide note moves in steps, once per tick of the project, as
  555. // in FL (0.1.28 glides straight, except Slicex, which stepped already); engine behaviour, nothing to drop
  556. {
  557. juce::StringArray stepped;
  558. const auto* channels = arrayOf (root["channels"]);
  559. if (auto* patterns = arrayOf (root["patterns"]))
  560. for (const auto& p : *patterns)
  561. if (auto* notes = arrayOf (p["notes"]))
  562. for (const auto& n : *notes)
  563. if (n.isArray() && n.size() >= 9 && (bool) n[8]) // [start, length, channel, key, velocity, pan, fine, muted, slide, ..]
  564. {
  565. const auto ch = (int) n[2];
  566. if (channels == nullptr || ch < 0 || ch >= channels->size())
  567. continue;
  568. const auto& c = channels->getReference (ch);
  569. const auto kind = genpresets::kindFromId (c["instrument"].toString().toStdString());
  570. if (kind && *kind != InstrumentKind::slicex && RackRenderer::stepsSlides (*kind))
  571. addOnce (stepped, channelName (c, ch));
  572. }
  573. if (! stepped.isEmpty())
  574. lost.push_back ({ TR_NOOP ("Slide notes on FL's native generators glide instead of stepping once per tick: {0}"), listOf (stepped), true });
  575. }
  576. // rollup step 6, round 190kc: Live's crossfader (Crossfade Assign per insert, the Main's position and curve, its
  577. // automation target "crossfader", which 0.1.28 reads as no target) and the return tracks' flags (a return is an
  578. // insert like any other: 0.1.28 routes it the same, its sends are ordinary sends)
  579. {
  580. juce::StringArray assigned, returns;
  581. if (auto* mixer = arrayOf (root["mixer"]))
  582. for (int t = 0; t < mixer->size(); ++t)
  583. if (auto* m = objectOf ((*mixer)[t]))
  584. {
  585. if (drop (*m, "crossfade"))
  586. addOnce (assigned, insertName (root["mixer"], t));
  587. if (m->getProperty ("liveReturn").isBool() && (bool) m->getProperty ("liveReturn"))
  588. addOnce (returns, insertName (root["mixer"], t));
  589. drop (*m, "liveReturn");
  590. drop (*m, "returnPre");
  591. drop (*m, "returnSendsOn");
  592. }
  593. drop (o, "crossfader");
  594. drop (o, "crossfadeCurve");
  595. if (! assigned.isEmpty())
  596. lost.push_back ({ TR_NOOP ("The crossfader (Live's Crossfade Assign) is not in this release: these inserts play at their full level, and its automation does nothing: {0}"),
  597. listOf (assigned), true });
  598. if (! returns.isEmpty())
  599. lost.push_back ({ TR_NOOP ("Live return tracks show as ordinary mixer inserts: {0}"), listOf (returns), false });
  600. }
  601. // rollup step 6, round 190ke: the Simple dock's Controls tab and its own knob mapping (0.1.28 has no Controls tab)
  602. {
  603. juce::StringArray mapped;
  604. if (auto* mixer = arrayOf (root["mixer"]))
  605. for (int t = 0; t < mixer->size(); ++t)
  606. if (auto* m = objectOf ((*mixer)[t]); m != nullptr && drop (*m, "smartControls"))
  607. addOnce (mapped, insertName (root["mixer"], t));
  608. if (! mapped.isEmpty())
  609. lost.push_back ({ TR_NOOP ("The Simple Controls tab's own knob mappings: {0}"), listOf (mapped), false });
  610. }
  611. // round 190kz: EffectSlot::engineRev (Maximus 1 = its gain smoothers in double precision; 0.1.28 runs the x87 ones,
  612. // which gave the same samples on every Maximus state measured): dropped, nothing to report
  613. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String&) { drop (e, "engineRev"); });
  614. // rollup step 6, round natives190kj: ChannelDef::engineRev (Harmor 1 = a part with a sample in its IMG section plays
  615. // FL's resynthesis; 0.1.28 plays such a part's timbres) and Newtone's state version 3 (+ the key, each note's voiced
  616. // end and velocity): 0.1.28 reads up to version 2 and would load no notes at all, so the state is written as version
  617. // 2 (the notes and every edit kept; the voiced end only shaped the analysed smooth times, which are saved)
  618. {
  619. juce::StringArray resynth, newtone, natural;
  620. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  621. const auto rev = (int) c.getProperty ("engineRev");
  622. if (drop (c, "engineRev") && rev >= 1 && c.getProperty ("instrument").toString() == "harmor")
  623. {
  624. juce::MemoryOutputStream decoded;
  625. if (juce::Base64::convertFromBase64 (decoded, c.getProperty ("pluginState").toString()))
  626. {
  627. const auto* bytes = static_cast<const std::uint8_t*> (decoded.getData());
  628. if (harmorUsesResynthesis (std::vector<std::uint8_t> (bytes, bytes + decoded.getDataSize())))
  629. addOnce (resynth, channelName (juce::var (&c), i));
  630. }
  631. }
  632. });
  633. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  634. if (e.getProperty ("kind").toString() != "newtone")
  635. return;
  636. juce::MemoryOutputStream decoded;
  637. if (! juce::Base64::convertFromBase64 (decoded, e.getProperty ("state").toString()))
  638. return;
  639. const auto* bytes = static_cast<const std::uint8_t*> (decoded.getData());
  640. const std::vector<std::uint8_t> state (bytes, bytes + decoded.getDataSize());
  641. if (newtonefx::nativeVersionOf (state) < 3)
  642. return;
  643. if (const auto track = newtonefx::parseNative (state))
  644. {
  645. const auto older = newtonefx::writeNative (*track, 2);
  646. e.setProperty ("state", juce::Base64::toBase64 (older.data(), older.size()));
  647. addOnce (newtone, where);
  648. if (track->engine != 0) // (round 190li: 0.1.28 renders the notes with Newtone's first engine)
  649. addOnce (natural, where);
  650. }
  651. });
  652. if (! resynth.isEmpty())
  653. lost.push_back ({ TR_NOOP ("Harmor parts with a sample in the IMG section play their timbres instead of the resynthesis: {0}"), listOf (resynth), true });
  654. if (! newtone.isEmpty())
  655. lost.push_back ({ TR_NOOP ("Newtone's detected key and note velocities are left out: {0}"), listOf (newtone), false });
  656. if (! natural.isEmpty())
  657. lost.push_back ({ TR_NOOP ("Newtone's natural pitch engine, pitch modulation and pitch drift are left out (the notes play with the first engine): {0}"), listOf (natural), true });
  658. }
  659. // rollup step 7: round 190kl's extra Peak Controller LFO shapes and round 190kt's console law of Crest's Bus style
  660. // (hidden parameters past the slot's count, written only when set; 0.1.28 plays FL's Shape and the Bus style as it
  661. // was), round 190kn's mixer lock state (0.1.28: a solo elsewhere silences the insert and Unmute All unmutes it),
  662. // round qafix190kq's imported take lanes (0.1.28 gives them columns in the clip grid and the Session mixer) and round
  663. // 190ks's "record the notes played in the plugin's window" switch (written only when off: 0.1.28 never records them)
  664. {
  665. juce::StringArray shapes, console, locked, fet, crestLaws;
  666. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  667. auto* params = arrayOf (e.getProperty ("params"));
  668. if (params == nullptr)
  669. return;
  670. const auto kind = e.getProperty ("kind").toString();
  671. if (kind == "peakController" && params->size() > peakshapes::extraShapeParam)
  672. {
  673. if (peakshapes::idOf ((float) (double) (*params)[peakshapes::extraShapeParam]) != 0)
  674. addOnce (shapes, where);
  675. params->removeRange (peakshapes::extraShapeParam, params->size() - peakshapes::extraShapeParam);
  676. }
  677. else if (kind == "crestCompressor" && params->size() > dyn::crest::busLaw)
  678. {
  679. if ((float) (double) (*params)[dyn::crest::busLaw] >= 0.5f)
  680. addOnce (console, where);
  681. // rollup step 8: round 190ky's FET law (the Waves CLA-76 stand-in), round 190kw's revision 1 (a new Crest:
  682. // the Pro-C 3 laws of its styles; 0.1.28 plays the fitted laws)
  683. const auto at = [params] (int i) { return params->size() > i ? (float) (double) (*params)[i] : 0.0f; };
  684. if (at (dyn::crest::fetLaw) > 0.0f)
  685. addOnce (fet, where);
  686. else if (at (dyn::crest::revision) >= 0.5f && at (dyn::crest::busLaw) < 0.5f)
  687. addOnce (crestLaws, where);
  688. params->removeRange (dyn::crest::busLaw, params->size() - dyn::crest::busLaw);
  689. }
  690. });
  691. bool soloed = false;
  692. if (auto* mixer = arrayOf (root["mixer"]))
  693. for (int t = 0; t < mixer->size(); ++t)
  694. if (auto* m = objectOf ((*mixer)[t]))
  695. {
  696. soloed = soloed || (bool) m->getProperty ("solo");
  697. if (drop (*m, "lockState"))
  698. addOnce (locked, insertName (root["mixer"], t));
  699. }
  700. forEachChannel (root, [&] (juce::DynamicObject& c, int) {
  701. if (auto* plugin = objectOf (c.getProperty ("plugin")))
  702. drop (*plugin, "recordOwnNotes");
  703. });
  704. // rollup step 8: round 190ld's lock states of effect slots and Playlist tracks (a later solo leaves them as they
  705. // are; nothing they play changes)
  706. bool slotLocks = false;
  707. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String&) { slotLocks = drop (e, "lockState") || slotLocks; });
  708. const auto trackLocks = drop (o, "playlistTrackSoloLocks");
  709. if (slotLocks || trackLocks)
  710. lost.push_back ({ TR_NOOP ("Lock states of effect slots and Playlist tracks"), {}, false });
  711. if (auto* mixer = arrayOf (root["mixer"]))
  712. for (auto& m : *mixer)
  713. if (auto* fx = arrayOf (m["effects"]))
  714. for (auto& e : *fx)
  715. if (auto* plugin = objectOf (e["plugin"]))
  716. drop (*plugin, "recordOwnNotes");
  717. if (! shapes.isEmpty())
  718. lost.push_back ({ TR_NOOP ("The Peak Controller's LYNX LFO shapes play its FL Shape: {0}"), listOf (shapes), true });
  719. if (! console.isEmpty())
  720. lost.push_back ({ TR_NOOP ("Crest Compressor's console law (the Waves SSLComp stand-in) plays as its Bus style: {0}"), listOf (console), true });
  721. if (! fet.isEmpty())
  722. lost.push_back ({ TR_NOOP ("Crest Compressor's FET law (the Waves CLA-76 stand-in) plays as its style: {0}"), listOf (fet), true });
  723. if (! crestLaws.isEmpty())
  724. lost.push_back ({ TR_NOOP ("Crest Compressor's styles play their earlier laws (not the reference's): {0}"), listOf (crestLaws), true });
  725. if (! locked.isEmpty())
  726. lost.push_back ({ TR_NOOP ("Mixer lock states (a solo silences these inserts, and Unmute all unmutes them): {0}"), listOf (locked), soloed });
  727. if (auto* lanes = arrayOf (root["playlistTakeLanes"]))
  728. {
  729. const auto count = lanes->size();
  730. drop (o, "playlistTakeLanes");
  731. if (count > 0)
  732. lost.push_back ({ TR_NOOP ("{0} imported take lane(s) get their own columns in the clip grid and the Session mixer"), juce::String (count), false });
  733. }
  734. }
  735. // the view
  736. {
  737. // rollup step 4: round 190jf's nested Playlist folders (0.1.28 opens the groups one level deep), round 190jd's
  738. // second display view of an effect (Fruity Limiter's CURVE; 0.1.28 shows its one view)
  739. if (auto* nests = arrayOf (root["playlistTrackNest"]))
  740. {
  741. const auto count = nests->size();
  742. drop (o, "playlistTrackNest");
  743. if (count > 0)
  744. lost.push_back ({ TR_NOOP ("{0} track(s) in nested Playlist folders open one level deep"), juce::String (count), false });
  745. }
  746. juce::StringArray views, speeds;
  747. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  748. // (rollup step 12: round 190mk keeps Fruity Multiband's display SPEED there too)
  749. const auto multiband = e.getProperty ("kind").toString() == "fruityMultiband";
  750. if (drop (e, "displayView"))
  751. addOnce (multiband ? speeds : views, where);
  752. });
  753. if (! views.isEmpty())
  754. lost.push_back ({ TR_NOOP ("Fruity Limiter's CURVE view (its display shows the scrolling graph): {0}"), listOf (views), false });
  755. if (! speeds.isEmpty())
  756. lost.push_back ({ TR_NOOP ("Fruity Multiband Compressor's display SPEED goes back to its default: {0}"), listOf (speeds), false });
  757. // rollup step 12: round 190mk's zipped Channel rack rows (FL's Zip selected)
  758. int zipped = 0;
  759. forEachChannel (root, [&] (juce::DynamicObject& c, int) {
  760. if (drop (c, "zipped"))
  761. ++zipped;
  762. });
  763. if (zipped > 0)
  764. lost.push_back ({ TR_NOOP ("{0} zipped channel(s) show at full height in the Channel rack"), juce::String (zipped), false });
  765. bool colours = false;
  766. if (auto* automations = arrayOf (root["automations"]))
  767. for (auto& a : *automations)
  768. if (auto* ao = objectOf (a))
  769. colours = drop (*ao, "colour") || colours;
  770. if (colours)
  771. lost.push_back ({ TR_NOOP ("Automation clip colours"), {}, false });
  772. if (drop (o, "mixSnapshots"))
  773. lost.push_back ({ TR_NOOP ("Mix snapshots (the Mixer menu)"), {}, false });
  774. }
  775. // rollup step 9: hidden parameters past the slot's count, written only when set (0.1.28 plays the effect without them):
  776. // round 190kw / 190lg's Saturn laws of Ember (every new Ember, and a translated FabFilter Saturn 2 state), round 190lg's
  777. // Pro-MB band law of Prism Multiband, round 190lf's Waves stand-in laws — L2 on the Limiter, CLA-2A's cell law on Glow
  778. // Leveler, TrueVerb's direct sound on Reeverb 2, NS1's zero law on Quell (each set only by its translator)
  779. {
  780. juce::StringArray saturn, proMb, l2, cell, direct, zero, c4, ns1, c6;
  781. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  782. auto* params = arrayOf (e.getProperty ("params"));
  783. if (params == nullptr)
  784. return;
  785. const auto kind = e.getProperty ("kind").toString();
  786. const auto cut = [params, &where] (int from, juce::StringArray& list) {
  787. if (params->size() <= from)
  788. return;
  789. for (int i = from; i < params->size(); ++i)
  790. if ((float) (double) (*params)[i] != 0.0f)
  791. {
  792. addOnce (list, where);
  793. break;
  794. }
  795. params->removeRange (from, params->size() - from);
  796. };
  797. if (kind == "ember")
  798. {
  799. // (lawRate alone changes nothing without the law)
  800. if (params->size() > mixsuite::ember::revision && (float) (double) (*params)[mixsuite::ember::revision] >= 0.5f)
  801. addOnce (saturn, where);
  802. if (params->size() > mixsuite::ember::revision)
  803. params->removeRange (mixsuite::ember::revision, params->size() - mixsuite::ember::revision);
  804. }
  805. else if (kind == "prismMultiband")
  806. {
  807. // rollup step 11: round 190mg's C4 law [count + 2, + 3] (set only by the Waves C4 translator) has its own line
  808. if (params->size() > dyn::prism::c4Law && (float) (double) (*params)[dyn::prism::c4Law] > 0.0f)
  809. {
  810. addOnce (c4, where);
  811. // rollup step 12: round 190mm's two floating bands of the C6 [c6Float0 …] (on the C4 law)
  812. for (int band = 0; band < 2; ++band)
  813. if (const auto on = dyn::prism::c6Param (band, dyn::prism::c6On); params->size() > on && (float) (double) (*params)[on] >= 0.5f)
  814. addOnce (c6, where);
  815. params->removeRange (dyn::prism::c4Law, params->size() - dyn::prism::c4Law);
  816. }
  817. cut (dyn::prism::revision, proMb);
  818. }
  819. else if (kind == "limiter")
  820. {
  821. if (params->size() > limiterlaw::lawParam && limiterlaw::isL2 ((float) (double) (*params)[limiterlaw::lawParam]))
  822. addOnce (l2, where);
  823. if (params->size() > limiterlaw::lawParam)
  824. params->removeRange (limiterlaw::lawParam, params->size() - limiterlaw::lawParam);
  825. }
  826. else if (kind == "glowLeveler")
  827. cut (mixsuite::glow::cellLaw, cell);
  828. else if (kind == "reeverb2")
  829. cut (reeverb2DirectLaw, direct);
  830. else if (kind == "quellDenoiser")
  831. {
  832. // rollup step 11: round 190mg's NS1 law (after the zero law; set only by the NS1 translator) has its own line
  833. if (params->size() > voicetools::quell::ns1Law && (float) (double) (*params)[voicetools::quell::ns1Law] > 0.0f)
  834. {
  835. addOnce (ns1, where);
  836. params->removeRange (voicetools::quell::ns1Law, params->size() - voicetools::quell::ns1Law);
  837. }
  838. cut (voicetools::quell::zeroLaw, zero);
  839. }
  840. });
  841. if (! saturn.isEmpty())
  842. lost.push_back ({ TR_NOOP ("Ember's Saturn styles play their earlier measured characters (not the reference's): {0}"), listOf (saturn), true });
  843. if (! proMb.isEmpty())
  844. lost.push_back ({ TR_NOOP ("Prism Multiband's Pro-MB band law plays its measured detector: {0}"), listOf (proMb), true });
  845. if (! l2.isEmpty())
  846. lost.push_back ({ TR_NOOP ("The Limiter's L2 law (the Waves L2 stand-in) plays as the classic Limiter: {0}"), listOf (l2), true });
  847. if (! cell.isEmpty())
  848. lost.push_back ({ TR_NOOP ("Glow Leveler's cell law (the Waves CLA-2A stand-in) plays as its Opto voicing: {0}"), listOf (cell), true });
  849. if (! direct.isEmpty())
  850. lost.push_back ({ TR_NOOP ("Reeverb 2's measured direct sound (the Waves TrueVerb stand-in) is left out: {0}"), listOf (direct), true });
  851. if (! zero.isEmpty())
  852. lost.push_back ({ TR_NOOP ("Quell's zero law (the Waves NS1 stand-in) is left out: its lowest Amount settings play the matched engine: {0}"), listOf (zero), true });
  853. if (! c4.isEmpty())
  854. lost.push_back ({ TR_NOOP ("Prism Multiband's C4 law (the Waves C4 stand-in) plays as Prism's own engine: {0}"), listOf (c4), true });
  855. if (! ns1.isEmpty())
  856. lost.push_back ({ TR_NOOP ("Quell's NS1 law (the Waves NS1 stand-in) plays the matched engine: {0}"), listOf (ns1), true });
  857. if (! c6.isEmpty())
  858. lost.push_back ({ TR_NOOP ("Prism Multiband's floating bands (the Waves C6 stand-in) are left out: {0}"), listOf (c6), true });
  859. }
  860. // rollup step 10: round 190lp's black-box revision 1 of Apex Limiter (Pro-L 2) and Sentry Gate (Pro-G), every new one
  861. // (hidden, past the slot's count), and round 190ly's rate law of Spiral Echo (every new one; heard with Law = Measured
  862. // at rates other than 48 kHz). Round 190lp's Crest Smooth / Op-El are part of Crest's revision 1 (its line above), round
  863. // 190ls / 190ly's Atrium dense tank and Epoch's short-decay trim part of the reverbs' revision (the Measured law's line)
  864. {
  865. juce::StringArray apexLaws, sentryLaws, spiralRate;
  866. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  867. auto* params = arrayOf (e.getProperty ("params"));
  868. if (params == nullptr)
  869. return;
  870. const auto kind = e.getProperty ("kind").toString();
  871. const auto at = [params] (int i) { return i < params->size() ? (float) (double) (*params)[i] : 0.0f; };
  872. const auto cutFrom = [params] (int from) {
  873. if (params->size() > from)
  874. params->removeRange (from, params->size() - from);
  875. };
  876. if (kind == "apexLimiter")
  877. {
  878. if (at (apex::pRevision) >= 0.5f)
  879. addOnce (apexLaws, where);
  880. cutFrom (apex::pRevision);
  881. }
  882. else if (kind == "sentryGate")
  883. {
  884. if (at (dyn::sentry::revision) >= 0.5f)
  885. addOnce (sentryLaws, where);
  886. cutFrom (dyn::sentry::revision);
  887. }
  888. else if (kind == "spiralEcho")
  889. {
  890. if (at (echosuite::spiral::rateLaw) >= 0.5f && at (echosuite::spiral::law) >= 0.5f)
  891. addOnce (spiralRate, where);
  892. cutFrom (echosuite::spiral::rateLaw);
  893. }
  894. });
  895. if (! apexLaws.isEmpty())
  896. lost.push_back ({ TR_NOOP ("Apex Limiter's styles play their earlier fitted laws (not the reference's): {0}"), listOf (apexLaws), true });
  897. if (! sentryLaws.isEmpty())
  898. lost.push_back ({ TR_NOOP ("Sentry Gate plays its earlier measured gate (not the reference's): {0}"), listOf (sentryLaws), true });
  899. if (! spiralRate.isEmpty())
  900. lost.push_back ({ TR_NOOP ("Spiral Echo's Measured loop plays its earlier phase at sample rates other than 48 kHz: {0}"), listOf (spiralRate), true });
  901. }
  902. // rollup step 11: hidden parameters past the slot's count, written only when set (0.1.28 plays the effect without them):
  903. // round 190mb / 190mj's Valhalla laws — Horizon's revision (every new Horizon) and its FutureVerb law, Nebula's
  904. // Supermassive tone, Orbit's SpaceModulator level and voices (Epoch's rate law goes with the reverbs' revision, the
  905. // Measured law's line); round 190mg's Waves laws — Compressor's Renaissance law, Gemini Doubler's splice law, LYNX Tune's
  906. // Waves Tune Real-Time law (each set only by its translator; Crest's FET amplifier goes with the FET law's line, the
  907. // L2 requantizer with the L2 law's, Prism's C4 law, Quell's NS1 law and Facet's PuigTec law have their lines above)
  908. {
  909. juce::StringArray horizonLaws, nebulaTone, orbitLaws, renLaw, splice, wavesTune, voxLaw, apiLaw, channelEq, bassLaw, vitamin, rvoxType, rchGate;
  910. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  911. auto* params = arrayOf (e.getProperty ("params"));
  912. if (params == nullptr)
  913. return;
  914. const auto kind = e.getProperty ("kind").toString();
  915. const auto cut = [params, &where] (int from, juce::StringArray& list) {
  916. if (params->size() <= from)
  917. return;
  918. for (int i = from; i < params->size(); ++i)
  919. if ((float) (double) (*params)[i] != 0.0f)
  920. {
  921. addOnce (list, where);
  922. break;
  923. }
  924. params->removeRange (from, params->size() - from);
  925. };
  926. if (kind == "horizon")
  927. {
  928. // (revision 1 is heard only with the engine law on; reaLaw is read with it)
  929. const auto lawOn = params->size() > verbs::horizon::engineLaw && (float) (double) (*params)[verbs::horizon::engineLaw] >= 0.5f;
  930. if (lawOn)
  931. cut (verbs::horizon::revision, horizonLaws);
  932. else if (params->size() > verbs::horizon::revision)
  933. params->removeRange (verbs::horizon::revision, params->size() - verbs::horizon::revision);
  934. }
  935. else if (kind == "nebula")
  936. cut (verbs::nebula::toneLaw, nebulaTone);
  937. else if (kind == "orbit")
  938. cut (echosuite::orbit::smLaw, orbitLaws);
  939. else if (kind == "compressor")
  940. {
  941. // rollup step 12: round 190mm's Vox law [21 …], API-2500 bus law [25 …] and the Renaissance Channel's EQ
  942. // [48 …] (each set only by its Waves translator) have their own lines; the Renaissance law [20] keeps its
  943. const auto on = [params] (int i) { return params->size() > i && (float) (double) (*params)[i] >= 0.5f; };
  944. if (on (compressorVoxLaw))
  945. addOnce (voxLaw, where);
  946. if (on (compressorApiLaw))
  947. addOnce (apiLaw, where);
  948. if (on (compressorChannelLaw))
  949. addOnce (channelEq, where);
  950. // rollup step 13: round 190mt's RVox type [38] and gate [39 …] (set only by the RChannel translator)
  951. if (on (compressorRVoxType))
  952. addOnce (rvoxType, where);
  953. if (on (compressorRchGate))
  954. addOnce (rchGate, where);
  955. if (on (compressorRenLaw) || ! (on (compressorVoxLaw) || on (compressorApiLaw) || on (compressorChannelLaw) || on (compressorRVoxType) || on (compressorRchGate)))
  956. cut (compressorRenLaw, renLaw);
  957. else if (params->size() > compressorRenLaw)
  958. params->removeRange (compressorRenLaw, params->size() - compressorRenLaw);
  959. }
  960. else if (kind == "flLowLifter")
  961. cut (lowlifter::bassLaw, bassLaw); // rollup step 12: round 190mm's bass law (MaxxBass / Renaissance Bass)
  962. else if (kind == "aether")
  963. cut (mixsuite::aether::vitLaw, vitamin); // rollup step 12: round 190mm's Vitamin law
  964. else if (kind == "geminiDoubler")
  965. cut (voicetools::gemini::spliceLaw, splice);
  966. else if (kind == "lynxTune")
  967. cut (lynxtune::wavesLaw, wavesTune);
  968. });
  969. if (! horizonLaws.isEmpty())
  970. lost.push_back ({ TR_NOOP ("Horizon plays its earlier reverb and echo modes (not the ValhallaFutureVerb laws): {0}"), listOf (horizonLaws), true });
  971. if (! nebulaTone.isEmpty())
  972. lost.push_back ({ TR_NOOP ("Nebula's classic modes play without the ValhallaSupermassive tone: {0}"), listOf (nebulaTone), true });
  973. if (! orbitLaws.isEmpty())
  974. lost.push_back ({ TR_NOOP ("Orbit plays its own voices and levels (not the ValhallaSpaceModulator laws): {0}"), listOf (orbitLaws), true });
  975. if (! renLaw.isEmpty())
  976. lost.push_back ({ TR_NOOP ("Compressor's Renaissance law (the Waves Renaissance Compressor stand-in) plays as its vintage voicing: {0}"), listOf (renLaw), true });
  977. if (! splice.isEmpty())
  978. lost.push_back ({ TR_NOOP ("Gemini Doubler's splice law (the Waves Doubler stand-in) plays its measured read head: {0}"), listOf (splice), true });
  979. if (! wavesTune.isEmpty())
  980. lost.push_back ({ TR_NOOP ("LYNX Tune's Waves Tune Real-Time law is left out (the uncorrected sound is re-synthesised): {0}"), listOf (wavesTune), true });
  981. if (! voxLaw.isEmpty())
  982. lost.push_back ({ TR_NOOP ("Compressor's Vox law (the Waves Renaissance Vox stand-in) plays as the plain Compressor: {0}"), listOf (voxLaw), true });
  983. if (! apiLaw.isEmpty())
  984. lost.push_back ({ TR_NOOP ("Compressor's bus law (the Waves API-2500 stand-in) plays as the plain Compressor: {0}"), listOf (apiLaw), true });
  985. if (! channelEq.isEmpty())
  986. lost.push_back ({ TR_NOOP ("Compressor's channel EQ (the Waves RChannel stand-in) is left out: {0}"), listOf (channelEq), true });
  987. if (! rvoxType.isEmpty())
  988. lost.push_back ({ TR_NOOP ("Compressor's RVox type (the Waves RChannel stand-in) plays the Renaissance law's own curve: {0}"), listOf (rvoxType), true });
  989. if (! rchGate.isEmpty())
  990. lost.push_back ({ TR_NOOP ("Compressor's gate (the Waves RChannel stand-in) is left out: {0}"), listOf (rchGate), true });
  991. if (! bassLaw.isEmpty())
  992. lost.push_back ({ TR_NOOP ("Low Lifter's bass law (the Waves MaxxBass and Renaissance Bass stand-ins) plays as Low Lifter: {0}"), listOf (bassLaw), true });
  993. if (! vitamin.isEmpty())
  994. lost.push_back ({ TR_NOOP ("Aether's Vitamin law (the Waves Vitamin stand-in) plays Aether's own enhancer: {0}"), listOf (vitamin), true });
  995. }
  996. // rollup step 9, round 190lq (issue #204): a channel's notes on an audio clip channel play as the channel's Sampler
  997. // (FL's law: the whole clip, layered, the key transposes it) in projects with the "clipNotes190lq" mark; 0.1.28 plays
  998. // every such note cut at its own end, at the clip's own pitch (a channel already on "clipNoteLegacy" plays that law
  999. // there too, but a note's end there ends every sounding note of the channel)
  1000. {
  1001. juce::StringArray fl;
  1002. std::vector<bool> played;
  1003. if (auto* patterns = arrayOf (root["patterns"]))
  1004. for (auto& p : *patterns)
  1005. if (auto* notes = arrayOf (p["notes"]))
  1006. for (auto& n : *notes)
  1007. if (auto* fields = arrayOf (n); fields != nullptr && fields->size() > 2)
  1008. if (const auto c = (int) (*fields)[2]; c >= 0 && c < 4096)
  1009. {
  1010. if ((int) played.size() <= c)
  1011. played.resize ((std::size_t) c + 1, false);
  1012. played[(std::size_t) c] = true;
  1013. }
  1014. const auto marked = drop (o, "clipNotes190lq");
  1015. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  1016. if (c.getProperty ("instrument").toString() != "audioClip")
  1017. return;
  1018. auto legacy = ! marked;
  1019. if (auto* sampler = objectOf (c.getProperty ("samplerSettings")))
  1020. legacy = drop (*sampler, "clipNoteLegacy") || legacy;
  1021. if (! legacy && i < (int) played.size() && played[(std::size_t) i])
  1022. fl.add (channelName (juce::var (&c), i));
  1023. });
  1024. if (! fl.isEmpty())
  1025. lost.push_back ({ TR_NOOP ("Notes on audio clip channels play cut at each note's end and at the clip's own pitch: {0}"), listOf (fl), true });
  1026. }
  1027. // round 190kx: audio clips edited in an ARA plugin (Melodyne...) play unedited in 0.1.28 (it hosts no ARA)
  1028. {
  1029. juce::StringArray edited;
  1030. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  1031. if (drop (c, "ara"))
  1032. edited.add (channelName (juce::var (&c), i));
  1033. });
  1034. drop (o, "araDocuments");
  1035. if (! edited.isEmpty())
  1036. lost.push_back ({ TR_NOOP ("Audio clips edited in an ARA plugin (Melodyne...) play without those edits: {0}"), listOf (edited), false });
  1037. }
  1038. // round 190lk: audio clips whose notes were edited in the polyphonic note editor play unedited in 0.1.28
  1039. {
  1040. juce::StringArray edited;
  1041. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  1042. if (drop (c, "polyEdit"))
  1043. edited.add (channelName (juce::var (&c), i));
  1044. });
  1045. if (! edited.isEmpty())
  1046. lost.push_back ({ TR_NOOP ("Audio clips with notes edited in the polyphonic note editor play without those edits: {0}"), listOf (edited), false });
  1047. }
  1048. // rollup step 13: round 190mv's FL Current mixer track (the last insert, "current"; 0.1.28 shows it as an ordinary insert
  1049. // that nothing routes into, so its effects no longer process the selected track) and round 190mr's window layout saved
  1050. // with the project (0.1.28 ignores it: the layout on screen stays)
  1051. {
  1052. juce::StringArray current;
  1053. if (auto* mixer = arrayOf (root["mixer"]))
  1054. for (int t = 0; t < mixer->size(); ++t)
  1055. if (auto* m = objectOf ((*mixer)[t]); m != nullptr && m->getProperty ("current").isBool() && (bool) m->getProperty ("current"))
  1056. {
  1057. addOnce (current, insertName (root["mixer"], t));
  1058. drop (*m, "current");
  1059. }
  1060. if (! current.isEmpty())
  1061. lost.push_back ({ TR_NOOP ("The Current mixer track shows as an ordinary insert: its effects no longer process the selected track: {0}"), listOf (current), true });
  1062. if (drop (o, "windowLayout"))
  1063. lost.push_back ({ TR_NOOP ("The window layout saved with the project is not restored"), {}, false });
  1064. }
  1065. // rollup step 14: round 190nb's Kilohearts laws on Effector (hidden [12 …], set only by the Kilohearts translator for
  1066. // Ring Mod, Reverser, Resonator, Phase Distortion and Shaper; 0.1.28 plays the Effector algorithm the visible Type
  1067. // names) and round 190mx's launched pattern clips playing their pattern's events (#198, Session Record writes knob
  1068. // moves there; 0.1.28's clip grid plays a launched clip's notes only: engine behaviour, nothing to drop)
  1069. {
  1070. juce::StringArray khsLaws, launchedEvents;
  1071. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  1072. auto* params = arrayOf (e.getProperty ("params"));
  1073. if (params == nullptr || e.getProperty ("kind").toString() != "effector" || params->size() <= khsdsp::lawParam)
  1074. return;
  1075. if (khsdsp::lawOf ((float) (double) (*params)[khsdsp::lawParam]) != khsdsp::Law::none)
  1076. addOnce (khsLaws, where);
  1077. params->removeRange (khsdsp::lawParam, params->size() - khsdsp::lawParam);
  1078. });
  1079. if (auto* slots = arrayOf (root["clipGrid"]["clips"]))
  1080. for (const auto& s : *slots)
  1081. if (const auto* list = arrayOf (s["clip"])) // (the slot's clip in the Playlist's clip form: a list of one)
  1082. for (const auto& one : *list)
  1083. if (const auto* c = arrayOf (one); c != nullptr && c->size() >= 4 && (c->size() < 6 || (int) (*c)[5] == 0))
  1084. {
  1085. const auto pattern = (int) (*c)[0];
  1086. const auto& p = root["patterns"][pattern];
  1087. if (const auto* lanes = arrayOf (p["events"]); lanes != nullptr && ! lanes->isEmpty())
  1088. addOnce (launchedEvents, p["name"].toString().isNotEmpty() ? "\"" + p["name"].toString() + "\"" : "#" + juce::String (pattern + 1));
  1089. }
  1090. if (! khsLaws.isEmpty())
  1091. lost.push_back ({ TR_NOOP ("Effector's Kilohearts laws (the Ring Mod, Reverser, Resonator, Phase Distortion and Shaper stand-ins) play Effector's own algorithm: {0}"), listOf (khsLaws), true });
  1092. if (! launchedEvents.isEmpty())
  1093. lost.push_back ({ TR_NOOP ("Launched pattern clips play without their pattern's events (recorded knob moves): {0}"), listOf (launchedEvents), true });
  1094. }
  1095. }
  1096. // --- 0.1.29 / 0.1.30 → 0.1.28 ------------------------------------------------------------------------------------------
  1097. void toRelease0128 (juce::var& root, Losses& lost)
  1098. {
  1099. auto& o = *objectOf (root);
  1100. // (reported only when the project has such automation: the mark is on in every new project)
  1101. bool levelAutomation = false;
  1102. if (auto* automations = arrayOf (root["automations"]))
  1103. for (const auto& a : *automations)
  1104. if (const auto kind = a["target"][0].toString(); kind == "mixerVolume" || kind == "mixerPan" || kind == "mixerSend" || kind == "vcaLevel")
  1105. levelAutomation = true;
  1106. if (drop (o, "mixerLevelPdc190hq") && levelAutomation)
  1107. lost.push_back ({ TR_NOOP ("Mixer › Plugin delay compensation › \"Compensate fader and route automations too\" is not in this release: that automation plays a little early behind plugins with latency"), {}, true });
  1108. int markers = 0;
  1109. if (auto* automations = arrayOf (root["automations"]))
  1110. for (auto& a : *automations)
  1111. if (auto* ao = objectOf (a); ao != nullptr && drop (*ao, "tempoMarkers"))
  1112. if (auto* points = arrayOf (a["points"]))
  1113. markers += juce::jmax (0, points->size() - 1);
  1114. if (markers > 0)
  1115. lost.push_back ({ TR_NOOP ("{0} tempo marker(s) on the ruler become a plain tempo automation clip (the tempo plays the same)"), juce::String (markers), false });
  1116. // round 190hq's side-chain compensation is engine behaviour: nothing to drop, but an older release lines up less
  1117. bool sidechain = false;
  1118. if (auto* mixer = arrayOf (root["mixer"]))
  1119. for (const auto& t : *mixer)
  1120. if (auto* fx = arrayOf (t["effects"]))
  1121. for (const auto& e : *fx)
  1122. sidechain = sidechain || (int) e.getProperty ("sidechain", -1) > 0 || (int) e.getProperty ("sidechain2", -1) > 0;
  1123. if (sidechain)
  1124. lost.push_back ({ TR_NOOP ("Side-chains are not lined up with plugin delay compensation in this release: behind plugins with latency, ducking may be a few milliseconds off"), {}, true });
  1125. toRelease0128FromRollup030 (root, lost);
  1126. }
  1127. // --- 0.1.28 → 0.1.27 -----------------------------------------------------------------------------------------------------
  1128. // A slot 0.1.27 does not know (it would drop it, moving every later slot): a switched-off Utility in its place.
  1129. bool flattenUnknownEffect (juce::var& e, const juce::StringArray& kinds)
  1130. {
  1131. auto* o = objectOf (e);
  1132. if (o == nullptr || ! kinds.contains (e["kind"].toString()))
  1133. return false;
  1134. auto replacement = std::make_unique<juce::DynamicObject>();
  1135. replacement->setProperty ("kind", "utility");
  1136. replacement->setProperty ("on", false);
  1137. for (const auto* keep : { "row", "sidechain", "sidechain2" })
  1138. if (o->hasProperty (keep))
  1139. replacement->setProperty (keep, o->getProperty (keep));
  1140. e = juce::var (replacement.release());
  1141. return true;
  1142. }
  1143. // nested chains (a Patcher's nodes, a rack's branches): every effect object below `v`
  1144. void flattenNested (juce::var& v, int& count, const juce::StringArray& kinds)
  1145. {
  1146. if (auto* a = arrayOf (v))
  1147. {
  1148. for (auto& item : *a)
  1149. flattenNested (item, count, kinds);
  1150. return;
  1151. }
  1152. auto* o = objectOf (v);
  1153. if (o == nullptr)
  1154. return;
  1155. for (auto& p : o->getProperties())
  1156. {
  1157. auto value = p.value;
  1158. if (value.isObject() && kinds.contains (value["kind"].toString()) && (p.name.toString() == "effect" || p.name.toString() == "head"))
  1159. {
  1160. if (flattenUnknownEffect (value, kinds))
  1161. {
  1162. o->setProperty (p.name, value);
  1163. ++count;
  1164. }
  1165. continue;
  1166. }
  1167. if (auto* list = arrayOf (value); list != nullptr && (p.name.toString() == "chain" || p.name.toString() == "effects"))
  1168. for (auto& item : *list)
  1169. if (flattenUnknownEffect (item, kinds))
  1170. ++count;
  1171. flattenNested (value, count, kinds);
  1172. }
  1173. }
  1174. // automation that drove slot (track, slot)'s parameters or mix now drives nothing ("none")
  1175. void detachTargets (juce::var& v, int track, int slot)
  1176. {
  1177. auto isSlotTarget = [&] (const juce::var& t) {
  1178. if (! t.isArray() || t.size() < 4)
  1179. return false;
  1180. const auto kind = t[0].toString();
  1181. return (kind == "effectParam" || kind == "effectMix") && (int) t[1] == track && (int) t[2] == slot;
  1182. };
  1183. if (auto* a = arrayOf (v))
  1184. {
  1185. for (auto& item : *a)
  1186. detachTargets (item, track, slot);
  1187. return;
  1188. }
  1189. auto* o = objectOf (v);
  1190. if (o == nullptr)
  1191. return;
  1192. for (auto& p : o->getProperties())
  1193. {
  1194. auto value = p.value;
  1195. if (p.name.toString() == "target" && isSlotTarget (value))
  1196. if (auto* t = arrayOf (value))
  1197. t->set (0, "none");
  1198. if (p.name.toString() == "links")
  1199. if (auto* links = arrayOf (value))
  1200. for (auto& l : *links)
  1201. if (isSlotTarget (l))
  1202. if (auto* t = arrayOf (l))
  1203. t->set (0, "none");
  1204. detachTargets (value, track, slot);
  1205. }
  1206. }
  1207. // Every slot of `kinds` (mixer inserts, Patchers, racks) becomes a switched-off Utility; their automation is detached and one
  1208. // loss line names where they were
  1209. void flattenEffects (juce::var& root, const juce::StringArray& kinds, const char* loss, Losses& lost)
  1210. {
  1211. auto& o = *objectOf (root);
  1212. juce::StringArray where;
  1213. if (auto* mixer = arrayOf (root["mixer"]))
  1214. for (int t = 0; t < mixer->size(); ++t)
  1215. if (auto* fx = arrayOf ((*mixer)[t]["effects"]))
  1216. for (int s = 0; s < fx->size(); ++s)
  1217. if (flattenUnknownEffect (fx->getReference (s), kinds))
  1218. {
  1219. where.add (insertName (o.getProperty ("mixer"), t) + juce::String::fromUTF8 (" \u203a ") + juce::String (s + 1));
  1220. detachTargets (root, t, s);
  1221. }
  1222. int nested = 0;
  1223. if (auto* mixer = arrayOf (root["mixer"]))
  1224. for (auto& t : *mixer)
  1225. if (auto* fx = arrayOf (t["effects"]))
  1226. for (auto& e : *fx)
  1227. flattenNested (e, nested, kinds);
  1228. if (auto* channels = arrayOf (root["channels"]))
  1229. for (auto& c : *channels)
  1230. flattenNested (c, nested, kinds);
  1231. if (nested > 0)
  1232. where.add (juce::String (nested) + juce::String::fromUTF8 (" \u00d7 Patcher"));
  1233. if (! where.isEmpty())
  1234. lost.push_back ({ loss, listOf (where), true });
  1235. }
  1236. void toRelease0127 (juce::var& root, Losses& lost)
  1237. {
  1238. auto& o = *objectOf (root);
  1239. // the effect 0.1.28 added (Anvil Bus, round 190fk)
  1240. flattenEffects (root, { "anvilBus" }, TR_NOOP ("Anvil Bus is not in this release: it becomes a switched-off Utility in its slot, and its automation does nothing ({0})"), lost);
  1241. // channels
  1242. {
  1243. juce::StringArray cut, pads, warp, frozen, beats, soundfonts;
  1244. bool scales = false;
  1245. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  1246. const auto name = channelName (juce::var (&c), i);
  1247. if (drop (c, "cutOthersOnly") | drop (c, "cutAtNoteEnd"))
  1248. cut.add (name);
  1249. scales = drop (c, "editorScale") || scales;
  1250. if (drop (c, "simplePad"))
  1251. pads.add (name);
  1252. if (drop (c, "trackFreeze"))
  1253. frozen.add (name);
  1254. if (auto* sampler = objectOf (c.getProperty ("samplerSettings")))
  1255. {
  1256. if (drop (*sampler, "warpModes"))
  1257. warp.add (name);
  1258. if ((int) sampler->getProperty ("stretchMethod") == (int) StretchMethod::beats)
  1259. beats.add (name);
  1260. }
  1261. if (c.getProperty ("instrument").toString() == "soundfont")
  1262. soundfonts.add (name);
  1263. });
  1264. if (! cut.isEmpty())
  1265. lost.push_back ({ TR_NOOP ("Cut group modes (\"Cut others only\", \"Cut at the note's end\"): {0}"), listOf (cut), true });
  1266. if (! pads.isEmpty())
  1267. lost.push_back ({ TR_NOOP ("Simple workflow pad settings (mode, tone, release, group): {0}"), listOf (pads), true });
  1268. if (! warp.isEmpty())
  1269. lost.push_back ({ TR_NOOP ("Warp mode settings (Preserve, loop mode, grain sizes) go back to their defaults: {0}"), listOf (warp), true });
  1270. if (! frozen.isEmpty())
  1271. lost.push_back ({ TR_NOOP ("Freeze Track: these channels play live again (the same sound, more CPU): {0}"), listOf (frozen), false });
  1272. if (scales)
  1273. lost.push_back ({ TR_NOOP ("Plugin window sizes (Scale)"), {}, false });
  1274. if (drop (o, "beatsLaw190gx") && ! beats.isEmpty())
  1275. lost.push_back ({ TR_NOOP ("Beats warping uses this release's older (Classic) law: {0}"), listOf (beats), true });
  1276. if (drop (o, "sfModBase190he") && ! soundfonts.isEmpty())
  1277. lost.push_back ({ TR_NOOP ("Soundfont modulation knobs centre at this release's older value: {0}"), listOf (soundfonts), true });
  1278. }
  1279. // clips: index 24 (a Playlist clip's groove, round 190fm) and 25 (its envelopes, round 190gi) are new
  1280. {
  1281. int grooves = 0, envelopes = 0;
  1282. forEachClip (root, [&] (juce::Array<juce::var>& clip) {
  1283. if (clip.size() > 24 && (juce::int64) clip[24] != 0)
  1284. ++grooves;
  1285. if (clip.size() > 25 && (int) clip[25] >= 0)
  1286. ++envelopes;
  1287. if (clip.size() > 24)
  1288. clip.removeRange (24, clip.size() - 24);
  1289. });
  1290. if (drop (o, "clipEnvelopes") && envelopes > 0)
  1291. lost.push_back ({ TR_NOOP ("{0} audio clip envelope(s): those clips play at their own level and pan"), juce::String (envelopes), true });
  1292. if (grooves > 0)
  1293. lost.push_back ({ TR_NOOP ("{0} Playlist clip groove(s): those clips play straight"), juce::String (grooves), true });
  1294. }
  1295. // automation clips with several target links (round 190gw): 0.1.27 drives the first one, 1:1
  1296. {
  1297. juce::StringArray linked;
  1298. if (auto* automations = arrayOf (root["automations"]))
  1299. for (int i = 0; i < automations->size(); ++i)
  1300. if (auto* a = objectOf ((*automations)[i]))
  1301. {
  1302. const auto links = a->getProperty ("links");
  1303. const auto formula = links.isArray() && links.size() > 0 && links[0].isArray() && links[0].size() >= 5 ? links[0][4].toString() : juce::String();
  1304. if (drop (*a, "links") && (links.size() > 1 || formula.isNotEmpty()))
  1305. linked.add ("\"" + a->getProperty ("name").toString() + "\"");
  1306. }
  1307. if (! linked.isEmpty())
  1308. lost.push_back ({ TR_NOOP ("Automation clips with several targets or a formula drive only their first target, 1:1: {0}"), listOf (linked), true });
  1309. }
  1310. // the song
  1311. if (o.hasProperty ("beatUnit"))
  1312. {
  1313. const auto unit = (int) o.getProperty ("beatUnit");
  1314. drop (o, "beatUnit");
  1315. lost.push_back ({ TR_NOOP ("The time signature's beat unit: n/{0} becomes n/4"), juce::String (unit), true });
  1316. }
  1317. if (drop (o, "linkTracksToMixer"))
  1318. lost.push_back ({ TR_NOOP ("\"Link Playlist tracks to mixer tracks\" (a setting)"), {}, false });
  1319. if (drop (o, "midiGenerate"))
  1320. lost.push_back ({ TR_NOOP ("MIDI generator settings"), {}, false });
  1321. if (drop (o, "playlistRowHeight"))
  1322. lost.push_back ({ TR_NOOP ("The Playlist's row height"), {}, false });
  1323. }
  1324. // --- 0.1.31 → 0.1.30 ------------------------------------------------------------------------------------------------------
  1325. // Round 190nu (core/KeyRegions.h): the Piano roll's key markers keep their keys in "markerKeys" beside each pattern's
  1326. // marker list. 0.1.30 keeps such markers as named Key/Scale markers with no effect: their keys go, the names stay.
  1327. // Rollup 0.1.31 step 3 calls it from toRelease0130 below.
  1328. void keyMarkersFor0130 (juce::var& root, Losses& lost)
  1329. {
  1330. int keyMarkers = 0;
  1331. if (auto* patterns = arrayOf (root["patterns"]))
  1332. for (auto& p : *patterns)
  1333. if (auto* po = objectOf (p))
  1334. {
  1335. if (auto* keys = arrayOf (po->getProperty ("markerKeys")))
  1336. keyMarkers += keys->size();
  1337. drop (*po, "markerKeys");
  1338. }
  1339. if (keyMarkers > 0)
  1340. lost.push_back ({ TR_NOOP ("{0} key marker(s) in the Piano roll keep their names but not their keys (the rows show the Piano roll's own scale)"),
  1341. juce::String (keyMarkers), false });
  1342. }
  1343. // Rollup 0.1.31 (round 190no): what the 0.1.31 rounds save that 0.1.30 cannot hold, each loss reported only when the
  1344. // project has it. A copy for an older release runs this step first, so the later steps never see these. Round 190nc's
  1345. // Macro Map writes ordinary macro mappings (targets 0.1.30 has): nothing to change for it.
  1346. void toRelease0130 (juce::var& root, Losses& lost)
  1347. {
  1348. auto& o = *objectOf (root);
  1349. // round 190ni: LYNX Model. 0.1.30 would play an unknown instrument as its basic synth: an empty Sampler (silent) keeps
  1350. // the channel, its notes and its routing, as Tetra / Helix / Braid in the copy for 0.1.28
  1351. {
  1352. juce::StringArray lynxModel;
  1353. forEachChannel (root, [&] (juce::DynamicObject& c, int i) {
  1354. if (c.getProperty ("instrument").toString() != "lynxmodel")
  1355. return;
  1356. lynxModel.add (channelName (juce::var (&c), i));
  1357. c.setProperty ("instrument", "sampler");
  1358. drop (c, "modelParams");
  1359. drop (c, "pluginState");
  1360. drop (c, "samplePath");
  1361. });
  1362. if (! lynxModel.isEmpty())
  1363. lost.push_back ({ TR_NOOP ("LYNX Model is not in this release: its channels become empty Samplers and play nothing: {0}"), listOf (lynxModel), true });
  1364. }
  1365. // round 190nh: the Kilohearts part-2 laws on Effector (hidden [12] codes 41 … 48, 49 kept for the Nonlinear Filter;
  1366. // set only by the Kilohearts translator). 0.1.30 reads [12] in eighths (round 190nb's five laws, codes 8 … 40, which
  1367. // stay), so codes 41 … 43 would play its Shaper law on these values: [12 …] are cut and Effector plays the algorithm
  1368. // its visible Type names
  1369. {
  1370. juce::StringArray laws;
  1371. forEachEffect (root, [&] (juce::DynamicObject& e, const juce::String& where) {
  1372. auto* params = arrayOf (e.getProperty ("params"));
  1373. if (params == nullptr || e.getProperty ("kind").toString() != "effector" || params->size() <= khsdsp::lawParam)
  1374. return;
  1375. if (khsdsp::lawCode (khsdsp::lawOf ((float) (double) (*params)[khsdsp::lawParam])) < 41)
  1376. return;
  1377. addOnce (laws, where);
  1378. params->removeRange (khsdsp::lawParam, params->size() - khsdsp::lawParam);
  1379. });
  1380. if (! laws.isEmpty())
  1381. lost.push_back ({ TR_NOOP ("Effector's newer Kilohearts laws (the Comb Filter, Chorus, Trance Gate, Phaser, Distortion, Bitcrush, Frequency Shifter and Ensemble stand-ins) play Effector's own algorithm: {0}"),
  1382. listOf (laws), true });
  1383. }
  1384. // round 190nw: the tracker editor's view settings (rows per beat, columns, track groups). A view: the notes are the
  1385. // patterns' own, so 0.1.30 plays and shows them in its Piano roll as they are
  1386. if (drop (o, "tracker"))
  1387. lost.push_back ({ TR_NOOP ("The tracker's view settings (rows per beat, columns, track groups) are left out; the notes are unchanged"), {}, false });
  1388. // round 190ne (core/TrackClips.h): track clips and "Clips own their notes". Nothing they play changes: the clips are
  1389. // patterns; 0.1.30 lists them with the others and its pencil places the track's pattern, as FL does
  1390. {
  1391. int trackClips = 0;
  1392. if (auto* patterns = arrayOf (root["patterns"]))
  1393. for (auto& p : *patterns)
  1394. if (auto* po = objectOf (p))
  1395. trackClips += drop (*po, "trackClip") ? 1 : 0;
  1396. const auto ownTracks = drop (o, "playlistOwnClips");
  1397. if (trackClips > 0 || ownTracks)
  1398. lost.push_back ({ TR_NOOP ("{0} track clip(s) show as ordinary patterns, and instrument tracks lose \"Clips own their notes\""),
  1399. juce::String (trackClips), false });
  1400. }
  1401. // round 190nc (DL-110): Live's Solo / Cue: the Main strip's Solo/Cue switch, Cue Out and Cue Volume (the clip grid's
  1402. // "cue") and the tracks' Cue switches. A monitoring path: the Main mix is the same without them
  1403. {
  1404. bool cue = false;
  1405. if (auto* grid = objectOf (root["clipGrid"]))
  1406. cue = drop (*grid, "cue");
  1407. if (auto* mixer = arrayOf (root["mixer"]))
  1408. for (auto& t : *mixer)
  1409. if (auto* track = objectOf (t))
  1410. cue = drop (*track, "cue") || cue;
  1411. if (cue)
  1412. lost.push_back ({ TR_NOOP ("Live's Solo/Cue settings (Cue mode, Cue Out, Cue Volume and the tracks' Cue switches); the Main mix plays the same"), {}, false });
  1413. }
  1414. // round 190nu (chord2_190nu): the Piano roll's key markers
  1415. keyMarkersFor0130 (root, lost);
  1416. // round 190oo (PAT-7, core/RackAutomation.h): the automation clips' rows in the Channel rack. 0.1.30's rack has no
  1417. // automation rows and the clips play the same: dropped without a loss line
  1418. if (auto* automations = arrayOf (root["automations"]))
  1419. for (auto& a : *automations)
  1420. if (auto* ao = objectOf (a))
  1421. drop (*ao, "rackSlot");
  1422. }
  1423. struct Step
  1424. {
  1425. const char* release; // the release this step's output is for
  1426. void (*apply) (juce::var&, Losses&);
  1427. };
  1428. // newest first: a copy for release R runs every step down to R's
  1429. constexpr Step steps[] = { { "0.1.30", toRelease0130 }, { "0.1.28", toRelease0128 }, { "0.1.27", toRelease0127 } };
  1430. } // namespace
  1431. juce::StringArray releases()
  1432. {
  1433. juce::StringArray r;
  1434. for (const auto& s : steps)
  1435. r.add (s.release);
  1436. return r;
  1437. }
  1438. Copy forRelease (const juce::String& projectJson, const juce::String& release)
  1439. {
  1440. Copy copy;
  1441. if (! releases().contains (release))
  1442. {
  1443. copy.error = "no such release: " + release;
  1444. return copy;
  1445. }
  1446. auto root = juce::JSON::parse (projectJson);
  1447. if (objectOf (root) == nullptr)
  1448. {
  1449. copy.error = "not a project";
  1450. return copy;
  1451. }
  1452. const auto from = root["savedBy"].toString();
  1453. for (const auto& s : steps)
  1454. {
  1455. s.apply (root, copy.lost);
  1456. if (release == s.release)
  1457. break;
  1458. }
  1459. // stamped as that release's own file (no "saved by a newer version" notice there); where it came from, for us
  1460. objectOf (root)->setProperty ("savedBy", release);
  1461. if (from.isNotEmpty())
  1462. objectOf (root)->setProperty ("copiedFrom", from);
  1463. copy.json = juce::JSON::toString (root, true);
  1464. copy.ok = true;
  1465. return copy;
  1466. }
  1467. Copy forRelease (const Song& song, const juce::String& release)
  1468. {
  1469. return forRelease (ProjectFile::toJson (song), release);
  1470. }
  1471. juce::String copyName (const juce::String& projectName, const juce::String& release)
  1472. {
  1473. return (projectName.isNotEmpty() ? projectName : juce::String ("Untitled")) + " (for LYNX " + release + ")";
  1474. }
  1475. } // namespace lynx::olderlynx