4
0

Modal190mcTests.inc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. // Round 190mc: the Piano roll's Chord helper (GitHub discussion #105) — the key a chord implies with its context, the
  2. // related keys for modal interchange, the borrowed chords with their movement, mood and voicing (core/ModalHelper.h),
  3. // and Transistor Bass's program row (FL's PROGRAM / SEQUENCE / PATCH selectors, GitHub discussion #202).
  4. #include "core/ModalHelper.h"
  5. namespace modal190mc
  6. {
  7. using namespace lynx::modalhelp;
  8. inline std::string name (const Borrowed& b) { return spelledName (b.root, lynx::notenames::Style::english) + chordSuffix (b.chord.intervals); }
  9. inline const RelatedKey* find (const std::vector<RelatedKey>& keys, int tonic, Mode mode)
  10. {
  11. for (const auto& k : keys)
  12. if (k.scale.tonic == tonic && k.scale.mode == mode)
  13. return &k;
  14. return nullptr;
  15. }
  16. } // namespace modal190mc
  17. TEST (modal190mc_scales_spelling_signatures)
  18. {
  19. using namespace modal190mc;
  20. using lynx::notenames::Style;
  21. // C Aeolian is spelled with flats, letters in order
  22. const Scale cMinor { 0, Mode::aeolian };
  23. std::string spelled;
  24. for (int d = 0; d < 7; ++d)
  25. spelled += spelledName (spellDegree (cMinor, d), Style::english) + " ";
  26. CHECK (spelled == "C D E\xe2\x99\xad F G A\xe2\x99\xad B\xe2\x99\xad ");
  27. // key signatures: in signature order, the harmonic minor's raised seventh apart
  28. auto sig = signatureOf (cMinor);
  29. CHECK (sig.flats == 3 && sig.sharps == 0 && ! sig.raised);
  30. CHECK (spelledName (sig.notes[0], Style::english) == "B\xe2\x99\xad" && spelledName (sig.notes[2], Style::english) == "A\xe2\x99\xad");
  31. CHECK (signatureOf ({ 0, Mode::ionian }).notes.empty());
  32. CHECK (signatureOf ({ 0, Mode::mixolydian }).flats == 1); // (as F major)
  33. CHECK (signatureOf ({ 0, Mode::dorian }).flats == 2); // (as B♭ major)
  34. CHECK (signatureOf ({ 0, Mode::phrygian }).flats == 4); // (as A♭ major)
  35. CHECK (signatureOf ({ 0, Mode::lydian }).sharps == 1); // (as G major)
  36. CHECK (signatureOf ({ 0, Mode::locrian }).flats == 5); // (as D♭ major)
  37. sig = signatureOf ({ 9, Mode::harmonicMinor }); // A harmonic minor: no signature, G♯
  38. CHECK (sig.notes.empty() && sig.raised && spelledName (*sig.raised, Style::english) == "G\xe2\x99\xaf");
  39. CHECK (signatureOf ({ 6, Mode::ionian }).sharps == 6); // F♯ major (not G♭)
  40. CHECK (signatureOf ({ 3, Mode::aeolian }).flats == 6); // E♭ minor (not D♯)
  41. CHECK (spelledName (spellDegree ({ 10, Mode::ionian }, 0), Style::english) == "B\xe2\x99\xad");
  42. // the user's note names: solfège and German B / H
  43. CHECK (spelledName (spellDegree ({ 10, Mode::ionian }, 0), Style::solfege) == "Si\xe2\x99\xad");
  44. CHECK (spelledName (spellDegree ({ 10, Mode::ionian }, 0), Style::germanic) == "B");
  45. CHECK (spelledName (spellDegree ({ 0, Mode::ionian }, 6), Style::germanic) == "H");
  46. // chord symbols and numerals
  47. CHECK (chordSuffix ({ 0, 3, 7 }) == "m" && chordSuffix ({ 0, 4, 7, 10 }) == "7" && chordSuffix ({ 0, 4, 7, 11 }) == "maj7");
  48. CHECK (chordSuffix ({ 0, 3, 6, 10 }) == "m7\xe2\x99\xad" "5" && chordSuffix ({ 0, 3, 6 }) == "\xc2\xb0" && chordSuffix ({ 0, 4, 8 }) == "+");
  49. CHECK (chordSuffix ({ 0, 3, 7, 10, 14 }) == "m9" && chordSuffix ({ 0, 4, 7, 14 }) == "add9" && chordSuffix ({ 0, 5, 7 }) == "sus4");
  50. CHECK (numeral ({ 0, Mode::ionian }, 5, Quality::minor) == "iv");
  51. CHECK (numeral ({ 0, Mode::ionian }, 10, Quality::major) == "\xe2\x99\xad" "VII");
  52. CHECK (numeral ({ 0, Mode::ionian }, 6, Quality::diminished) == "\xe2\x99\xaf" "iv\xc2\xb0");
  53. CHECK (numeral ({ 0, Mode::ionian }, 6, Quality::major) == "\xe2\x99\xad" "V");
  54. // intervals: the shorter way first
  55. CHECK (movement (0, 5).up == 5 && movement (0, 5).down == 7 && movement (0, 5).upFirst);
  56. CHECK (movement (0, 10).up == 10 && movement (0, 10).down == 2 && ! movement (0, 10).upFirst);
  57. CHECK (std::string (intervalName (5)) == "Perfect 4th" && std::string (intervalName (7)) == "Perfect 5th" && std::string (intervalName (6)) == "Tritone");
  58. }
  59. TEST (modal190mc_key_from_chord_and_context)
  60. {
  61. using namespace modal190mc;
  62. // the discussion's mockup: Am F G before C → C Ionian, the chord is I
  63. auto a = analyse ({ 60, 64, 67 }, { { 57, 60, 64 }, { 53, 57, 60 }, { 55, 59, 62 } });
  64. CHECK (a.valid && a.key.tonic == 0 && a.key.mode == Mode::ionian && a.quality == Quality::major && a.contextChords == 3);
  65. CHECK (numeral (a.key, a.chord.root, a.quality) == "I");
  66. // the same C after B♭ and F: the ♭VII says Mixolydian
  67. a = analyse ({ 60, 64, 67 }, { { 58, 62, 65 }, { 53, 57, 60 } });
  68. CHECK (a.key.mode == Mode::mixolydian);
  69. // a minor chord alone is Aeolian; with C, F and G before it D minor is Dorian (B natural), with B♭ before it Aeolian
  70. CHECK (analyse ({ 57, 60, 64 }).key.mode == Mode::aeolian);
  71. CHECK (analyse ({ 62, 65, 69 }, { { 60, 64, 67 }, { 53, 57, 60 }, { 55, 59, 62 } }).key.mode == Mode::dorian);
  72. CHECK (analyse ({ 62, 65, 69 }, { { 58, 62, 65 }, { 57, 61, 64 } }).key.mode == Mode::aeolian);
  73. // E major after A minor and D minor: Phrygian is out (G♯), Ionian / Mixolydian / Lydian decide on the context
  74. a = analyse ({ 64, 68, 71 }, { { 57, 60, 64 }, { 62, 65, 69 } });
  75. CHECK (a.key.tonic == 4 && majorType (a.key.mode));
  76. // a diminished chord: Locrian; an inversion keeps the chord's root (C/E is still C)
  77. CHECK (analyse ({ 59, 62, 65 }).key.mode == Mode::locrian);
  78. a = analyse ({ 52, 55, 60 });
  79. CHECK (a.chord.root == 0 && a.chord.bass == 4 && a.key.tonic == 0);
  80. // the user's choice wins (the header's Key and Mode menus)
  81. a = analyse ({ 60, 64, 67 }, {}, std::nullopt, 7, Mode::mixolydian);
  82. CHECK (a.key.tonic == 7 && a.key.mode == Mode::mixolydian && a.forcedTonic && a.forcedMode);
  83. // the project's key breaks a tie: a lone C major in a project in F major reads as C Mixolydian
  84. CHECK (analyse ({ 60, 64, 67 }, {}, Scale { 5, Mode::ionian }).key.mode == Mode::mixolydian);
  85. CHECK (! analyse ({}).valid);
  86. }
  87. TEST (modal190mc_context_chords_from_notes)
  88. {
  89. using namespace modal190mc;
  90. std::vector<lynx::Note> notes;
  91. const auto add = [&notes] (int key, std::int64_t start, std::int64_t length, int channel = 0) {
  92. lynx::Note n;
  93. n.key = key, n.start = start, n.length = length, n.channel = channel;
  94. notes.push_back (n);
  95. };
  96. const auto bar = 4 * (std::int64_t) lynx::ppq;
  97. for (const auto k : { 57, 60, 64 }) add (k, 0, bar); // Am
  98. for (const auto k : { 53, 57, 60 }) add (k, bar, bar); // F
  99. add (79, bar + bar / 2, bar / 4); // a single melody note: not a chord
  100. for (const auto k : { 55, 59, 62 }) add (k, 2 * bar, bar); // G
  101. for (const auto k : { 40, 47 }) add (k, 2 * bar, bar, 1); // another channel: not read
  102. for (const auto k : { 60, 64, 67 }) add (k, 3 * bar, bar); // C (the selection)
  103. const auto ctx = contextChords (notes, 0, 3 * bar);
  104. CHECK (ctx.size() == 3);
  105. CHECK ((ctx[0] == std::vector<int> { 57, 60, 64 }) && (ctx[2] == std::vector<int> { 55, 59, 62 }));
  106. CHECK (contextChords (notes, 0, 3 * bar, 2).size() == 2); // (the two latest)
  107. CHECK (contextChords (notes, 0, 0).empty());
  108. }
  109. TEST (modal190mc_related_keys_and_borrowed_chords)
  110. {
  111. using namespace modal190mc;
  112. // C Ionian with its context: the parallel C minor ranks first
  113. const auto a = analyse ({ 60, 64, 67 }, { { 57, 60, 64 }, { 53, 57, 60 }, { 55, 59, 62 } });
  114. const auto keys = relatedKeys (a);
  115. CHECK (! keys.empty() && keys[0].scale.tonic == 0 && keys[0].scale.mode == Mode::aeolian && keys[0].rank == 1);
  116. CHECK (std::string (relationName (keys[0].relation, a.key.mode, keys[0].scale.mode)) == "Parallel minor");
  117. CHECK (keys[1].scale.mode == Mode::mixolydian && keys[2].scale.mode == Mode::dorian);
  118. // the closely related keys follow (relative minor as a harmonic minor, dominant, subdominant), the rare modes last
  119. const auto* g = find (keys, 7, Mode::ionian);
  120. const auto* f = find (keys, 5, Mode::ionian);
  121. const auto* am = find (keys, 9, Mode::harmonicMinor);
  122. CHECK (g != nullptr && g->relation == Relation::dominant && f != nullptr && f->relation == Relation::subdominant);
  123. CHECK (am != nullptr && am->relation == Relation::relative && am->rank < g->rank);
  124. CHECK (keys.back().scale.mode == Mode::locrian);
  125. CHECK (find (keys, 0, Mode::ionian) == nullptr); // (the home itself is not listed)
  126. // panel 2 from C minor: the discussion's mockup order — Fm, B♭, A♭, E♭, Cm, Gm — then D°
  127. const auto chords = borrowedChords (a, keys[0]);
  128. CHECK (chords.size() == 7);
  129. if (chords.size() == 7)
  130. {
  131. CHECK (name (chords[0]) == "Fm" && name (chords[1]) == "B\xe2\x99\xad" && name (chords[2]) == "A\xe2\x99\xad");
  132. CHECK (name (chords[3]) == "E\xe2\x99\xad" && name (chords[4]) == "Cm" && name (chords[5]) == "Gm" && name (chords[6]) == "D\xc2\xb0");
  133. // F minor: up a Perfect 4th (or down a Perfect 5th), one common tone (C), "bittersweet"
  134. CHECK (chords[0].move.up == 5 && chords[0].move.down == 7 && chords[0].move.upFirst);
  135. CHECK (std::string (intervalName (chords[0].move.up)) == "Perfect 4th" && std::string (intervalName (chords[0].move.down)) == "Perfect 5th");
  136. CHECK (chords[0].numeral == "iv" && chords[0].commonTones == 1 && std::string (chords[0].mood.front()) == "bittersweet");
  137. // B♭: down a Major 2nd (or up a Minor 7th)
  138. CHECK (! chords[1].move.upFirst && std::string (intervalName (chords[1].move.down)) == "Major 2nd");
  139. CHECK (chords[4].move.up == 0 && chords[4].commonTones == 2); // C minor: the same root
  140. for (const auto& c : chords)
  141. CHECK (c.rank >= 1 && ! c.mood.empty());
  142. }
  143. // a related key lends its secondary dominant first: G major → D (V/V), then F♯° (vii°/V)
  144. if (g != nullptr)
  145. {
  146. const auto fromG = borrowedChords (a, *g);
  147. CHECK (! fromG.empty() && name (fromG[0]) == "D" && fromG[0].secondaryDominant && fromG[0].numeral == "V/V");
  148. CHECK (fromG.size() > 1 && name (fromG[1]) == "F\xe2\x99\xaf\xc2\xb0");
  149. }
  150. if (am != nullptr)
  151. {
  152. const auto fromAm = borrowedChords (a, *am);
  153. CHECK (! fromAm.empty() && name (fromAm[0]) == "E" && fromAm[0].numeral == "V/vi");
  154. }
  155. // a minor home: A minor borrows the parallel major's E (V), D (IV), A (I) first
  156. const auto m = analyse ({ 57, 60, 64 });
  157. const auto mk = relatedKeys (m);
  158. CHECK (! mk.empty() && mk[0].scale.tonic == 9 && mk[0].scale.mode == Mode::ionian);
  159. CHECK (std::string (relationName (mk[0].relation, m.key.mode, mk[0].scale.mode)) == "Parallel major");
  160. const auto mc = borrowedChords (m, mk[0]);
  161. CHECK (mc.size() >= 3 && name (mc[0]) == "E" && name (mc[1]) == "D" && name (mc[2]) == "A");
  162. // extensions: the source scale's own 7th and 9th
  163. const auto sevenths = borrowedChords (a, keys[0], Extension::seventh);
  164. CHECK (! sevenths.empty() && name (sevenths[0]) == "Fm7" && name (sevenths[1]) == "B\xe2\x99\xad" "7");
  165. CHECK (name (borrowedChords (a, keys[0], Extension::ninth)[0]) == "Fm9");
  166. CHECK (name (borrowedChords (a, keys[0], Extension::sus4)[1]) == "B\xe2\x99\xad" "sus4");
  167. // the same call twice gives the same list (deterministic)
  168. CHECK (borrowedChords (a, keys[1]).size() == borrowedChords (a, keys[1]).size());
  169. }
  170. TEST (modal190mc_voicing)
  171. {
  172. using namespace modal190mc;
  173. lynx::prtools::Chord fm;
  174. fm.root = 5, fm.intervals = { 0, 3, 7 };
  175. // C E G → F minor voice-led: C stays, E → F, G → A♭ (C4 F4 A♭4)
  176. CHECK ((voice (fm, { 60, 64, 67 }, Inversion::voiceLed) == std::vector<int> { 60, 65, 68 }));
  177. // fixed inversions start near the previous chord's lowest note
  178. CHECK ((voice (fm, { 60, 64, 67 }, Inversion::root) == std::vector<int> { 65, 68, 72 }));
  179. CHECK ((voice (fm, { 60, 64, 67 }, Inversion::first) == std::vector<int> { 56, 60, 65 }));
  180. CHECK ((voice (fm, { 60, 64, 67 }, Inversion::second) == std::vector<int> { 60, 65, 68 }));
  181. // no previous chord: root position from C4; a 7th chord's third inversion has the 7th in the bass
  182. CHECK ((voice (fm, {}, Inversion::voiceLed) == std::vector<int> { 65, 68, 72 }));
  183. lynx::prtools::Chord g7;
  184. g7.root = 7, g7.intervals = { 0, 4, 7, 10 };
  185. const auto third = voice (g7, { 60, 64, 67 }, Inversion::third);
  186. CHECK (third.size() == 4 && third.front() % 12 == 5);
  187. // A minor → E major voice-led: G♯3 B3 E4
  188. lynx::prtools::Chord e;
  189. e.root = 4, e.intervals = { 0, 4, 7 };
  190. CHECK ((voice (e, { 57, 60, 64 }, Inversion::voiceLed) == std::vector<int> { 56, 59, 64 }));
  191. // never outside the MIDI range
  192. for (const auto k : voice (e, { 124, 126, 127 }, Inversion::voiceLed))
  193. CHECK (k >= 0 && k <= 127);
  194. }
  195. // --- Transistor Bass's program row (discussion #202) ------------------------------------------------------------------
  196. #include "core/ModelParams.h"
  197. #include "core/NativeEngines.h"
  198. #include "core/TransistorBass.h"
  199. namespace modal190mc
  200. {
  201. inline std::optional<lynx::ChannelDef> tbChannel (const char* preset)
  202. {
  203. if (realFlpDir.empty())
  204. return std::nullopt;
  205. const auto path = (std::filesystem::path (realFlpDir) / "Patches" / "Plugin presets" / "Generators" / "Transistor Bass" / preset).string();
  206. return lynx::natives::channelFromPresetFile (lynx::InstrumentKind::transistorbass, path, natives142::flAccess());
  207. }
  208. } // namespace modal190mc
  209. // FL's program row: PROGRAM (the shown and played program), AF, SEQUENCE / TRANSP. / PATCH of that program, the names
  210. // and "shared" indicators, READ / WRITE, renaming
  211. TEST (modal190mc_tb_program_row)
  212. {
  213. using namespace lynx;
  214. auto c = modal190mc::tbChannel ("Factory programs.fst");
  215. if (! c)
  216. return;
  217. const auto value = [&c] (int index) { return modelparams::rawValue (*c, index).value_or (-999.0f); };
  218. // Factory programs: program 65 shown (FL's "F5"), AF on, program k = patch k + sequence k
  219. CHECK (value (tbprog::program) == 65.0f && value (tbprog::follow) == 1.0f);
  220. CHECK (value (tbprog::patch) == 65.0f && value (tbprog::sequence) == 65.0f && value (tbprog::transpose) == 0.0f);
  221. auto bank = transistorBassBank (c->pluginState);
  222. CHECK (bank && bank->program == 65 && bank->patch == 65 && ! bank->edited);
  223. if (! bank)
  224. return;
  225. int named = 0;
  226. for (const auto& n : bank->patches)
  227. named += n.empty() ? 0 : 1;
  228. CHECK (named >= 90); // (FL's 96 named factory patches)
  229. CHECK (bank->patchUsers[65] == 1);
  230. // choose another program: the page's knobs read its patch, its sequence comes with it
  231. const auto cutoff65 = value (2);
  232. CHECK (modelparams::setRawValue (*c, tbprog::program, 3.0f));
  233. CHECK (value (tbprog::program) == 3.0f && value (tbprog::patch) == 3.0f);
  234. CHECK (transistorBassProgram (c->pluginState)->program == 3);
  235. const auto cutoff3 = value (2);
  236. // another patch for program 3: the knobs read patch 10; patch 10 is now shared by programs 3 and 10
  237. CHECK (modelparams::setRawValue (*c, tbprog::patch, 10.0f));
  238. bank = transistorBassBank (c->pluginState);
  239. CHECK (bank && bank->patch == 10 && bank->patchUsers[10] == 2 && bank->patchUsers[3] == 0);
  240. CHECK (value (tbprog::program) == 3.0f);
  241. (void) cutoff65, (void) cutoff3;
  242. // the sequence number and transpose of the shown program
  243. CHECK (modelparams::setRawValue (*c, tbprog::sequence, 20.0f) && value (tbprog::sequence) == 20.0f);
  244. CHECK (modelparams::setRawValue (*c, tbprog::transpose, -12.0f) && value (tbprog::transpose) == -12.0f);
  245. CHECK (modelparams::setRawValue (*c, tbprog::follow, 0.0f) && value (tbprog::follow) == 0.0f);
  246. // READ / WRITE: a knob edits the working copy (WRITE lights); READ brings the stored values back, WRITE keeps them
  247. const auto before = value (2);
  248. CHECK (modelparams::setRawValue (*c, 2, before > 0.5f ? 0.1f : 0.9f));
  249. CHECK (transistorBassBank (c->pluginState)->edited);
  250. auto read = c->pluginState;
  251. CHECK (transistorBassReadPatch (read));
  252. auto readChannel = *c;
  253. readChannel.pluginState = read;
  254. CHECK (modelparams::rawValue (readChannel, 2).value_or (-1.0f) == before && ! transistorBassBank (read)->edited);
  255. auto written = c->pluginState;
  256. CHECK (transistorBassWritePatch (written) && ! transistorBassBank (written)->edited);
  257. // renaming a patch and a sequence: the state stays readable, every value the same
  258. auto renamed = c->pluginState;
  259. CHECK (transistorBassRename (renamed, true, 10, "My acid line"));
  260. CHECK (transistorBassRename (renamed, false, 20, "Seq"));
  261. CHECK (transistorBassStateUsable (renamed));
  262. bank = transistorBassBank (renamed);
  263. CHECK (bank && bank->patches[10] == "My acid line" && bank->sequences[20] == "Seq");
  264. auto renamedChannel = *c;
  265. renamedChannel.pluginState = renamed;
  266. for (const auto& p : transistorBassParams())
  267. CHECK (modelparams::rawValue (renamedChannel, p.index) == modelparams::rawValue (*c, p.index));
  268. }
  269. // The program chosen on the page is what the instrument plays, and the instrument reports it at once (the page's follow
  270. // timer read the old engine's program until the audio thread took the new one, and wrote it back into the state)
  271. TEST (modal190mc_tb_program_change_reaches_the_engine)
  272. {
  273. using namespace lynx;
  274. auto c = modal190mc::tbChannel ("Sequencer off.fst");
  275. if (! c)
  276. return;
  277. std::vector<float> l (512), r (512);
  278. const auto block = [&l, &r] (Instrument& i) { i.render (l.data(), r.data(), 512, 1.0f, 1.0f); };
  279. auto inst = makeTransistorBassInstrument();
  280. inst->prepare (44100.0);
  281. inst->configure (*c, 140.0);
  282. block (*inst);
  283. CHECK (inst->selectedProgram() == 60);
  284. auto other = *c;
  285. CHECK (modelparams::setRawValue (other, tbprog::program, 3.0f));
  286. inst->configure (other, 140.0);
  287. // until the audio thread takes the new engine the instrument names no program (the page's follow timer waits instead
  288. // of writing the old engine's 60 into the new state); then it is the new one
  289. CHECK (inst->selectedProgram() == -1 || inst->selectedProgram() == 3);
  290. block (*inst);
  291. CHECK (inst->selectedProgram() == 3);
  292. // with the sequencer off, programs 60 and 3 play their own patches: the sound differs
  293. const auto play = [] (const ChannelDef& d) {
  294. auto i = makeTransistorBassInstrument();
  295. i->prepare (44100.0);
  296. i->configure (d, 140.0);
  297. i->noteOn (48, 0.8f);
  298. std::vector<float> l (512), r (512), out;
  299. for (int b = 0; b < 40; ++b)
  300. {
  301. std::fill (l.begin(), l.end(), 0.0f);
  302. std::fill (r.begin(), r.end(), 0.0f);
  303. i->render (l.data(), r.data(), 512, 1.0f, 1.0f);
  304. out.insert (out.end(), l.begin(), l.end());
  305. }
  306. return out;
  307. };
  308. auto factory = modal190mc::tbChannel ("Factory programs.fst");
  309. if (! factory)
  310. return;
  311. auto seqOff = *factory;
  312. CHECK (modelparams::setRawValue (seqOff, tbseq::sequencer, 0.0f));
  313. auto seqOffOther = seqOff;
  314. CHECK (modelparams::setRawValue (seqOffOther, tbprog::program, 3.0f));
  315. CHECK (play (seqOff) != play (seqOffOther));
  316. // another patch for the playing program: the engine takes it (a new engine: FL resets the voice on a patch change too)
  317. // and the program stays the one shown
  318. auto live = makeTransistorBassInstrument();
  319. live->prepare (44100.0);
  320. live->configure (seqOff, 140.0);
  321. block (*live);
  322. auto patched = seqOff;
  323. CHECK (modelparams::setRawValue (patched, tbprog::patch, 3.0f));
  324. live->configure (patched, 140.0);
  325. block (*live);
  326. CHECK (live->selectedProgram() == 65);
  327. CHECK (play (patched) != play (seqOff));
  328. }