2 ZynAddSubFX - a software synthesizer
4 KitTest.h - Test For Note Allocation Under Kits
5 Copyright (C) 2016 Mark McCurry
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 #include <cxxtest/TestSuite.h>
17 #include "../Misc/Time.h"
18 #include "../Misc/Allocator.h"
19 #include "../DSP/FFTwrapper.h"
20 #include "../Misc/Microtonal.h"
21 #define private public
22 #define protected public
23 #include "../Synth/SynthNote.h"
24 #include "../Misc/Part.h"
25 #include "../globals.h"
33 #define SUSTAIN_BIT 0x04
34 enum PrivateNoteStatus
{
37 KEY_RELEASED_AND_SUSTAINED
= 0x02,
42 class KitTest
:public CxxTest::TestSuite
47 Microtonal microtonal
;
53 :fft(512), microtonal(dummy
)
57 time
= new AbsTime(*synth
);
58 outL
= new float[synth
->buffersize
];
59 outR
= new float[synth
->buffersize
];
60 memset(outL
, 0, synth
->bufferbytes
);
61 memset(outR
, 0, synth
->bufferbytes
);
64 part
= new Part(alloc
, *synth
, *time
, dummy
, dummy
, µtonal
, &fft
);
67 //Standard poly mode with sustain
68 void testSustainCase1() {
70 part
->ctl
.setsustain(127);
72 part
->NoteOn(64, 127, 0);
73 part
->NoteOn(64, 127, 0);
76 //first note has moved to release state
77 //second note has moved to sustain state
79 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
80 (NotePool::NoteDescriptor
{
85 .status
=KEY_RELEASED
|SUSTAIN_BIT
,
86 .legatoMirror
=false}));
88 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
89 (NotePool::NoteDescriptor
{
94 .status
=KEY_RELEASED_AND_SUSTAINED
,
95 .legatoMirror
=false}));
97 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
98 (NotePool::NoteDescriptor
{
104 .legatoMirror
=false}));
107 void testSustainCase2() {
109 part
->ctl
.setsustain(127);
111 part
->NoteOn(64, 127, 0);
113 part
->NoteOn(64, 127, 0);
115 //first note has moved to release state
116 //second note has stayed in playing state
118 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
119 (NotePool::NoteDescriptor
{
124 .status
=KEY_RELEASED
|SUSTAIN_BIT
,
125 .legatoMirror
=false}));
127 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
128 (NotePool::NoteDescriptor
{
134 .legatoMirror
=false}));
136 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
137 (NotePool::NoteDescriptor
{
143 .legatoMirror
=false}));
146 void testMonoSustain() {
148 part
->ctl
.setsustain(127);
149 part
->Ppolymode
= false;
151 part
->NoteOn(64, 127, 0);
153 part
->NoteOn(65, 127, 0);
155 part
->notePool
.dump();
157 //first note has moved to release state
158 //second note has stayed in playing state
160 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
161 (NotePool::NoteDescriptor
{
166 .status
=KEY_RELEASED
,
167 .legatoMirror
=false}));
169 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
170 (NotePool::NoteDescriptor
{
176 .legatoMirror
=false}));
178 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
179 (NotePool::NoteDescriptor
{
185 .legatoMirror
=false}));
188 //Enumerate cases of:
189 //Legato = {disabled,enabled}
190 //Mono = {disabled, enabled}
191 //Kit = {off, normal, single}
192 //ignore legato=enabled, mono=enabled
195 void testNoKitNoLegatoNoMono() {
196 part
->NoteOn(64, 127, 0);
197 part
->NoteOn(65, 127, 0);
199 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
200 (NotePool::NoteDescriptor
{
206 .legatoMirror
=false}));
208 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
209 (NotePool::NoteDescriptor
{
215 .legatoMirror
=false}));
217 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
218 (NotePool::NoteDescriptor
{
224 .legatoMirror
=false}));
227 void testNoKitYesLegatoNoMono() {
228 part
->Ppolymode
= false;
229 part
->Plegatomode
= true;
230 part
->NoteOn(64, 127, 0);
231 part
->NoteOn(65, 127, 0);
233 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
234 (NotePool::NoteDescriptor
{
240 .legatoMirror
=false}));
242 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
243 (NotePool::NoteDescriptor
{
249 .legatoMirror
=false}));
251 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
252 (NotePool::NoteDescriptor
{
258 .legatoMirror
=false}));
260 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
261 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
262 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
263 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
265 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
266 if(part
->notePool
.sdesc
[1].note
)
267 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, true);
268 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
269 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 0)
272 void testNoKitNoLegatoYesMono() {
273 part
->Ppolymode
= false;
274 part
->Plegatomode
= false;
275 part
->NoteOn(64, 127, 0);
276 part
->NoteOn(65, 127, 0);
279 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
280 (NotePool::NoteDescriptor
{
285 .status
=KEY_RELEASED
,
286 .legatoMirror
=false}));
288 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
289 (NotePool::NoteDescriptor
{
295 .legatoMirror
=false}));
297 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
298 (NotePool::NoteDescriptor
{
304 .legatoMirror
=false}));
306 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
307 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
308 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
309 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
311 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
312 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, false);
313 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
314 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 0)
318 //Three patches that overlap give an overlapping response
319 void testYesKitNoLegatoNoMono() {
320 part
->setkititemstatus(1, true);
321 part
->setkititemstatus(2, true);
322 part
->kit
[1].Padenabled
= true;
323 part
->kit
[2].Padenabled
= true;
324 part
->kit
[2].Pmaxkey
= 32;
326 part
->NoteOn(64, 127, 0);
327 part
->NoteOn(65, 127, 0);
329 part
->notePool
.dump();
331 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
332 (NotePool::NoteDescriptor
{
338 .legatoMirror
=false}));
340 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
341 (NotePool::NoteDescriptor
{
347 .legatoMirror
=false}));
349 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
350 (NotePool::NoteDescriptor
{
356 .legatoMirror
=false}));
358 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
359 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
360 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
361 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
363 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
364 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, false);
365 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
366 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 1)
368 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[2].note
, nullptr);
369 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].note
->legato
.silent
, false);
370 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].type
, 0)
371 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].kit
, 0)
373 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[3].note
, nullptr);
374 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].note
->legato
.silent
, false);
375 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].type
, 0)
376 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].kit
, 1)
378 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].note
, nullptr);
379 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].type
, 0)
380 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].kit
, 0)
383 void testYesKitYesLegatoNoMono() {
384 part
->setkititemstatus(1, true);
385 part
->setkititemstatus(2, true);
386 part
->kit
[1].Padenabled
= true;
387 part
->kit
[2].Padenabled
= true;
388 part
->kit
[2].Pmaxkey
= 32;
390 part
->Ppolymode
= false;
391 part
->Plegatomode
= true;
392 part
->NoteOn(64, 127, 0);
393 part
->NoteOn(65, 127, 0);
395 part
->notePool
.dump();
397 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
398 (NotePool::NoteDescriptor
{
404 .legatoMirror
=false}));
406 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
407 (NotePool::NoteDescriptor
{
413 .legatoMirror
=false}));
415 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
416 (NotePool::NoteDescriptor
{
422 .legatoMirror
=false}));
424 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
425 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
426 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
427 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
429 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
430 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, false);
431 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
432 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 1)
434 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[2].note
, nullptr);
435 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].note
->legato
.silent
, true);
436 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].type
, 0)
437 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].kit
, 0)
439 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[3].note
, nullptr);
440 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].note
->legato
.silent
, true);
441 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].type
, 0)
442 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].kit
, 1)
444 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].note
, nullptr);
445 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].type
, 0)
446 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].kit
, 0)
449 void testYesKitNoLegatoYesMono() {
450 part
->setkititemstatus(1, true);
451 part
->setkititemstatus(2, true);
452 part
->kit
[1].Padenabled
= true;
453 part
->kit
[2].Padenabled
= true;
454 part
->kit
[2].Pmaxkey
= 32;
456 part
->Ppolymode
= false;
457 part
->Plegatomode
= false;
458 part
->NoteOn(64, 127, 0);
459 part
->NoteOn(65, 127, 0);
461 part
->notePool
.dump();
463 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
464 (NotePool::NoteDescriptor
{
469 .status
=KEY_RELEASED
,
470 .legatoMirror
=false}));
472 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
473 (NotePool::NoteDescriptor
{
479 .legatoMirror
=false}));
481 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
482 (NotePool::NoteDescriptor
{
488 .legatoMirror
=false}));
490 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
491 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
492 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
493 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
495 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
496 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, false);
497 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
498 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 1)
500 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[2].note
, nullptr);
501 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].note
->legato
.silent
, false);
502 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].type
, 0)
503 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].kit
, 0)
505 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[3].note
, nullptr);
506 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].note
->legato
.silent
, false);
507 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].type
, 0)
508 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[3].kit
, 1)
510 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].note
, nullptr);
511 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].type
, 0)
512 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[4].kit
, 0)
516 void testSingleKitNoLegatoNoMono() {
517 part
->setkititemstatus(1, true);
518 part
->setkititemstatus(2, true);
519 part
->kit
[1].Padenabled
= true;
520 part
->kit
[2].Padenabled
= true;
521 part
->kit
[2].Pmaxkey
= 32;
523 part
->NoteOn(64, 127, 0);
524 part
->NoteOn(65, 127, 0);
526 part
->notePool
.dump();
528 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
529 (NotePool::NoteDescriptor
{
535 .legatoMirror
=false}));
537 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
538 (NotePool::NoteDescriptor
{
544 .legatoMirror
=false}));
546 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
547 (NotePool::NoteDescriptor
{
553 .legatoMirror
=false}));
555 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
556 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
557 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
558 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
560 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
561 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, false);
562 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
563 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 0)
565 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].note
, nullptr);
566 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].type
, 0)
567 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[2].kit
, 0)
570 void testSingleKitYesLegatoNoMono() {
571 part
->setkititemstatus(1, true);
572 part
->setkititemstatus(2, true);
573 part
->kit
[1].Padenabled
= true;
574 part
->kit
[2].Padenabled
= true;
575 part
->kit
[2].Pmaxkey
= 32;
577 part
->Ppolymode
= false;
578 part
->Plegatomode
= true;
579 part
->NoteOn(64, 127, 0);
580 part
->NoteOn(65, 127, 0);
582 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
583 (NotePool::NoteDescriptor
{
589 .legatoMirror
=false}));
591 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
592 (NotePool::NoteDescriptor
{
598 .legatoMirror
=false}));
600 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
601 (NotePool::NoteDescriptor
{
607 .legatoMirror
=false}));
609 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
610 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
611 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
612 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
614 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
615 if(part
->notePool
.sdesc
[1].note
)
616 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, true);
617 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
618 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 0)
621 void testSingleKitNoLegatoYesMono() {
622 part
->setkititemstatus(1, true);
623 part
->setkititemstatus(2, true);
624 part
->kit
[1].Padenabled
= true;
625 part
->kit
[2].Padenabled
= true;
626 part
->kit
[2].Pmaxkey
= 32;
628 part
->Ppolymode
= false;
629 part
->Plegatomode
= false;
630 part
->NoteOn(64, 127, 0);
631 part
->NoteOn(65, 127, 0);
635 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[0],
636 (NotePool::NoteDescriptor
{
641 .status
=KEY_RELEASED
,
642 .legatoMirror
=false}));
644 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[1],
645 (NotePool::NoteDescriptor
{
651 .legatoMirror
=false}));
653 TS_ASSERT_EQUALS(part
->notePool
.ndesc
[2],
654 (NotePool::NoteDescriptor
{
660 .legatoMirror
=false}));
662 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[0].note
, nullptr);
663 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].note
->legato
.silent
, false);
664 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].type
, 0)
665 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[0].kit
, 0)
667 TS_ASSERT_DIFFERS(part
->notePool
.sdesc
[1].note
, nullptr);
668 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].note
->legato
.silent
, false);
669 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].type
, 0)
670 TS_ASSERT_EQUALS(part
->notePool
.sdesc
[1].kit
, 0)
673 void testKeyLimit(void)
675 auto &pool
= part
->notePool
;
676 //Verify that without a key limit, several notes can be run
677 part
->NoteOn(64, 127, 0);
678 part
->NoteOn(65, 127, 0);
679 part
->NoteOn(66, 127, 0);
680 part
->NoteOn(67, 127, 0);
681 part
->NoteOn(68, 127, 0);
683 //Verify that notes are spawned as expected
684 TS_ASSERT_EQUALS(pool
.usedNoteDesc(), 5);
685 TS_ASSERT_EQUALS(pool
.usedSynthDesc(), 5);
688 part
->monomemClear();
691 //Verify that notes are despawned
692 TS_ASSERT_EQUALS(pool
.usedNoteDesc(), 0);
693 TS_ASSERT_EQUALS(pool
.usedSynthDesc(), 0);
696 part
->setkeylimit(3);
699 part
->NoteOn(64, 127, 0);
700 part
->NoteOn(65, 127, 0);
701 part
->NoteOn(66, 127, 0);
702 part
->NoteOn(67, 127, 0);
703 part
->NoteOn(68, 127, 0);
705 //Verify that notes are spawned as expected with limit
706 TS_ASSERT_EQUALS(pool
.getRunningNotes(), 3);//2 entombed
707 TS_ASSERT_EQUALS(pool
.usedNoteDesc(), 5);
708 TS_ASSERT_EQUALS(pool
.usedSynthDesc(), 5);
711 part
->monomemClear();
714 //Verify that notes are despawned
715 TS_ASSERT_EQUALS(pool
.usedNoteDesc(), 0);
716 TS_ASSERT_EQUALS(pool
.usedSynthDesc(), 0);
718 //Now to test note stealing
721 part
->NoteOn(64, 127, 0);
722 part
->NoteOn(65, 127, 0);
723 part
->NoteOn(66, 127, 0);
725 //Verify that note pool is full
726 TS_ASSERT_EQUALS(pool
.usedNoteDesc(), 3);
727 TS_ASSERT_EQUALS(pool
.usedSynthDesc(), 3);
730 pool
.ndesc
[1].age
= 50;
731 pool
.ndesc
[2].age
= 500;
733 printf("-------------------------------------\n");
735 //Inject two more notes which should steal the note
736 //descriptors for #66 and #65
737 part
->NoteOn(67, 127, 0);
739 TS_ASSERT_EQUALS(pool
.ndesc
[0].note
, 64);
740 TS_ASSERT_EQUALS(pool
.ndesc
[1].note
, 65);
741 TS_ASSERT_EQUALS(pool
.ndesc
[2].note
, 66);
742 TS_ASSERT_EQUALS(pool
.ndesc
[2].status
, KEY_RELEASED
);
743 TS_ASSERT_EQUALS(pool
.ndesc
[3].note
, 67);
745 part
->NoteOn(68, 127, 0);
747 //Verify that note pool is still full and entombed
748 TS_ASSERT_EQUALS(pool
.usedNoteDesc(), 5);
749 TS_ASSERT_EQUALS(pool
.usedSynthDesc(), 5);
751 //Check that the result is {64, 68, 67}
752 TS_ASSERT_EQUALS(pool
.ndesc
[0].note
, 64);
753 TS_ASSERT_EQUALS(pool
.ndesc
[1].note
, 65);
754 TS_ASSERT_EQUALS(pool
.ndesc
[1].status
, KEY_RELEASED
);
755 TS_ASSERT_EQUALS(pool
.ndesc
[2].note
, 66);
756 TS_ASSERT_EQUALS(pool
.ndesc
[2].status
, KEY_RELEASED
);
757 TS_ASSERT_EQUALS(pool
.ndesc
[3].note
, 67);
758 TS_ASSERT_EQUALS(pool
.ndesc
[4].note
, 68);