This repository has been archived by the owner on Feb 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sc-test-webpages.lsp
6021 lines (5834 loc) · 272 KB
/
sc-test-webpages.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: sc-test-webpages.lsp
;;;
;;; Class Hierarchy: None
;;;
;;; Version: 1.0
;;;
;;; Project: slippery chicken (algorithmic composition)
;;;
;;; Purpose: Run tests of all user's guide webpage examples. Only FAIL
;;; feedback and desired warnings are printed. A
;;; message will be printed at the end of the run to
;;; indicate whether all tests passed or not.
;;;
;;; Author: Michael Edwards: [email protected]
;;;
;;; Creation date: 7th December 2011 (Edinburgh)
;;;
;;; $$ Last modified: 11:44:14 Tue Oct 27 2020 CET
;;;
;;; SVN ID: $Id: sc-test-suite.lsp 2976 2012-07-24 10:06:19Z sreed23 $
;;;
;;; ****
;;; Licence: Copyright (c) 2010 Michael Edwards
;;;
;;; This file is part of slippery-chicken
;;;
;;; slippery-chicken is free software; you can redistribute it
;;; and/or modify it under the terms of the GNU General
;;; Public License as published by the Free Software
;;; Foundation; either version 2 of the License, or (at your
;;; option) any later version.
;;;
;;; slippery-chicken is distributed in the hope that it will
;;; be useful, but WITHOUT ANY WARRANTY; without even the
;;; implied warranty of MERCHANTABILITY or FITNESS FOR A
;;; PARTICULAR PURPOSE. See the GNU General Public License
;;; for more details.
;;;
;;; You should have received a copy of the GNU General Public
;;; License along with slippery-chicken; if not, write to the
;;; Free Software Foundation, Inc., 59 Temple Place, Suite
;;; 330, Boston, MA 02111-1307 USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :sc)
(in-scale :quarter-tone)
(set-sc-config 'cmn-display-auto-open nil)
(set-sc-config 'default-dir "/tmp/")
(load-from-test-suite-dir "sc-test-suite-aux.lsp")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; webpage example-code tests
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; chop.html
;;; SAR Fri Jul 6 12:02:20 BST 2012
(sc-deftest test-webpage-chop ()
(let* ((orig-palette (make-rsp 'orig
'((1 ((((1 4) - s e s - ))
:pitch-seq-palette ((1 2 3))))
(2 ((((1 4) - e. s - ))
:pitch-seq-palette ((1 2))))
(3 ((((1 4) - (e.) s - ))
:pitch-seq-palette ((1)))))))
(chopped-palette (chop orig-palette
'((1 4)
(1 3) (2 4)
(1 2) (2 3) (3 4)
(1 1) (2 2) (3 3) (4 4)) ; chop points
's)) ; chopping unit
(sc-chopped-example
(make-slippery-chicken
'+sc-chopped-example+
:title "sc chopped example"
:instrument-palette +slippery-chicken-standard-instrument-palette+
:ensemble '(((vn (violin :midi-channel 1))))
:tempo-map '((1 (q 60)))
:bars-per-system-map '((1 10))
:set-palette '((1 ((c4 d4 e4))))
:set-map '((1 (1 1 1 1 1)))
:rthm-seq-palette chopped-palette
:rthm-seq-map '((1 ((vn ((1 1) (1 2) (1 3) (2 1) (3 2)))))))))
#+cmn (probe-delete "/tmp/sc-chopped-example.eps")
(sc-test-check
#+cmn (cmn-display sc-chopped-example :file
"/tmp/sc-chopped-example.eps")
#+cmn (file-write-ok "/tmp/sc-chopped-example.eps" 13000)
(= 5 (num-bars sc-chopped-example))
(equalp
(loop for b from 1 to (num-bars sc-chopped-example)
collect (data (get-time-sig (get-bar sc-chopped-example b 'vn))))
;; MDE Tue Oct 27 11:13:20 2020, Heidhausen -- changing this slightly
;; because of new meter preferences (2/8 instead of 1/4)
;; '((1 4) (3 16) (3 16) (1 4) (3 16)))
'((2 8) (3 16) (3 16) (2 8) (3 16)))
(not (next-event sc-chopped-example 'vn nil 1))
(equalp
(loop for ne = (next-event sc-chopped-example 'vn)
while ne
collect (data ne))
'(S E S S E E S E. S 16/3))
(not (next-event sc-chopped-example 'vn nil 1))
(equalp
(loop for ne = (next-event sc-chopped-example 'vn)
while ne
collect (is-rest ne))
'(NIL NIL NIL NIL NIL NIL NIL NIL NIL T)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; chords.html
;;; SAR Fri Jul 6 12:12:49 BST 2012
(sc-deftest test-webpage-chords-parens-make-chord-objs ()
(let ((slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((pn (piano :midi-channel 1))))
:set-palette '((1 ((c2 d2 e2 f2 g2 a2 b2
c3 d3 e3 f3 g3 a3 b3
c4 d4 e4 f4 g4 a4 b4
c5 d5 e5 f5 g5 a5 b5 c6))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
:pitch-seq-palette ((1 (3) 2 3 (5) 4 6 3)))))
:rthm-seq-map '((1 ((pn (1))))))))
#+cmn (probe-delete "/tmp/slippery-chicken-piece.eps")
(sc-test-check
#+cmn (cmn-display slippery-chicken-piece)
#+cmn (file-write-ok "/tmp/slippery-chicken-piece.eps" 10000)
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T NIL NIL NIL)))))
;;; SAR Thu Mar 15 11:36:26 GMT 2012
(sc-deftest test-webpage-chords-inst-obj-chords-t ()
(let ((pno
(make-instrument
'piano
:staff-name "piano" :staff-short-name "pno"
:lowest-written 'a0 :highest-written 'c8
:clefs '(treble bass double-treble double-bass)
:starting-clef 'treble
:microtones nil :largest-fast-leap 9
:chords t :chord-function 'piano-chord-fun
:midi-program 1)))
(sc-test-check
(equalp (loop for i in '(id staff-name staff-short-name clefs
starting-clef microtones largest-fast-leap
chords chord-function midi-program)
collect (funcall i pno))
'(PIANO "piano" "pno" (DOUBLE-BASS DOUBLE-TREBLE BASS TREBLE)
TREBLE NIL 9 T PIANO-CHORD-FUN 1))
(pitch-p (highest-written pno))
(pitch-p (lowest-written pno))
(equalp (data (highest-written pno)) 'c8)
(equalp (data (lowest-written pno)) 'a0))))
;;; SAR Fri Jul 6 12:23:20 BST 2012
(sc-deftest test-webpage-chords-def-chrd-fn-examp ()
(let ((slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((vb (vibraphone :midi-channel 1))))
:set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((1 (2) 3 4 (5) (6) (7)
8)))))
:rthm-seq-map '((1 ((vb (1))))))))
#+cmn (probe-delete "/tmp/slippery-chicken-piece.eps")
(sc-test-check
#+cmn (cmn-display slippery-chicken-piece)
#+cmn (file-write-ok "/tmp/slippery-chicken-piece.eps" 7500)
(not (next-event slippery-chicken-piece 'vb nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'vb)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T T T NIL))
(not (next-event slippery-chicken-piece 'vb nil 1))
(equalp
(print (loop for ne = (next-event slippery-chicken-piece 'vb)
while ne
collect (get-pitch-symbol ne)))
'(C4 (C4 e4) E4 F4 (e4 G4) (f4 A4) (g4 B4) C5)))))
;;; SAR Fri Jul 6 12:28:00 BST 2012
(sc-deftest test-webpage-chords-pno-chrd-fun-examp ()
(let ((slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((pn (piano :midi-channel 1))))
:set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((1 (2) 3 4 (5) (6) (7)
8)))))
:rthm-seq-map '((1 ((pn (1))))))))
#+cmn (probe-delete "/tmp/slippery-chicken-piece.eps")
(sc-test-check
#+cmn (cmn-display slippery-chicken-piece)
#+cmn (file-write-ok "/tmp/slippery-chicken-piece.eps" 8400)
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T T T NIL))
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (get-pitch-symbol ne))
;;'((C4 (C4 D4 E4 F4) E4 F4 (D4 E4 F4 G4) (E4 F4 G4 A4) (F4 G4 A4 B4) C5))
'(C4 (C4 D4 E4 F4) E4 F4 (D4 E4 F4 G4) (E4 F4 G4 A4) (F4 G4 A4 B4) C5)
))))
;;; SAR Fri Jul 6 12:37:39 BST 2012
(sc-deftest test-webpage-chords-set-slot ()
(sc-test-check
(set-slot 'chord-function 'PIANO-CHORD-FUN 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN)
(set-slot 'chord-function 'chord-fun1 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'CHORD-FUN1)
(set-slot 'chord-function 'PIANO-CHORD-FUN 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN)))
;;; SAR Fri Jul 6 12:49:00 BST 2012
(sc-deftest test-webpage-chords-chrd-fun-1-examp ()
(progn
(set-slot 'chord-function 'chord-fun1 'piano
+slippery-chicken-standard-instrument-palette+)
(let ((slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((pn (piano :midi-channel 1))))
:set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((1 (2) 3 4 (5) (6) (7)
8)))))
:rthm-seq-map '((1 ((pn (1))))))))
#+cmn (probe-delete "/tmp/slippery-chicken-piece.eps")
(sc-test-check
#+cmn (cmn-display slippery-chicken-piece)
#+cmn (file-write-ok "/tmp/slippery-chicken-piece.eps" 8500)
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T T T NIL))
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (get-pitch-symbol ne))
'(C4 (C4 E4 G4) E4 F4 (C4 E4 G4) (D4 F4 A4) (E4 G4 B4) C5))
(set-slot 'chord-function 'piano-chord-fun 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN)))))
;;; SAR Fri Jul 6 12:54:33 BST 2012
(sc-deftest test-webpage-chords-chrd-fun-2-examp ()
(progn
(set-slot 'chord-function 'chord-fun2 'piano
+slippery-chicken-standard-instrument-palette+)
(let ((slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((pn (piano :midi-channel 1))))
:set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6 d6
e6))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((1 (3) 5 7 (11) (13)
(15) 17)))))
:rthm-seq-map '((1 ((pn (1))))))))
#+cmn (probe-delete "/tmp/slippery-chicken-piece.eps")
(sc-test-check
#+cmn (cmn-display slippery-chicken-piece)
#+cmn (file-write-ok "/tmp/slippery-chicken-piece.eps" 8500)
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T T T NIL))
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (get-pitch-symbol ne))
'(C4 (C4 F4 B4 E5) G4 B4 (D4 G4 C5 F5) (F4 B4 E5 A5)
(A4 D5 G5 C6) E6))
(set-slot 'chord-function 'piano-chord-fun 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN)))))
;;; SAR Fri Jul 6 13:06:53 BST 2012
(sc-deftest test-webpage-chords-chord-fun-aux-examp ()
(progn
(defun new-chord-function (curve-num index pitch-list pitch-seq
instrument set)
(chord-fun-aux curve-num index pitch-list pitch-seq instrument set 4 3
14))
(set-slot 'chord-function 'new-chord-function 'piano
+slippery-chicken-standard-instrument-palette+)
(let ((slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((pn (piano :midi-channel 1))))
:set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4
c5 d5 e5 f5 g5 a5 b5))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((1 (14) (13) (12) 11
10 9 8)))))
:rthm-seq-map '((1 ((pn (1))))))))
#+cmn (probe-delete "/tmp/slippery-chicken-piece.eps")
(sc-test-check
#+cmn (cmn-display slippery-chicken-piece)
#+cmn (file-write-ok "/tmp/slippery-chicken-piece.eps" 7500)
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T T T NIL NIL NIL NIL))
(not (next-event slippery-chicken-piece 'pn nil 1))
(equalp
(loop for ne = (next-event slippery-chicken-piece 'pn)
while ne
collect (get-pitch-symbol ne))
'(C4 (A4 E5 B5) (G4 D5 A5) (F4 C5 G5) F5 E5 D5 C5))
(set-slot 'chord-function 'piano-chord-fun 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN)))))
;;; MDE Sat Mar 19 09:56:05 2016 -- taking this out of the tests below and
;;; defining only once
(defun piano-subset-fun (curve-num index pitch-list pitch-seq instrument set)
(declare (ignore curve-num index pitch-list pitch-seq instrument))
(let* ((ss (when (subsets set) (get-data 'piano-chord (subsets set) nil))))
(when ss
(make-chord (data ss)))))
;;; SAR Fri Jul 6 13:25:21 BST 2012
(sc-deftest test-webpage-chords-ss-chords-piece-1 ()
(set-slot 'chord-function 'piano-subset-fun 'piano
+slippery-chicken-standard-instrument-palette+)
(let* ((ss-chords-piece-1
(make-slippery-chicken
'+ss-chords-piece-1+
:title "ss chords piece 1"
:instrument-palette +slippery-chicken-standard-instrument-palette+
:ensemble '(((pno (piano :midi-channel 1))))
:tempo-map '((1 (q 60)))
:set-palette '((1 ((f3 g3 a3 bf3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5
g5)
:subsets ((piano-chord (c4 e4 g4))))))
:set-map '((1 (1 1 1 1 1 1)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((8 (7) 8 7 (8) 7 8
7)))))
:rthm-seq-map '((1 ((pno (1 1 1 1 1 1))))))))
(loop for f in '("_ss-chords-piece-1-score.ly" "ss-chords-piece-1-def.ly"
"ss-chords-piece-1-pno-part.ly"
"ss-chords-piece-1-pno.ly")
do (probe-delete (concatenate 'string "/tmp/" f)))
(sc-test-check
(write-lp-data-for-all ss-chords-piece-1 :base-path "/tmp/")
(notany #'not
(loop for f in '("_ss-chords-piece-1-score.ly"
"ss-chords-piece-1-def.ly"
"ss-chords-piece-1-pno-part.ly"
"ss-chords-piece-1-pno.ly")
for s in '(180 680 190 570)
do (file-write-ok (concatenate 'string "/tmp/" f) s)))
(not (next-event ss-chords-piece-1 'pno nil 1))
(equalp
(loop for ne = (next-event ss-chords-piece-1 'pno)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T NIL NIL NIL NIL T NIL NIL T NIL NIL NIL NIL T NIL NIL
T NIL NIL NIL NIL T NIL NIL T NIL NIL NIL NIL T NIL NIL T NIL NIL NIL
NIL T NIL NIL T NIL NIL NIL))
(not (next-event ss-chords-piece-1 'pno nil 1))
(equalp
(loop for ne = (next-event ss-chords-piece-1 'pno)
while ne
collect (get-pitch-symbol ne))
'(G5 (C4 E4 G4) G5 F5 (C4 E4 G4) F5 G5 F5 G5 (C4 E4 G4) G5 F5 (C4 E4 G4)
F5 G5 F5 G5 (C4 E4 G4) G5 F5 (C4 E4 G4) F5 G5 F5 G5 (C4 E4 G4) G5 F5
(C4 E4 G4) F5 G5 F5 G5 (C4 E4 G4) G5 F5 (C4 E4 G4) F5 G5 F5 G5
(C4 E4 G4) G5 F5 (C4 E4 G4) F5 G5 F5))
(set-slot 'chord-function 'piano-chord-fun 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN))))
(defun piano-chord-master (curve-num index pitch-list pitch-seq instrument
set)
(let* ((xss (piano-subset-fun curve-num index pitch-list pitch-seq
instrument set)))
(if xss xss
(chord-fun2 curve-num index pitch-list pitch-seq instrument set))))
;;; SAR Fri Jul 6 13:48:16 BST 2012
(sc-deftest test-webpage-chords-ss-chords-piece-2 ()
(set-slot 'chord-function 'piano-chord-master 'piano
+slippery-chicken-standard-instrument-palette+)
(let* ((ss-chords-piece-2
(make-slippery-chicken
'+ss-chords-piece-2+
:title "ss chords piece 2"
:instrument-palette +slippery-chicken-standard-instrument-palette+
:ensemble '(((pno (piano :midi-channel 1))))
:tempo-map '((1 (q 60)))
:set-palette '((1 ((f3 g3 a3 bf3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5
g5)
:subsets ((piano-chord (c4 e4 g4)))))
(2 ((fs3 gs3 as3 b3 cs4 ds4 e4 fs4 gs4 as4 b4 cs5
ds5 e5 fs5 gs5))))
:set-map '((1 (1 2 1 2 1 2)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((8 (7) 8 7 (8) 7 8
7)))))
:rthm-seq-map '((1 ((pno (1 1 1 1 1 1))))))))
(loop for f in '("_ss-chords-piece-2-score.ly"
"ss-chords-piece-2-def.ly"
"ss-chords-piece-2-pno-part.ly"
"ss-chords-piece-2-pno.ly")
do (probe-delete (concatenate 'string "/tmp/" f)))
(sc-test-check
(write-lp-data-for-all ss-chords-piece-2 :base-path "/tmp/")
(notany #'not
(loop for f in '("_ss-chords-piece-2-score.ly"
"ss-chords-piece-2-def.ly"
"ss-chords-piece-2-pno-part.ly"
"ss-chords-piece-2-pno.ly")
for s in '(180 680 190 640)
do (file-write-ok (concatenate 'string "/tmp/" f) s)))
(not (next-event ss-chords-piece-2 'pno nil 1))
(equalp
(loop for ne = (next-event ss-chords-piece-2 'pno)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T NIL NIL NIL NIL T NIL NIL T NIL NIL NIL NIL T NIL
NIL T NIL NIL NIL NIL T NIL NIL T NIL NIL NIL NIL T NIL NIL T NIL
NIL NIL NIL T NIL NIL T NIL NIL NIL))
(not (next-event ss-chords-piece-2 'pno nil 1))
(equalp
(loop for ne = (next-event ss-chords-piece-2 'pno)
while ne
collect (get-pitch-symbol ne))
'(G5 (C4 E4 G4) G5 F5 (C4 E4 G4) F5 G5 F5 GS5 (DS4 GS4 CS5 FS5) GS5
FS5 (E4 AS4 DS5 GS5) FS5 GS5 FS5 G5 (C4 E4 G4) G5 F5 (C4 E4 G4) F5
G5 F5 GS5 (DS4 GS4 CS5 FS5) GS5 FS5 (E4 AS4 DS5 GS5) FS5 GS5 FS5 G5
(C4 E4 G4) G5 F5 (C4 E4 G4) F5 G5 F5 GS5 (DS4 GS4 CS5 FS5) GS5 FS5
(E4 AS4 DS5 GS5) FS5 GS5 FS5))
(set-slot 'chord-function 'piano-chord-fun 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN))))
;;; SAR Fri Jul 6 14:08:03 BST 2012
(sc-deftest test-webpage-chords-subset-piece-3 ()
(progn
(defun piano-ss-fun2 (curve-num index pitch-list pitch-seq instrument set)
(declare (ignore curve-num index pitch-list pitch-seq instrument))
(make-chord (data (get-next (get-data-data 'piano-chords
(subsets set))))))
(defun piano-mc-2 (curve-num index pitch-list pitch-seq instrument set)
(let* ((ss (when (subsets set)
(get-data 'piano-chords (subsets set) nil)))
(sss (when ss (data ss))))
(if (is-ral sss)
(piano-ss-fun2 curve-num index pitch-list pitch-seq instrument set)
(piano-chord-fun curve-num index pitch-list pitch-seq instrument
set))))
(set-slot 'chord-function 'piano-mc-2 'piano
+slippery-chicken-standard-instrument-palette+)
(let* ((ly-files '("_subset-piece-3-score.ly" "subset-piece-3-def.ly"
"subset-piece-3-pno-part.ly" "subset-piece-3-pno.ly"))
(subset-piece-3
(make-slippery-chicken
'+subset-piece-3+
:title "subset piece 3"
:instrument-palette +slippery-chicken-standard-instrument-palette+
:ensemble '(((pno (piano :midi-channel 1))))
:tempo-map '((1 (q 60)))
:set-palette '((1 ((f3 g3 a3 bf3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5
g5)
:subsets ((piano-chords ((pno1 (c4 e4 g4))
(pno2 (d4 f4 a4))
(pno3 (e4 g4 b4)))))))
(2 ((fs3 gs3 as3 b3 cs4 ds4 e4 fs4 gs4 as4 b4
cs5))))
:set-map '((1 (1 2 1 2 1 2)))
:rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
:pitch-seq-palette ((8 (7) 8 7 (8) 7 8
7)))))
:rthm-seq-map '((1 ((pno (1 1 1 1 1 1))))))))
(loop for f in ly-files
do (probe-delete (concatenate 'string "/tmp/" f)))
(sc-test-check
(write-lp-data-for-all subset-piece-3 :base-path "/tmp/")
(notany #'not
(loop for f in ly-files
for s in '(170 670 190 610)
collect
(file-write-ok (concatenate 'string "/tmp/" f) s)))
(not (next-event subset-piece-3 'pno nil 1))
(equalp
(loop for ne = (next-event subset-piece-3 'pno)
while ne
collect (chord-p (pitch-or-chord ne)))
'(NIL T NIL NIL T NIL NIL NIL NIL T NIL NIL T NIL NIL NIL NIL T NIL
NIL T NIL NIL NIL NIL T NIL NIL T NIL NIL NIL NIL T NIL NIL T NIL
NIL NIL NIL T NIL NIL T NIL NIL NIL))
(not (next-event subset-piece-3 'pno nil 1))
(equalp
(loop for ne = (next-event subset-piece-3 'pno)
while ne
collect (get-pitch-symbol ne))
'(G5 (C4 E4 G4) G5 F5 (D4 F4 A4) F5 G5 F5 CS5 (FS4 GS4 AS4 B4) CS5 B4
(GS4 AS4 B4 CS5) B4 CS5 B4 G5 (E4 G4 B4) G5 F5 (C4 E4 G4) F5 G5 F5
CS5 (FS4 GS4 AS4 B4) CS5 B4 (GS4 AS4 B4 CS5) B4 CS5 B4 G5 (D4 F4 A4)
G5 F5 (E4 G4 B4) F5 G5 F5 CS5 (FS4 GS4 AS4 B4) CS5 B4
(GS4 AS4 B4 CS5) B4 CS5 B4))
(set-slot 'chord-function 'piano-chord-fun 'piano
+slippery-chicken-standard-instrument-palette+)
(equalp
(chord-function
(get-data 'piano +slippery-chicken-standard-instrument-palette+))
'PIANO-CHORD-FUN)))))
;;; MDE Tue Mar 20 16:01:47 2012
(sc-deftest test-chord-funs ()
(let* ((pl (init-pitch-list '(c4 d4 fs4 b4 ds5 e5 f5)))
(pl2 (init-pitch-list '(c4 d4 fs4 b4 ds5 e5 f5 g5 b5 cs6)))
(dcf1 (default-chord-function nil 2 pl nil nil nil))
;; illegal index should result in nil but no error/warning
(dcf2 (default-chord-function nil 8 pl nil nil nil))
(dcf3 (default-chord-function nil 0 pl nil nil nil))
(cf1a (chord-fun1 nil 0 pl nil nil nil))
(cf1b (chord-fun1 nil 6 pl nil nil nil))
(cf2a (chord-fun2 nil 6 pl2 nil nil nil)))
;;(print cf2a)
(sc-test-check
(equalp 'd4 (data (get-pitch dcf1 1)))
(equalp 'fs4 (data (get-pitch dcf1 2)))
(equalp 'd4 (data (get-pitch dcf3 2)))
(equalp 'c4 (data (get-pitch dcf3 1)))
(equalp dcf2 nil)
(= 2 (sclist-length cf1a)) ; can't get 3 as > octave!
(= 3 (sclist-length cf1b))
(= 4 (sclist-length cf2a)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ensemble.html
;;; SAR Fri Jul 6 15:38:27 BST 2012
(sc-deftest test-webpage-ensemble-one-plr-one-inst ()
(let ((o-files '("slippery-chicken-piece.mid"
#+cmn "slippery-chicken-piece.eps"
"slippery-chicken-piece-fl.ly"
"slippery-chicken-piece-fl-part.ly"
"slippery-chicken-piece-def.ly"
"_slippery-chicken-piece-score.ly"))
(o-files-sizes '(70 #+cmn 7000 150 200 660 190))
(slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((fl (flute :midi-channel 1))))
:set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((2 4) q e (s) s))
:pitch-seq-palette ((1 2 3)))))
:rthm-seq-map '((1 ((fl (1)))))))
plr)
(probe-delete-multi "/tmp/" o-files)
(sc-test-check
(equalp
(loop for p in (get-keys (ensemble slippery-chicken-piece) nil)
do
(setf plr (get-data p (ensemble slippery-chicken-piece)))
collect
(list p (id (data plr)) (doubles plr) (midi-channel plr)
(microtones-midi-channel plr))
when
(and (stringp (id (data plr)))
(search "doublings" (id (data plr))))
collect
(get-keys (data (get-data p (ensemble slippery-chicken-piece)))
nil))
;; player ins doubles midi-chan microtones-chan
;; MDE Thu Sep 20 09:58:48 2018 -- mmc will be 1 now, not default of -1
'((FL FLUTE NIL 1 1))) ; '((FL FLUTE NIL 1 -1)))
(midi-play slippery-chicken-piece)
#+cmn (cmn-display slippery-chicken-piece)
(write-lp-data-for-all slippery-chicken-piece)
(file-write-ok-multi "/tmp/" o-files o-files-sizes))))
;;; SAR Fri Jul 6 16:53:16 BST 2012
(sc-deftest test-webpage-ensemble-doublings ()
(let ((o-files '("slippery-chicken-piece.mid"
#+cmn "slippery-chicken-piece.eps"
"slippery-chicken-piece-fl.ly"
"slippery-chicken-piece-fl-part.ly"
"slippery-chicken-piece-def.ly"
"slippery-chicken-piece-cl.ly"
"slippery-chicken-piece-cl-part.ly"
"_slippery-chicken-piece-score.ly"))
(o-files-sizes '(110 #+cmn 11000 150 200 900 150 200 190))
(slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((fl (flute :midi-channel 1))
(cl ((b-flat-clarinet bass-clarinet)
:midi-channel 2))))
:instrument-change-map '((1 ((fl ((1 flute)))
(cl ((1 b-flat-clarinet))))))
:set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((2 4) q e (s) s))
:pitch-seq-palette ((1 2 3)))))
:rthm-seq-map '((1 ((fl (1))
(cl (1)))))))
plr)
(probe-delete-multi "/tmp/" o-files)
(sc-test-check
(equalp
(print (loop for p in (get-keys (ensemble slippery-chicken-piece) nil)
do
(setf plr (get-data p (ensemble slippery-chicken-piece)))
collect
(list p (id (data plr)) (doubles plr) (midi-channel plr)
(microtones-midi-channel plr))
when
(and (stringp (id (data plr)))
(search "doublings" (id (data plr))))
collect
(get-keys (data (get-data p (ensemble slippery-chicken-piece)))
nil)))
;; MDE Thu Sep 20 10:00:46 2018 -- microtones channel now same as given
;; channel
'((FL FLUTE NIL 1 1) (CL "CL-doublings" T 2 2)
(B-FLAT-CLARINET BASS-CLARINET)))
(midi-play slippery-chicken-piece)
#+cmn (cmn-display slippery-chicken-piece)
(write-lp-data-for-all slippery-chicken-piece)
(file-write-ok-multi "/tmp/" o-files o-files-sizes))))
;;; Fri Jul 6 18:58:04 BST 2012
(sc-deftest test-webpage-ensemble-ensemble-block ()
(let* ((o-files '("slippery-chicken-piece.mid"
#+cmn "slippery-chicken-piece.eps"
"_slippery-chicken-piece-score.ly"
"slippery-chicken-piece-cl-part.ly"
"slippery-chicken-piece-cl.ly"
"slippery-chicken-piece-def.ly"
"slippery-chicken-piece-fl-part.ly"
"slippery-chicken-piece-fl.ly"
"slippery-chicken-piece-hn-part.ly"
"slippery-chicken-piece-hn.ly"
"slippery-chicken-piece-perc-part.ly"
"slippery-chicken-piece-perc.ly"
"slippery-chicken-piece-solo-part.ly"
"slippery-chicken-piece-solo.ly"
"slippery-chicken-piece-vc-part.ly"
"slippery-chicken-piece-vc.ly"
"slippery-chicken-piece-vla-part.ly"
"slippery-chicken-piece-vla.ly"
"slippery-chicken-piece-vln-part.ly"
"slippery-chicken-piece-vln.ly"))
(o-files-sizes '(390 #+cmn 32000 190 200 150 2900 200 150 200 150
200 150 200 150 200 170 200 170 200 150))
(slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((fl ((alto-flute piccolo) :midi-channel 1
:microtones-midi-channel 2))
(cl ((b-flat-clarinet bass-clarinet)
:midi-channel 3
:microtones-midi-channel 4))
(hn (french-horn :midi-channel 5
:microtones-midi-channel 6))
(perc (marimba :midi-channel 7))
(solo (violin :midi-channel 8
:microtones-midi-channel 9))
(vln (violin :midi-channel 11
:microtones-midi-channel 12))
(vla (viola :midi-channel 13
:microtones-midi-channel 14))
(vc (cello :midi-channel 15
:microtones-midi-channel 16))))
:instrument-change-map '((1 ((fl ((1 piccolo)))
(cl ((1 b-flat-clarinet))))))
:set-palette '((1 ((c3 d3 e3 f3 g3 a3 b3
c4 d4 e4 f4 g4 a4 b4
c5 d5 e5 f5 g5 a5 b5 c6))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((2 4) q e (s) s))
:pitch-seq-palette ((1 2 3)))))
:rthm-seq-map '((1 ((fl (1))
(cl (1))
(hn (1))
(perc (1))
(solo (1))
(vln (1))
(vla (1))
(vc (1)))))))
plr)
(probe-delete-multi "/tmp/" o-files)
(sc-test-check
(equalp
(loop for p in (get-keys (ensemble slippery-chicken-piece) nil)
do
(setf plr (get-data p (ensemble slippery-chicken-piece)))
collect
(list p (id (data plr)) (doubles plr) (midi-channel plr)
(microtones-midi-channel plr))
when
(and (stringp (id (data plr)))
(search "doublings" (id (data plr))))
collect
(get-keys (data (get-data p (ensemble slippery-chicken-piece)))
nil))
'((FL "FL-doublings" T 1 2) (ALTO-FLUTE PICCOLO)
(CL "CL-doublings" T 3 4)
(B-FLAT-CLARINET BASS-CLARINET) (HN FRENCH-HORN NIL 5 6)
(PERC MARIMBA NIL 7 7) (SOLO VIOLIN NIL 8 9) (VLN VIOLIN NIL 11 12)
(VLA VIOLA NIL 13 14) (VC CELLO NIL 15 16)))
(midi-play slippery-chicken-piece)
#+cmn (cmn-display slippery-chicken-piece)
(write-lp-data-for-all slippery-chicken-piece)
(file-write-ok-multi "/tmp/" o-files o-files-sizes))))
;;; SAR Sat Jul 7 13:21:19 BST 2012
(sc-deftest test-webpage-ensemble-inst-change-map ()
(let* ((o-files '("slippery-chicken-piece.mid"
#+cmn "slippery-chicken-piece.eps"
"_slippery-chicken-piece-score.ly"
"slippery-chicken-piece-cl-part.ly"
"slippery-chicken-piece-cl.ly"
"slippery-chicken-piece-def.ly"
"slippery-chicken-piece-fl-part.ly"
"slippery-chicken-piece-fl.ly"))
(o-files-sizes '(820 #+cmn 51000 190 200 900 900 200 900))
(slippery-chicken-piece
(make-slippery-chicken
'+slippery-chicken-piece+
:title "slippery-chicken-piece"
:ensemble '(((fl ((flute piccolo)
:midi-channel 1 :microtones-midi-channel 2))
(cl ((b-flat-clarinet bass-clarinet)
:midi-channel 3 :microtones-midi-channel 4))))
:instrument-change-map '((1 ((fl ((1 flute) (3 piccolo)
(5 flute)))
(cl ((1 b-flat-clarinet)
(2 bass-clarinet)
(6 b-flat-clarinet)))))
(2 ((fl ((2 piccolo) (4 flute)))
(cl ((2 bass-clarinet)
(3 b-flat-clarinet))))))
:set-palette '((1 ((d3 e3 f3 g3 a3 b3
c4 d4 e4 f4 g4 a4 b4
c5 d5 e5 f5 g5 a5 b5 c6))))
:set-map '((1 (1 1 1 1 1 1 1))
(2 (1 1 1 1 1 1 1)))
:rthm-seq-palette '((1 ((((2 4) q e (s) s))
:pitch-seq-palette ((1 2 3)))))
:rthm-seq-map '((1 ((fl (1 1 1 1 1 1 1))
(cl (1 1 1 1 1 1 1))))
(2 ((fl (1 1 1 1 1 1 1))
(cl (1 1 1 1 1 1 1))))))))
(probe-delete-multi "/tmp/" o-files)
(sc-test-check
(equalp
(loop for s from 1 to 2
collect
(loop for p in '(fl cl)
collect
(loop for b from 1 to 7
collect
(cm-get-data (instrument-change-map slippery-chicken-piece)
(list s p) b))))
'(((FLUTE FLUTE PICCOLO PICCOLO FLUTE FLUTE FLUTE)
(B-FLAT-CLARINET BASS-CLARINET BASS-CLARINET BASS-CLARINET
BASS-CLARINET
B-FLAT-CLARINET B-FLAT-CLARINET))
((FLUTE PICCOLO PICCOLO FLUTE FLUTE FLUTE FLUTE)
(B-FLAT-CLARINET BASS-CLARINET B-FLAT-CLARINET B-FLAT-CLARINET
B-FLAT-CLARINET B-FLAT-CLARINET B-FLAT-CLARINET))))
(midi-play slippery-chicken-piece)
#+cmn (cmn-display slippery-chicken-piece)
(write-lp-data-for-all slippery-chicken-piece)
(file-write-ok-multi "/tmp/" o-files o-files-sizes))))
;;; SAR Sat Jul 7 13:57:38 BST 2012
(sc-deftest test-webpage-ensemble-instrument-hierarchy ()
(let* ((o-files '("slippery-chicken-piece.mid"
#+cmn "slippery-chicken-piece.eps"
"_slippery-chicken-piece-score.ly"
"slippery-chicken-piece-cl-part.ly"
"slippery-chicken-piece-cl.ly"
"slippery-chicken-piece-def.ly"
"slippery-chicken-piece-fl-part.ly"
"slippery-chicken-piece-fl.ly"
"slippery-chicken-piece-hn-part.ly"
"slippery-chicken-piece-hn.ly"
"slippery-chicken-piece-perc-part.ly"
"slippery-chicken-piece-perc.ly"
"slippery-chicken-piece-solo-part.ly"
"slippery-chicken-piece-solo.ly"
"slippery-chicken-piece-vc-part.ly"
"slippery-chicken-piece-vc.ly"
"slippery-chicken-piece-vla-part.ly"
"slippery-chicken-piece-vla.ly"
"slippery-chicken-piece-vln-part.ly"
"slippery-chicken-piece-vln.ly"))
(o-files-sizes-1 '(370 #+cmn 32000 150 160 150 2900 160 150 160 150
160 150 160 150 160 150 160 170 160 150))
(o-files-sizes-2 '(360 #+cmn 33000 150 160 150 2900 160 150 160 150
160 150 160 150 160 140 160 150 160 150))
(slippery-chicken-piece-1
(make-slippery-chicken
'+slippery-chicken-piece-1+
:title "slippery-chicken-piece"
:ensemble '(((fl (flute :midi-channel 1))
(cl (b-flat-clarinet :midi-channel 3))
(hn (french-horn :midi-channel 5))
(perc (marimba :midi-channel 7))
(solo (violin :midi-channel 8))
(vln (violin :midi-channel 11))
(vla (viola :midi-channel 13))
(vc (cello :midi-channel 15))))
:set-palette '((1 ((c3 d3 e3 f3 g3 a3 b3
c4 d4 e4 f4 g4 a4 b4
c5 d5 e5 f5 g5 a5 b5 c6))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((2 4) q e (s) s))
:pitch-seq-palette ((1 2 3)))))
:rthm-seq-map '((1 ((fl (1))
(cl (1))
(hn (1))
(perc (1))
(solo (1))
(vln (1))
(vla (1))
(vc (1)))))))
(slippery-chicken-piece-2
(make-slippery-chicken
'+slippery-chicken-piece-2+
:title "slippery-chicken-piece"
:ensemble '(((fl (flute :midi-channel 1 ))
(cl (b-flat-clarinet :midi-channel 3))
(hn (french-horn :midi-channel 5))
(perc (marimba :midi-channel 7))
(solo (violin :midi-channel 8))
(vln (violin :midi-channel 11))
(vla (viola :midi-channel 13))
(vc (cello :midi-channel 15))))
:instruments-hierarchy '(solo vln fl cl vla hn perc vc)
:set-palette '((1 ((c3 d3 e3 f3 g3 a3 b3
c4 d4 e4 f4 g4 a4 b4
c5 d5 e5 f5 g5 a5 b5 c6))))
:set-map '((1 (1)))
:rthm-seq-palette '((1 ((((2 4) q e (s) s))
:pitch-seq-palette ((1 2 3)))))
:rthm-seq-map '((1 ((fl (1))
(cl (1))
(hn (1))
(perc (1))
(solo (1))
(vln (1))
(vla (1))
(vc (1))))))))
(probe-delete-multi "/tmp/" o-files)
(sc-test-check
(not
(equalp
(loop for p in (get-keys (ensemble slippery-chicken-piece-1))
do
(next-event slippery-chicken-piece-1 p nil 1)
collect
(loop for ne = (next-event slippery-chicken-piece-1 p)
while ne
collect (get-pitch-symbol ne)))
(loop for p in (get-keys (ensemble slippery-chicken-piece-2))
do
(next-event slippery-chicken-piece-2 p nil 1)
collect
(loop for ne = (next-event slippery-chicken-piece-2 p)
while ne
collect (get-pitch-symbol ne)))))
(midi-play slippery-chicken-piece-1)
#+cmn (cmn-display slippery-chicken-piece-1)
(write-lp-data-for-all slippery-chicken-piece-1)
(file-write-ok-multi "/tmp/" o-files o-files-sizes-1)
(probe-delete-multi "/tmp/" o-files)
(midi-play slippery-chicken-piece-2)
#+cmn (cmn-display slippery-chicken-piece-2)
(write-lp-data-for-all slippery-chicken-piece-2)
(file-write-ok-multi "/tmp/" o-files o-files-sizes-2))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; fibonacci.html
;;; SAR Sat Jul 7 15:03:20 BST 2012
(sc-deftest test-webpage-fibonacci-fib-transition-1 ()
(sc-test-check
(equalp (fibonacci-transition 50)
'(0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0
1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1))))
;;; SAR Thu Mar 15 11:43:02 GMT 2012
(sc-deftest test-webpage-fibonacci-fib-transition-2 ()
(sc-test-check
(equalp (fibonacci-transition 50 's 'e)
'(S S S S S S S S S S S S E S S S S S S S E S S S S E S S E S E S E
S E E S E E E E S E E E E E E E E))))
;;; SAR Sat Jul 7 15:06:07 BST 2012
(sc-deftest test-webpage-fibonacci-fib-transitions-1 ()
(sc-test-check
(equalp (fibonacci-transitions 76 4)
'(0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 2 1 1
2 1 2 1 2 2 1 2 1 2 2 2 2 2 2 2 3 2 2 3 2 3 2 3 3 2 3 2 3 3 3 2 3 3
3 3 3 3 3 3 3 3))))
;;; SAR Thu Mar 15 11:44:09 GMT 2012
(sc-deftest test-webpage-fibonacci-fib-transitions-2 ()
(sc-test-check
(equalp
(fibonacci-transitions 304 '(s e q h))
'(S S S S S S S S S S S S S S S S S S S S S S S S S S S S S E S S S S S S
S S S S S S E S S S S S S S E S S S S E S S S S E S S E S S E S S E S E
S E S E E S E S E S E E S E E S E E E E S E E E E S E E E E E E E E E E
E E E E E E E E E E Q E E E E E E E Q E E E E Q E E E E Q E E Q E E Q E
E Q E Q E Q E Q Q E Q E Q E Q Q E Q Q E Q Q Q Q E Q Q Q Q E Q Q Q Q Q Q
Q Q Q Q Q Q Q Q Q Q Q Q Q Q H Q Q Q Q Q Q Q H Q Q Q Q H Q Q Q Q H Q Q H
Q Q H Q Q H Q H Q H Q H H Q H Q H Q H H Q H H Q H H H H Q H H H H Q H H
H H H H H H Q H H H H H H H H H H H H H H H H H H H H H H H H H H H H H
H H H H H H H H H H H H H H H H))))
;;; SAR Sat Jul 7 15:11:51 BST 2012
(sc-deftest test-webpage-fibonacci-remix-in-1 ()
(sc-test-check
(equalp (remix-in '(1 2 3 4 5 6 7 8 9 10 11))
'(1 2 3 4 5 1 6 7 2 8 9 3 10 4 11 5))))