ControllerProfiles190awTests.inc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. // Round 190aw, phase B: the built-in controller profiles (resources/controllers/*.lynxctl). No hardware: each test
  2. // feeds the bytes the maker's document says the device sends and checks LYNX's side and the bytes sent back.
  3. // (FakeSurface, Wire and feed are in Controller190awTests.inc.)
  4. #include "core/ControllerProfilesData.h"
  5. TEST (controller190aw_builtin_profiles_parse_and_match_their_files)
  6. {
  7. using namespace c190aw;
  8. const auto lib = Library::builtIn();
  9. for (const auto& e : lib.errors)
  10. std::printf (" %s\n", e.c_str());
  11. CHECK (lib.errors.empty());
  12. // src/core/ControllerProfilesData.h must be regenerated (tools/make_controllers.py) whenever a profile file changes
  13. std::map<std::string, std::string> files;
  14. for (const auto& entry : std::filesystem::directory_iterator ("resources/controllers"))
  15. if (entry.path().extension() == ".lynxctl")
  16. {
  17. auto text = i18ntest::readFile (entry.path());
  18. std::string plain;
  19. for (const auto c : text)
  20. if (c != '\r')
  21. plain.push_back (c);
  22. files[entry.path().stem().string()] = plain;
  23. }
  24. auto embedded = 0;
  25. for (const auto* f = builtInProfiles; f->id != nullptr; ++f, ++embedded)
  26. {
  27. CHECK (files.count (f->id) == 1);
  28. CHECK (files[f->id] == f->text);
  29. }
  30. CHECK (embedded == (int) files.size() && (int) lib.profiles.size() == embedded && embedded == 6);
  31. // every profile names its maker and where its map comes from, and no profile is a user profile
  32. for (const auto& p : lib.profiles)
  33. {
  34. CHECK (! p->name.empty() && ! p->maker.empty() && ! p->sources.empty() && ! p->user);
  35. CHECK (! p->bindings.empty());
  36. }
  37. // detection by port name
  38. auto id = [&] (const char* port) {
  39. const auto p = lib.detect (port);
  40. return p != nullptr ? p->id : std::string ("-");
  41. };
  42. CHECK (id ("Mackie Control") == "mackie-control" && id ("MCU Pro USB v3.1") == "mackie-control" && id ("Mackie Control Universal Port 1") == "mackie-control");
  43. CHECK (id ("Mackie Control XT") == "mackie-control-xt" && id ("MCU XT Pro") == "mackie-control-xt" && id ("Mackie Control Extender") == "mackie-control-xt");
  44. CHECK (id ("MIDIIN2 (Launchkey MK3 49)") == "novation-launchkey-mk3" && id ("Launchkey MK3 61 LKMK3 DAW Out") == "novation-launchkey-mk3");
  45. CHECK (id ("MIDIIN2 (APC Key 25 mk2)") == "akai-apc-key-25-mk2" && id ("APC Key 25 mk2 Control") == "akai-apc-key-25-mk2");
  46. CHECK (id ("KL Essential 49 mk3 MCU/HUI") == "arturia-keylab-essential-mk3" && id ("KeyLab Essential 61 mk3 MCU/HUI") == "arturia-keylab-essential-mk3");
  47. // the ports that carry the keys stay generic (on them the keys' notes must play), and so does anything unknown
  48. CHECK (id ("Launchkey MK3 49") == "-" && id ("Launchkey MK3 49 LKMK3 MIDI Out") == "-" && id ("APC Key 25 mk2") == "-"
  49. && id ("KL Essential 49 mk3 MIDI") == "-" && id ("Arturia KeyLab 49") == "-" && id ("Akai MPD218") == "-" && id ("MPK mini 3") == "-"
  50. && id ("USB MIDI Interface") == "-" && id ("") == "-");
  51. // the nanoKONTROL2 is never detected (its port name is the same in its CC mode); it is chosen by hand
  52. CHECK (id ("nanoKONTROL2") == "-" && id ("nanoKONTROL2 1 SLIDER/KNOB") == "-");
  53. CHECK (lib.resolve ("korg-nanokontrol2", "nanoKONTROL2") == lib.find ("korg-nanokontrol2") && lib.find ("korg-nanokontrol2") != nullptr);
  54. // the Mackie Control relatives carry the whole map, in groups of their own
  55. const auto mcu = lib.find ("mackie-control");
  56. CHECK (mcu != nullptr && mcu->group == "mackie" && mcu->layers.size() == 3 && mcu->display.cells == 8 && mcu->display.width == 7);
  57. for (const char* relative : { "mackie-control-xt", "arturia-keylab-essential-mk3", "korg-nanokontrol2" })
  58. {
  59. const auto p = lib.find (relative);
  60. CHECK (p != nullptr && p->bindings.size() == mcu->bindings.size() && p->feedback.size() == mcu->feedback.size()
  61. && p->display.rows.size() == mcu->display.rows.size() && p->name != mcu->name);
  62. }
  63. CHECK (lib.find ("mackie-control-xt")->group == "mackie" && lib.find ("arturia-keylab-essential-mk3")->group == "keylab-essential"
  64. && lib.find ("korg-nanokontrol2")->group == "nanokontrol2" && lib.find ("korg-nanokontrol2")->match.empty());
  65. }
  66. TEST (controller190aw_mackie_control_profile_with_extender)
  67. {
  68. using namespace c190aw;
  69. const auto lib = Library::builtIn();
  70. FakeSurface lynx (40, 12, 20);
  71. for (std::size_t i = 1; i < lynx.tracks.size(); ++i)
  72. lynx.tracks[i].name = "Trk " + std::to_string (i);
  73. lynx.tracks[3].solo = true;
  74. Hub hub;
  75. std::map<std::string, Wire> wires;
  76. Hub::DeviceSend send = [&] (const std::string& input, const std::uint8_t* bytes, std::size_t size) { wires[input].send() (bytes, size); };
  77. auto in = [&] (const std::string& device, std::initializer_list<int> bytes) {
  78. std::vector<std::uint8_t> b;
  79. for (const auto v : bytes)
  80. b.push_back ((std::uint8_t) v);
  81. return hub.input (device, b.data(), b.size(), lynx);
  82. };
  83. auto clear = [&] {
  84. for (auto& [name, w] : wires)
  85. w.clear();
  86. };
  87. auto lcd = [&] (const std::string& device, const char* header, int pos) {
  88. char head[48];
  89. std::snprintf (head, sizeof (head), "%s %02X ", header, pos);
  90. std::string found = "<none>";
  91. for (const auto& m : wires[device].messages)
  92. if (m.rfind (head, 0) == 0)
  93. found = lcdText (m, 7); // (the last one written)
  94. return found;
  95. };
  96. hub.configure ({ { "Mackie Control", lib.detect ("Mackie Control") }, { "Mackie Control XT", lib.detect ("Mackie Control XT") } }, lynx, send);
  97. auto& main = wires["Mackie Control"];
  98. auto& xt = wires["Mackie Control XT"];
  99. CHECK (hub.session ("Mackie Control XT") != nullptr && hub.session ("Mackie Control XT")->unitOffset() == 8 && hub.shared ("mackie")->strips == 16);
  100. // what the units show after opening: names on the upper row, pans on the lower; the extender with its own model byte
  101. CHECK (lcd ("Mackie Control", "F0 00 00 66 14 12", 0) == "Trk 1 " && lcd ("Mackie Control", "F0 00 00 66 14 12", 49) == "Trk 8 "
  102. && lcd ("Mackie Control", "F0 00 00 66 14 12", 56) == "C ");
  103. CHECK (lcd ("Mackie Control XT", "F0 00 00 66 15 12", 0) == "Trk 9 " && lcd ("Mackie Control XT", "F0 00 00 66 15 12", 49) == "Trk 16 "
  104. && xt.count ("F0 00 00 66 14 12") == 0 && main.count ("F0 00 00 66 15 12") == 0);
  105. CHECK (main.has ("90 0A 7F") && main.has ("90 2A 7F") && main.has ("90 5D 7F") && main.has ("B0 30 16") && main.has ("E0 20 66") && main.has ("E8 20 66"));
  106. // strip 3 of the main unit: fader with touch, V-Pot, mute, solo, arm, select
  107. clear();
  108. CHECK (in ("Mackie Control", { 0x90, 106, 127 }) && in ("Mackie Control", { 0xE2, 0x70, 0x7F }) && in ("Mackie Control", { 0x90, 106, 0 }));
  109. CHECK (std::abs (lynx.tracks[3].volume - 16368.0f / 16383.0f) < 1e-4f);
  110. CHECK (in ("Mackie Control", { 0xB0, 18, 0x44 }) && std::abs (lynx.tracks[3].pan - 0.46f) < 1e-5f);
  111. CHECK (in ("Mackie Control", { 0x90, 18, 127 }) && lynx.tracks[3].mute && in ("Mackie Control", { 0x90, 10, 127 }) && ! lynx.tracks[3].solo
  112. && in ("Mackie Control", { 0x90, 2, 127 }) && lynx.tracks[3].arm && in ("Mackie Control", { 0x90, 26, 127 }) && lynx.selectedTrack == 3);
  113. hub.refresh (lynx, send);
  114. CHECK (main.has ("E2 60 7F") && main.has ("90 12 7F") && main.has ("90 0A 00") && main.has ("90 02 7F") && main.has ("90 1A 7F") && main.has ("90 18 00"));
  115. CHECK (main.count ("B0 32") == 0); // 0.46 is still nearest the ring's centre LED (sent as B0 32 16 at opening): nothing new
  116. CHECK (lcd ("Mackie Control", "F0 00 00 66 14 12", 56 + 14) == "L8 ");
  117. // the extender's strip 2 is insert 10; the Master fader
  118. CHECK (in ("Mackie Control XT", { 0x90, 17, 127 }) && lynx.tracks[10].mute && in ("Mackie Control", { 0xE8, 0x00, 0x00 }) && lynx.tracks[0].volume == 0.0f);
  119. // bank right moves both units by 16; channel right by one
  120. clear();
  121. CHECK (in ("Mackie Control", { 0x90, 47, 127 }) && hub.shared ("mackie")->mixerBank == 16);
  122. hub.refresh (lynx, send);
  123. CHECK (lcd ("Mackie Control", "F0 00 00 66 14 12", 0) == "Trk 17 " && lcd ("Mackie Control XT", "F0 00 00 66 15 12", 0) == "Trk 25 ");
  124. CHECK (in ("Mackie Control XT", { 0x90, 49, 127 }) && hub.shared ("mackie")->mixerBank == 17 && in ("Mackie Control", { 0x90, 48, 127 })
  125. && in ("Mackie Control", { 0x90, 46, 127 }) && hub.shared ("mackie")->mixerBank == 0);
  126. // ASSIGNMENT Plug-in: the V-Pots are the focused plugin's parameters, the cursor keys turn the pages
  127. clear();
  128. lynx.log.clear();
  129. CHECK (in ("Mackie Control", { 0x90, 43, 127 }) && hub.shared ("mackie")->layer == 1);
  130. CHECK (in ("Mackie Control", { 0xB0, 16, 0x02 }) && lynx.did ("param 0 0.270") && in ("Mackie Control XT", { 0xB0, 16, 0x02 }) && lynx.did ("param 8 0.270"));
  131. hub.refresh (lynx, send);
  132. CHECK (main.has ("90 2B 7F") && main.has ("90 2A 00") && lcd ("Mackie Control", "F0 00 00 66 14 12", 0) == "Par 1 "
  133. && lcd ("Mackie Control", "F0 00 00 66 14 12", 56) == "27% " && lcd ("Mackie Control XT", "F0 00 00 66 15 12", 0) == "Par 9 ");
  134. CHECK (in ("Mackie Control", { 0x90, 99, 127 }) && hub.shared ("mackie")->page == 1 && in ("Mackie Control", { 0x90, 98, 127 }) && hub.shared ("mackie")->page == 0);
  135. // ASSIGNMENT Track: the Channel Rack's volumes; a V-Pot push selects the channel; cursor up / down too
  136. clear();
  137. lynx.log.clear();
  138. CHECK (in ("Mackie Control", { 0x90, 40, 127 }) && hub.shared ("mackie")->layer == 2);
  139. CHECK (in ("Mackie Control", { 0xB0, 17, 0x45 }) && lynx.did ("channel volume 1 0.750") && in ("Mackie Control", { 0x90, 34, 127 }) && lynx.selected == 2);
  140. CHECK (in ("Mackie Control", { 0x90, 97, 127 }) && lynx.selected == 3 && in ("Mackie Control", { 0x90, 96, 127 }) && lynx.selected == 2);
  141. hub.refresh (lynx, send);
  142. CHECK (lcd ("Mackie Control", "F0 00 00 66 14 12", 0) == "Chan 1 " && lcd ("Mackie Control", "F0 00 00 66 14 12", 56 + 7) == "75% ");
  143. CHECK (in ("Mackie Control", { 0x90, 42, 127 }) && hub.shared ("mackie")->layer == 0);
  144. // in the Pan layer a V-Pot push and the cursor's left / right do nothing
  145. lynx.log.clear();
  146. CHECK (in ("Mackie Control", { 0x90, 34, 127 }) && in ("Mackie Control", { 0x90, 98, 127 }) && lynx.log.empty() && hub.shared ("mackie")->page == 0);
  147. // transport and jog
  148. lynx.log.clear();
  149. CHECK (in ("Mackie Control", { 0x90, 94, 127 }) && lynx.playing && in ("Mackie Control", { 0x90, 93, 127 }) && ! lynx.playing
  150. && in ("Mackie Control", { 0x90, 95, 127 }) && lynx.recording && in ("Mackie Control", { 0x90, 86, 127 }) && ! lynx.patternMode
  151. && in ("Mackie Control", { 0x90, 89, 127 }) && lynx.click);
  152. CHECK (in ("Mackie Control", { 0x90, 91, 127 }) && lynx.did ("command " + std::to_string ((int) Command::rewind)) && in ("Mackie Control", { 0x90, 92, 127 })
  153. && lynx.did ("command " + std::to_string ((int) Command::forward)) && in ("Mackie Control", { 0x90, 81, 127 })
  154. && lynx.did ("command " + std::to_string ((int) Command::undo)));
  155. CHECK (in ("Mackie Control", { 0xB0, 60, 0x01 }) && lynx.did ("jog 1") && in ("Mackie Control", { 0xB0, 60, 0x41 }) && lynx.did ("jog -1"));
  156. // the surface's other switches are taken and do nothing; other channels and controllers are not the surface's
  157. lynx.log.clear();
  158. const Claims claims (*lib.find ("mackie-control"));
  159. const std::uint8_t f1[] { 0x90, 54, 127 }, shift[] { 0x90, 70, 127 }, zoom[] { 0x90, 100, 127 }, key[] { 0x91, 60, 100 }, wheel[] { 0xB0, 1, 64 },
  160. pedal[] { 0xB0, 64, 127 }, bend10[] { 0xE9, 0, 64 };
  161. CHECK (claims.has (f1, 3) && claims.has (shift, 3) && claims.has (zoom, 3) && ! claims.has (key, 3) && ! claims.has (wheel, 3) && ! claims.has (pedal, 3)
  162. && ! claims.has (bend10, 3));
  163. CHECK (in ("Mackie Control", { 0x90, 54, 127 }) && in ("Mackie Control", { 0x90, 70, 127 }) && lynx.log.empty());
  164. CHECK (! in ("Mackie Control", { 0x91, 60, 100 }) && ! in ("Mackie Control", { 0xB0, 1, 64 }));
  165. hub.closeAll (send);
  166. }
  167. TEST (controller190aw_launchkey_mk3_daw_mode_profile)
  168. {
  169. using namespace c190aw;
  170. const auto lib = Library::builtIn();
  171. FakeSurface lynx;
  172. lynx.rack[0].name = "Kick";
  173. Shared shared;
  174. Session s (lib.find ("novation-launchkey-mk3"), 0);
  175. Wire wire;
  176. s.open (lynx, shared, wire.send());
  177. // DAW mode on first, then the display (16 characters a row) and the selected fader button's light
  178. CHECK (wire.messages.size() >= 3 && wire.messages[0] == "9F 0C 7F");
  179. CHECK (wire.has ("F0 00 20 29 02 0F 04 00 4B 69 63 6B 20 20 20 20 20 20 20 20 20 20 20 20 F7")); // "Kick"
  180. CHECK (wire.has ("F0 00 20 29 02 0F 04 01 50 61 6E 20 20 20 20 20 20 20 20 20 20 20 20 20 F7")); // "Pan"
  181. CHECK (wire.has ("BF 25 7F") && wire.has ("BF 26 00") && wire.has ("90 60 00"));
  182. // pots (channel 16) are pans at first, with soft takeover; the keyboard's pot mode report changes what they turn
  183. lynx.log.clear();
  184. CHECK (feed (s, lynx, shared, { 0xBF, 21, 10 }) && lynx.log.empty());
  185. CHECK (feed (s, lynx, shared, { 0xBF, 21, 64 }) && lynx.did ("pan 1 0.504"));
  186. CHECK (feed (s, lynx, shared, { 0xBF, 9, 1 }) && shared.layer == 1);
  187. CHECK (feed (s, lynx, shared, { 0xBF, 22, 101 }) && lynx.did ("volume 2 0.795"));
  188. CHECK (feed (s, lynx, shared, { 0xBF, 9, 2 }) && shared.layer == 2);
  189. CHECK (feed (s, lynx, shared, { 0xBF, 28, 32 }) && lynx.did ("param 7 0.252"));
  190. CHECK (feed (s, lynx, shared, { 0xBF, 9, 4 }) && shared.layer == 2); // (Send A: no layer of LYNX's, the last one stays)
  191. CHECK (feed (s, lynx, shared, { 0xBF, 9, 3 }) && shared.layer == 0);
  192. // faders, master fader, fader buttons, track and scene buttons
  193. lynx.log.clear();
  194. CHECK (feed (s, lynx, shared, { 0xBF, 53 + 4, 102 }) && lynx.did ("volume 5 0.803") && feed (s, lynx, shared, { 0xBF, 61, 101 }) && lynx.did ("volume 0 0.795"));
  195. CHECK (feed (s, lynx, shared, { 0xBF, 37 + 2, 127 }) && lynx.selectedTrack == 3 && feed (s, lynx, shared, { 0xBF, 37 + 2, 0 }));
  196. CHECK (feed (s, lynx, shared, { 0xBF, 103, 127 }) && shared.mixerBank == 8 && feed (s, lynx, shared, { 0xBF, 102, 127 }) && shared.mixerBank == 0);
  197. CHECK (feed (s, lynx, shared, { 0xBF, 107, 127 }) && lynx.selected == 1 && feed (s, lynx, shared, { 0xBF, 106, 127 }) && lynx.selected == 0);
  198. // transport (channel 16), the two pad-column buttons (channel 1)
  199. CHECK (feed (s, lynx, shared, { 0xBF, 115, 127 }) && lynx.playing && feed (s, lynx, shared, { 0xBF, 115, 0 }) && lynx.playing
  200. && feed (s, lynx, shared, { 0xBF, 116, 127 }) && ! lynx.playing && feed (s, lynx, shared, { 0xBF, 117, 127 }) && lynx.recording
  201. && feed (s, lynx, shared, { 0xBF, 118, 127 }) && ! lynx.patternMode && feed (s, lynx, shared, { 0xBF, 76, 127 }) && lynx.click);
  202. CHECK (feed (s, lynx, shared, { 0xBF, 77, 127 }) && lynx.did ("command " + std::to_string ((int) Command::undo)));
  203. CHECK (feed (s, lynx, shared, { 0xB0, 104, 127 }) && lynx.did ("command " + std::to_string ((int) Command::nextPattern))
  204. && feed (s, lynx, shared, { 0xB0, 105, 127 }) && lynx.did ("command " + std::to_string ((int) Command::previousPattern)));
  205. // Session pads: the 16 steps, lit red
  206. wire.clear();
  207. CHECK (feed (s, lynx, shared, { 0x90, 96, 100 }) && lynx.stepsOn[0] && feed (s, lynx, shared, { 0x90, 96, 0 }) && lynx.stepsOn[0]);
  208. CHECK (feed (s, lynx, shared, { 0x90, 119, 100 }) && lynx.stepsOn[15] && feed (s, lynx, shared, { 0x90, 112, 1 }) && lynx.stepsOn[8]);
  209. s.refresh (lynx, shared, wire.send());
  210. CHECK (wire.has ("90 60 05") && wire.has ("90 77 05") && wire.has ("90 70 05") && wire.has ("BF 27 7F") && wire.has ("BF 25 00"));
  211. CHECK (feed (s, lynx, shared, { 0x90, 96, 100 }) && ! lynx.stepsOn[0]);
  212. s.refresh (lynx, shared, wire.send());
  213. CHECK (wire.has ("90 60 00"));
  214. // the DAW port's other buttons are taken and do nothing; a key or wheel (first port) is not the profile's
  215. lynx.log.clear();
  216. CHECK (feed (s, lynx, shared, { 0xBF, 74, 127 }) && feed (s, lynx, shared, { 0xBF, 52, 127 }) && feed (s, lynx, shared, { 0xB0, 108, 127 })
  217. && feed (s, lynx, shared, { 0xBF, 3, 2 }) && lynx.log.empty());
  218. CHECK (! feed (s, lynx, shared, { 0x90, 60, 100 }) && ! feed (s, lynx, shared, { 0xB0, 1, 64 }) && ! feed (s, lynx, shared, { 0xE0, 0, 64 })
  219. && ! feed (s, lynx, shared, { 0x99, 36, 100 }));
  220. // closing: lights off, the display blank, DAW mode off last
  221. wire.clear();
  222. s.close (wire.send());
  223. CHECK (wire.has ("90 77 00") && wire.has ("BF 27 00") && wire.count ("F0 00 20 29 02 0F 04") == 2 && wire.messages.back() == "9F 0C 00");
  224. }
  225. TEST (controller190aw_apc_key_25_mk2_profile)
  226. {
  227. using namespace c190aw;
  228. const auto lib = Library::builtIn();
  229. FakeSurface lynx;
  230. Shared shared;
  231. Session s (lib.find ("akai-apc-key-25-mk2"), 0);
  232. Wire wire;
  233. s.open (lynx, shared, wire.send());
  234. // the Introduction message first; the Volume layer's light and the selected track's
  235. CHECK (! wire.messages.empty() && wire.messages[0] == "F0 47 7F 4E 60 00 04 00 01 00 00 F7");
  236. CHECK (wire.has ("90 52 01") && wire.has ("90 53 00") && wire.has ("90 40 01") && wire.has ("90 41 00") && wire.has ("96 20 00"));
  237. // knobs are relative (1… up, 127… down): volume, then pan, then the focused plugin's parameters
  238. lynx.log.clear();
  239. CHECK (feed (s, lynx, shared, { 0xB0, 48, 0x02 }) && lynx.did ("volume 1 0.820") && feed (s, lynx, shared, { 0xB0, 48, 0x7D }) && lynx.did ("volume 1 0.790"));
  240. CHECK (feed (s, lynx, shared, { 0x90, 83, 127 }) && shared.layer == 1 && feed (s, lynx, shared, { 0xB0, 55, 0x01 }) && lynx.did ("pan 8 0.510"));
  241. CHECK (feed (s, lynx, shared, { 0x90, 84, 127 }) && shared.layer == 2 && feed (s, lynx, shared, { 0xB0, 49, 0x7F }) && lynx.did ("param 1 0.240"));
  242. wire.clear();
  243. s.refresh (lynx, shared, wire.send());
  244. CHECK (wire.has ("90 54 01") && wire.has ("90 52 00") && wire.messages.size() == 2);
  245. // pads: the two top rows are steps (lit red at full brightness), the lower rows play notes from key 36
  246. wire.clear();
  247. lynx.log.clear();
  248. CHECK (feed (s, lynx, shared, { 0x90, 32, 127 }) && lynx.stepsOn[0] && feed (s, lynx, shared, { 0x80, 32, 0 }) && feed (s, lynx, shared, { 0x90, 31, 127 }) && lynx.stepsOn[15]);
  249. CHECK (feed (s, lynx, shared, { 0x90, 0, 127 }) && lynx.did ("note on 36 1.000") && feed (s, lynx, shared, { 0x80, 0, 0 }) && lynx.did ("note off 36 0.000")
  250. && feed (s, lynx, shared, { 0x90, 23, 64 }) && lynx.did ("note on 59 0.504"));
  251. s.refresh (lynx, shared, wire.send());
  252. CHECK (wire.has ("96 20 05") && wire.has ("96 1F 05") && wire.messages.size() == 2);
  253. // track buttons select, Scene Launch 4 / 5 move the bank, the transport buttons, Shift does nothing
  254. lynx.log.clear();
  255. CHECK (feed (s, lynx, shared, { 0x90, 64 + 5, 127 }) && lynx.selectedTrack == 6 && feed (s, lynx, shared, { 0x90, 86, 127 }) && shared.mixerBank == 8
  256. && feed (s, lynx, shared, { 0x90, 64, 127 }) && lynx.selectedTrack == 9 && feed (s, lynx, shared, { 0x90, 85, 127 }) && shared.mixerBank == 0);
  257. CHECK (feed (s, lynx, shared, { 0x90, 91, 127 }) && lynx.playing && feed (s, lynx, shared, { 0x90, 81, 127 }) && ! lynx.playing
  258. && feed (s, lynx, shared, { 0x90, 93, 127 }) && lynx.recording);
  259. lynx.log.clear();
  260. CHECK (feed (s, lynx, shared, { 0x90, 98, 127 }) && lynx.log.empty());
  261. // (a pad number outside the matrix and the sustain pedal are not the profile's)
  262. CHECK (! feed (s, lynx, shared, { 0x90, 45, 127 }) && ! feed (s, lynx, shared, { 0xB0, 64, 127 }));
  263. }