File: typechecks2.sal

package info (click to toggle)
nyquist 3.20%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 58,008 kB
  • sloc: ansic: 74,743; lisp: 17,929; java: 10,723; cpp: 6,690; sh: 171; xml: 58; makefile: 40; python: 15
file content (744 lines) | stat: -rw-r--r-- 32,528 bytes parent folder | download | duplicates (3)
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
; typechecks2.sal -- unit tests for typechecks
; 
; This code was generated from typechecks.txt by
; typecheck-gen.lsp

exec ny:expect("plot lfo(6, 2) ",
               :plot, T)
exec #print("plot lfo(6, 2) ")
exec catch(quote(simulated-error), 
           sal-compile("plot lfo(6, 2) ", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot lfo(6, const(2)) ; error",
               :nyerror, {"LFO" 2 {{NUMBER} "duration"}})
exec #print("plot lfo(6, const(2)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot lfo(6, const(2)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In LFO, 2nd argument (duration) must be a number, got a SOUND

exec ny:expect("plot lfo(6, 2, *sine-table*) ",
               :plot, T)
exec #print("plot lfo(6, 2, *sine-table*) ")
exec catch(quote(simulated-error), 
           sal-compile("plot lfo(6, 2, *sine-table*) ", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot lfo(6, 2, osc(c4)) ; error",
               :error, "In LFO, 3rd argument (table) should be a list of 3 elements, got #<>")
exec #print("plot lfo(6, 2, osc(c4)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot lfo(6, 2, osc(c4)) ; error", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot lfo(6, 2, *sine-table*, 1.0)",
               :plot, T)
exec #print("plot lfo(6, 2, *sine-table*, 1.0)")
exec catch(quote(simulated-error), 
           sal-compile("plot lfo(6, 2, *sine-table*, 1.0)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot lfo(6, 2, *sine-table*, lfo(1.0)) ; error",
               :nyerror, {"LFO" 4 {{NUMBER} "phase"}})
exec #print("plot lfo(6, 2, *sine-table*, lfo(1.0)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot lfo(6, 2, *sine-table*, lfo(1.0)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In LFO, 4th argument (phase) must be a number, got a SOUND

exec ny:expect("plot fmlfo(6) ; error",
               :nyerror, {"FMLFO" 1 {{SOUND} "freq"}})
exec #print("plot fmlfo(6) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot fmlfo(6) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In FMLFO, 1st argument (freq) must be a sound, got 6, a FIXNUM

exec ny:expect("plot fmlfo(const(6)) ",
               :plot, T)
exec #print("plot fmlfo(const(6)) ")
exec catch(quote(simulated-error), 
           sal-compile("plot fmlfo(const(6)) ", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot fmlfo(const(6), *sine-table*)",
               :plot, T)
exec #print("plot fmlfo(const(6), *sine-table*)")
exec catch(quote(simulated-error), 
           sal-compile("plot fmlfo(const(6), *sine-table*)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot fmlfo(const(6), lfo(1)) ; error",
               :error, "In FMLFO, 2nd argument (table) should be a list of 3 elements, got #<>")
exec #print("plot fmlfo(const(6), lfo(1)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot fmlfo(const(6), lfo(1)) ; error", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot fmlfo(const(6), *sine-table*, 1.0)",
               :plot, T)
exec #print("plot fmlfo(const(6), *sine-table*, 1.0)")
exec catch(quote(simulated-error), 
           sal-compile("plot fmlfo(const(6), *sine-table*, 1.0)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot fmlfo(const(6), *sine-table*, const(1.0)) ; error",
               :nyerror, {"FMLFO" 3 {{NUMBER} "phase"}})
exec #print("plot fmlfo(const(6), *sine-table*, const(1.0)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot fmlfo(const(6), *sine-table*, const(1.0)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In FMLFO, 3rd argument (phase) must be a number, got a SOUND

exec ny:expect("plot osc(a4)",
               :plot, T)
exec #print("plot osc(a4)")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(a4)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(a4, 2.0)",
               :plot, T)
exec #print("plot osc(a4, 2.0)")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(a4, 2.0)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(a4, 2.0, *sine-table*)",
               :plot, T)
exec #print("plot osc(a4, 2.0, *sine-table*)")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(a4, 2.0, *sine-table*)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(a4, 2.0, *sine-table*, 1.0)",
               :plot, T)
exec #print("plot osc(a4, 2.0, *sine-table*, 1.0)")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(a4, 2.0, *sine-table*, 1.0)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(const(a4)) ; error",
               :nyerror, {"OSC" 1 {{STEP} "pitch"}})
exec #print("plot osc(const(a4)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(const(a4)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In OSC, 1st argument (pitch) must be a step number, got a SOUND

exec ny:expect("plot osc(a4, const(2.0)) ; error",
               :nyerror, {"OSC" 2 {{NUMBER} "duration"}})
exec #print("plot osc(a4, const(2.0)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(a4, const(2.0)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In OSC, 2nd argument (duration) must be a number, got a SOUND

exec ny:expect("plot osc(a4, 2.0, osc(c4)) ; error",
               :error, "In OSC, 3rd argument (table) should be a list of 3 elements, got #<>")
exec #print("plot osc(a4, 2.0, osc(c4)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(a4, 2.0, osc(c4)) ; error", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(a4, 2.0, *sine-table*, const(1.0)) ; error",
               :nyerror, {"OSC" 4 {{NUMBER} "phase"}})
exec #print("plot osc(a4, 2.0, *sine-table*, const(1.0)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(a4, 2.0, *sine-table*, const(1.0)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In OSC, 4th argument (phase) must be a number, got a SOUND

exec ny:expect("plot partial(a4, pwl(0.5, 1, 1))",
               :plot, T)
exec #print("plot partial(a4, pwl(0.5, 1, 1))")
exec catch(quote(simulated-error), 
           sal-compile("plot partial(a4, pwl(0.5, 1, 1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot partial(const(a4), pwl(0.5, 1, 1)) ; error",
               :nyerror, {"PARTIAL" 1 {{STEP} "steps"}})
exec #print("plot partial(const(a4), pwl(0.5, 1, 1)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot partial(const(a4), pwl(0.5, 1, 1)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In PARTIAL, 1st argument (steps) must be a step number, got a SOUND

exec ny:expect("plot partial(a4, 2) ; error",
               :nyerror, {"PARTIAL" 2 {{SOUND} "env"}})
exec #print("plot partial(a4, 2) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot partial(a4, 2) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In PARTIAL, 2nd argument (env) must be a sound, got 2, a FIXNUM

exec ny:expect("plot sampler(a4, pwl(0.5, 1, 1))",
               :plot, T)
exec #print("plot sampler(a4, pwl(0.5, 1, 1))")
exec catch(quote(simulated-error), 
           sal-compile("plot sampler(a4, pwl(0.5, 1, 1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot sampler(const(a4), pwl(0.5, 1, 1)) ; error",
               :nyerror, {"SAMPLER" 1 {{STEP} "pitch"}})
exec #print("plot sampler(const(a4), pwl(0.5, 1, 1)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot sampler(const(a4), pwl(0.5, 1, 1)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SAMPLER, 1st argument (pitch) must be a step number, got a SOUND

exec ny:expect("plot sampler(a4, 2) ; error",
               :nyerror, {"SAMPLER" 2 {{SOUND} "modulation"}})
exec #print("plot sampler(a4, 2) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot sampler(a4, 2) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SAMPLER, 2nd argument (modulation) must be a sound, got 2, a FIXNUM

exec ny:expect("plot sampler(a4, pwl(0.5, 1, 1), *sine-table*)",
               :error, "In SAMPLER, 3rd argument (table) should be a list whose 3rd element is the sample start time, got (#<> -36.3763 T)")
exec #print("plot sampler(a4, pwl(0.5, 1, 1), *sine-table*)")
exec catch(quote(simulated-error), 
           sal-compile("plot sampler(a4, pwl(0.5, 1, 1), *sine-table*)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot sampler(a4, pwl(0.5, 1, 1), hzosc(1.0)) ; error",
               :error, "In SAMPLER, 3rd argument (table) should be a list of 3 elements, got #<>")
exec #print("plot sampler(a4, pwl(0.5, 1, 1), hzosc(1.0)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot sampler(a4, pwl(0.5, 1, 1), hzosc(1.0)) ; error", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot sampler(a4, pwl(0.5, 1, 1), *sine-sample*, 2)",
               :plot, T)
exec #print("plot sampler(a4, pwl(0.5, 1, 1), *sine-sample*, 2)")
exec catch(quote(simulated-error), 
           sal-compile("plot sampler(a4, pwl(0.5, 1, 1), *sine-sample*, 2)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot sampler(a4, pwl(0.5, 1, 1), *sine-sample*, 2.1) ; error",
               :nyerror, {"BUZZ" 3 {{INTEGER} "npoints"}})
exec #print("plot sampler(a4, pwl(0.5, 1, 1), *sine-sample*, 2.1) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot sampler(a4, pwl(0.5, 1, 1), *sine-sample*, 2.1) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In BUZZ, 3rd argument (npoints) must be a integer, got 2.1, a FLONUM

exec ny:expect("plot sine(a4)",
               :plot, T)
exec #print("plot sine(a4)")
exec catch(quote(simulated-error), 
           sal-compile("plot sine(a4)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot sine(const(a4)) ; error",
               :nyerror, {"SINE" 1 {{STEP} "steps"}})
exec #print("plot sine(const(a4)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot sine(const(a4)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SINE, 1st argument (steps) must be a step number, got a SOUND

exec ny:expect("plot sine(a4, 1.0)",
               :plot, T)
exec #print("plot sine(a4, 1.0)")
exec catch(quote(simulated-error), 
           sal-compile("plot sine(a4, 1.0)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot sine(a4, const(1.0)) ; error",
               :nyerror, {"SINE" 2 {{NUMBER} "duration"}})
exec #print("plot sine(a4, const(1.0)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot sine(a4, const(1.0)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SINE, 2nd argument (duration) must be a number, got a SOUND

exec ny:expect("plot pluck(a4)",
               :plot, T)
exec #print("plot pluck(a4)")
exec catch(quote(simulated-error), 
           sal-compile("plot pluck(a4)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot pluck(const(a4)) ; error",
               :nyerror, {"PLUCK" 1 {{NUMBER} "steps"}})
exec #print("plot pluck(const(a4)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot pluck(const(a4)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In PLUCK, 1st argument (steps) must be a number, got a SOUND

exec ny:expect("plot pluck(a4, 2)",
               :plot, T)
exec #print("plot pluck(a4, 2)")
exec catch(quote(simulated-error), 
           sal-compile("plot pluck(a4, 2)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot pluck(a4, const(2)) ; error",
               :nyerror, {"PLUCK" 2 {{NUMBER} "duration"}})
exec #print("plot pluck(a4, const(2)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot pluck(a4, const(2)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In PLUCK, 2nd argument (duration) must be a number, got a SOUND

exec ny:expect("plot pluck(a4, 2, 0.01)",
               :plot, T)
exec #print("plot pluck(a4, 2, 0.01)")
exec catch(quote(simulated-error), 
           sal-compile("plot pluck(a4, 2, 0.01)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot pluck(a4, 2, const(0.01)) ; error",
               :nyerror, {"PLUCK" 3 {{NUMBER} "final-amp"}})
exec #print("plot pluck(a4, 2, const(0.01)) ; error")
exec catch(quote(simulated-error), 
           sal-compile("plot pluck(a4, 2, const(0.01)) ; error", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In PLUCK, 3rd argument (final-amp) must be a number, got a SOUND

exec ny:expect("plot osc(c4) @ 1",
               :plot, T)
exec #print("plot osc(c4) @ 1")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(c4) @ 1", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(c4) @ lfo(1)",
               :error, "1st argument of AT (or 2nd argument of SAL's @ operator) should be a time offset number")
exec #print("plot osc(c4) @ lfo(1)")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(c4) @ lfo(1)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(c4) @@ 1",
               :plot, T)
exec #print("plot osc(c4) @@ 1")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(c4) @@ 1", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot osc(c4) @@ lfo(1)",
               :error, "1st argument of AT-ABS (or 2nd argument of SAL's @@ operator) should be a number (start time)")
exec #print("plot osc(c4) @@ lfo(1)")
exec catch(quote(simulated-error), 
           sal-compile("plot osc(c4) @@ lfo(1)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot clip(osc(c4), 0.5)",
               :plot, T)
exec #print("plot clip(osc(c4), 0.5)")
exec catch(quote(simulated-error), 
           sal-compile("plot clip(osc(c4), 0.5)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print clip(0.6, 0.5)",
               :print, 0.5)
exec #print("print clip(0.6, 0.5)")
exec catch(quote(simulated-error), 
           sal-compile("print clip(0.6, 0.5)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot clip(vector(osc(c4), osc(c4)), 0.5)[0]",
               :plot, T)
exec #print("plot clip(vector(osc(c4), osc(c4)), 0.5)[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot clip(vector(osc(c4), osc(c4)), 0.5)[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot clip(\"bad\", 0.5)",
               :nyerror, {"CLIP" 1 {{NUMBER SOUND} {}}})
exec #print("plot clip(\"bad\", 0.5)")
exec catch(quote(simulated-error), 
           sal-compile("plot clip(\"bad\", 0.5)", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In CLIP, 1st argument must be a number, sound or array thereof, got "bad", a STRING

exec ny:expect("plot clip(osc(c4), \"bad\")",
               :nyerror, {"CLIP" 2 {{NUMBER} {}}})
exec #print("plot clip(osc(c4), \"bad\")")
exec catch(quote(simulated-error), 
           sal-compile("plot clip(osc(c4), \"bad\")", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In CLIP, 2nd argument must be a number, got "bad", a STRING

exec ny:expect("plot control-srate-abs(100, lfo(100))",
               :plot, T)
exec #print("plot control-srate-abs(100, lfo(100))")
exec catch(quote(simulated-error), 
           sal-compile("plot control-srate-abs(100, lfo(100))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot control-srate-abs(osc(c4), lfo(100))",
               :nyerror, {"CONTROL-SRATE-ABS" 1 {{NUMBER} "sample rate"}})
exec #print("plot control-srate-abs(osc(c4), lfo(100))")
exec catch(quote(simulated-error), 
           sal-compile("plot control-srate-abs(osc(c4), lfo(100))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In CONTROL-SRATE-ABS, 1st argument (sample rate) must be a number, got a SOUND

exec ny:expect("print db-to-linear(-6)",
               :print, 0.501187)
exec #print("print db-to-linear(-6)")
exec catch(quote(simulated-error), 
           sal-compile("print db-to-linear(-6)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot db-to-linear(lfo(1))",
               :plot, T)
exec #print("plot db-to-linear(lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot db-to-linear(lfo(1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot db-to-linear(vector(lfo(1), lfo(2)))[0]",
               :plot, T)
exec #print("plot db-to-linear(vector(lfo(1), lfo(2)))[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot db-to-linear(vector(lfo(1), lfo(2)))[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot db-to-linear(\"bad\")",
               :nyerror, {"DB-TO-LINEAR" 0 {{NUMBER SOUND} {}}})
exec #print("plot db-to-linear(\"bad\")")
exec catch(quote(simulated-error), 
           sal-compile("plot db-to-linear(\"bad\")", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In DB-TO-LINEAR, argument must be a number, sound or array thereof, got "bad", a STRING

exec ny:expect("print linear-to-db(2)",
               :print, 6.0206)
exec #print("print linear-to-db(2)")
exec catch(quote(simulated-error), 
           sal-compile("print linear-to-db(2)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot linear-to-db(1 + lfo(1))",
               :plot, T)
exec #print("plot linear-to-db(1 + lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot linear-to-db(1 + lfo(1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot linear-to-db(1 + vector(lfo(1), lfo(2)))[0]",
               :plot, T)
exec #print("plot linear-to-db(1 + vector(lfo(1), lfo(2)))[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot linear-to-db(1 + vector(lfo(1), lfo(2)))[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print linear-to-db(\"bad\")",
               :nyerror, {"LINEAR-TO-DB" 0 {{NUMBER SOUND} {}}})
exec #print("print linear-to-db(\"bad\")")
exec catch(quote(simulated-error), 
           sal-compile("print linear-to-db(\"bad\")", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In LINEAR-TO-DB, argument must be a number, sound or array thereof, got "bad", a STRING

exec ny:expect("print step-to-hz(67)",
               :print, 391.995)
exec #print("print step-to-hz(67)")
exec catch(quote(simulated-error), 
           sal-compile("print step-to-hz(67)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot step-to-hz(67 + lfo(4) * 4)",
               :plot, T)
exec #print("plot step-to-hz(67 + lfo(4) * 4)")
exec catch(quote(simulated-error), 
           sal-compile("plot step-to-hz(67 + lfo(4) * 4)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot step-to-hz(60 + vector(lfo(4), lfo(6)))[0]",
               :plot, T)
exec #print("plot step-to-hz(60 + vector(lfo(4), lfo(6)))[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot step-to-hz(60 + vector(lfo(4), lfo(6)))[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print step-to-hz(\"bad\")",
               :nyerror, {"STEP-TO-HZ" 0 {{NUMBER SOUND} {}}})
exec #print("print step-to-hz(\"bad\")")
exec catch(quote(simulated-error), 
           sal-compile("print step-to-hz(\"bad\")", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In STEP-TO-HZ, argument must be a number, sound or array thereof, got "bad", a STRING

exec ny:expect("print hz-to-step(440)",
               :print, 69)
exec #print("print hz-to-step(440)")
exec catch(quote(simulated-error), 
           sal-compile("print hz-to-step(440)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot hz-to-step(440 + lfo(4) * 4)",
               :plot, T)
exec #print("plot hz-to-step(440 + lfo(4) * 4)")
exec catch(quote(simulated-error), 
           sal-compile("plot hz-to-step(440 + lfo(4) * 4)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot hz-to-step(60 + vector(lfo(40), lfo(60)))[0]",
               :plot, T)
exec #print("plot hz-to-step(60 + vector(lfo(40), lfo(60)))[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot hz-to-step(60 + vector(lfo(40), lfo(60)))[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print hz-to-step(\"bad\")",
               :nyerror, {"HZ-TO-STEP" 0 {{NUMBER SOUND} {}}})
exec #print("print hz-to-step(\"bad\")")
exec catch(quote(simulated-error), 
           sal-compile("print hz-to-step(\"bad\")", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In HZ-TO-STEP, argument must be a number, sound or array thereof, got "bad", a STRING

exec ny:expect("print sref(lfo(6), 0.5)",
               :print, 0)
exec #print("print sref(lfo(6), 0.5)")
exec catch(quote(simulated-error), 
           sal-compile("print sref(lfo(6), 0.5)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print sref(vector(lfo(6), lfo(5)), 0.5)",
               :nyerror, {"SREF" 1 {{SOUND} "sound"}})
exec #print("print sref(vector(lfo(6), lfo(5)), 0.5)")
exec catch(quote(simulated-error), 
           sal-compile("print sref(vector(lfo(6), lfo(5)), 0.5)", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SREF, 1st argument (sound) must be a sound, got a 2-channel SOUND

exec ny:expect("print sref(lfo(6), lfo(0.5))",
               :nyerror, {"SREF" 2 {{NUMBER} "time"}})
exec #print("print sref(lfo(6), lfo(0.5))")
exec catch(quote(simulated-error), 
           sal-compile("print sref(lfo(6), lfo(0.5))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SREF, 2nd argument (time) must be a number, got a SOUND

exec ny:expect("plot extract(0, 1, lfo(5))",
               :plot, T)
exec #print("plot extract(0, 1, lfo(5))")
exec catch(quote(simulated-error), 
           sal-compile("plot extract(0, 1, lfo(5))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot extract(lfo(1), 1, lfo(5))",
               :nyerror, {"EXTRACT" 1 {{NUMBER} "start"}})
exec #print("plot extract(lfo(1), 1, lfo(5))")
exec catch(quote(simulated-error), 
           sal-compile("plot extract(lfo(1), 1, lfo(5))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In EXTRACT, 1st argument (start) must be a number, got a SOUND

exec ny:expect("plot extract(0, lfo(1), lfo(5))",
               :nyerror, {"EXTRACT" 2 {{NUMBER} "stop"}})
exec #print("plot extract(0, lfo(1), lfo(5))")
exec catch(quote(simulated-error), 
           sal-compile("plot extract(0, lfo(1), lfo(5))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In EXTRACT, 2nd argument (stop) must be a number, got a SOUND

exec ny:expect("plot extract(0, 1, 2)",
               :nyerror, {"EXTRACT" 3 {{SOUND} "sound"}})
exec #print("plot extract(0, 1, 2)")
exec catch(quote(simulated-error), 
           sal-compile("plot extract(0, 1, 2)", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In EXTRACT, 3rd argument (sound) must be a sound, got 2, a FIXNUM

exec ny:expect("plot extract-abs(0, 1, lfo(1))",
               :plot, T)
exec #print("plot extract-abs(0, 1, lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot extract-abs(0, 1, lfo(1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot extract-abs(0, 1, lfo(1), 0.1)",
               :plot, T)
exec #print("plot extract-abs(0, 1, lfo(1), 0.1)")
exec catch(quote(simulated-error), 
           sal-compile("plot extract-abs(0, 1, lfo(1), 0.1)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot extract-abs(lfo(1), 1, lfo(1))",
               :nyerror, {"EXTRACT-ABS" 1 {{NUMBER} "start"}})
exec #print("plot extract-abs(lfo(1), 1, lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot extract-abs(lfo(1), 1, lfo(1))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In EXTRACT-ABS, 1st argument (start) must be a number, got a SOUND

exec ny:expect("plot extract-abs(0, lfo(1), lfo(1))",
               :nyerror, {"EXTRACT-ABS" 2 {{NUMBER} "stop"}})
exec #print("plot extract-abs(0, lfo(1), lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot extract-abs(0, lfo(1), lfo(1))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In EXTRACT-ABS, 2nd argument (stop) must be a number, got a SOUND

exec ny:expect("plot extract-abs(0, 1, 2)",
               :nyerror, {"EXTRACT-ABS" 3 {{SOUND} "sound"}})
exec #print("plot extract-abs(0, 1, 2)")
exec catch(quote(simulated-error), 
           sal-compile("plot extract-abs(0, 1, 2)", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In EXTRACT-ABS, 3rd argument (sound) must be a sound, got 2, a FIXNUM

exec ny:expect("plot extract-abs(0, 1, lfo(1), lfo(2))",
               :nyerror, {"EXTRACT-ABS" 4 {{NUMBER} "start-time"}})
exec #print("plot extract-abs(0, 1, lfo(1), lfo(2))")
exec catch(quote(simulated-error), 
           sal-compile("plot extract-abs(0, 1, lfo(1), lfo(2))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In EXTRACT-ABS, 4th argument (start-time) must be a number, got a SOUND

exec ny:expect("print local-to-global(0.5)",
               :print, 0.5)
exec #print("print local-to-global(0.5)")
exec catch(quote(simulated-error), 
           sal-compile("print local-to-global(0.5)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print local-to-global(lfo(0.5))",
               :nyerror, {"LOCAL-TO-GLOBAL" 0 {{NUMBER} "local-time"}})
exec #print("print local-to-global(lfo(0.5))")
exec catch(quote(simulated-error), 
           sal-compile("print local-to-global(lfo(0.5))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In LOCAL-TO-GLOBAL, argument (local-time) must be a number, got a SOUND

exec ny:expect("plot loud(2, lfo(1))",
               :plot, T)
exec #print("plot loud(2, lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot loud(2, lfo(1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot loud(2 + lfo(2), lfo(1))",
               :plot, T)
exec #print("plot loud(2 + lfo(2), lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot loud(2 + lfo(2), lfo(1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot loud-abs(2, lfo(1))",
               :plot, T)
exec #print("plot loud-abs(2, lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot loud-abs(2, lfo(1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot loud-abs(2 + lfo(2), lfo(1))",
               :plot, T)
exec #print("plot loud-abs(2 + lfo(2), lfo(1))")
exec catch(quote(simulated-error), 
           sal-compile("plot loud-abs(2 + lfo(2), lfo(1))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot scale-db(6, lfo(6))",
               :plot, T)
exec #print("plot scale-db(6, lfo(6))")
exec catch(quote(simulated-error), 
           sal-compile("plot scale-db(6, lfo(6))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot scale-db(vector(6, 12), lfo(6))[0]",
               :plot, T)
exec #print("plot scale-db(vector(6, 12), lfo(6))[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot scale-db(vector(6, 12), lfo(6))[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot scale-db(6, vector(lfo(6), lfo(5)))[0]",
               :plot, T)
exec #print("plot scale-db(6, vector(lfo(6), lfo(5)))[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot scale-db(6, vector(lfo(6), lfo(5)))[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot scale-db(vector(6, 12), vector(lfo(6), lfo(5)))[0]",
               :plot, T)
exec #print("plot scale-db(vector(6, 12), vector(lfo(6), lfo(5)))[0]")
exec catch(quote(simulated-error), 
           sal-compile("plot scale-db(vector(6, 12), vector(lfo(6), lfo(5)))[0]", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot scale-db(\"bad\", lfo(6))",
               :nyerror, {"SCALE-DB" 1 {{NUMBER} "factor"}})
exec #print("plot scale-db(\"bad\", lfo(6))")
exec catch(quote(simulated-error), 
           sal-compile("plot scale-db(\"bad\", lfo(6))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SCALE-DB, 1st argument (factor) must be a number or array of numbers, got "bad", a STRING

exec ny:expect("plot scale-db(6, 12)",
               :nyerror, {"SCALE-DB" 2 {{SOUND} "sound"}})
exec #print("plot scale-db(6, 12)")
exec catch(quote(simulated-error), 
           sal-compile("plot scale-db(6, 12)", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SCALE-DB, 2nd argument (sound) must be a sound or multichannel sound, got 12, a FIXNUM

exec ny:expect("print set-control-srate(2205)",
               :print, T)
exec #print("print set-control-srate(2205)")
exec catch(quote(simulated-error), 
           sal-compile("print set-control-srate(2205)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print set-control-srate(\"bad\")",
               :nyerror, {"SET-CONTROL-SRATE" 0 {{NUMBER} "rate"}})
exec #print("print set-control-srate(\"bad\")")
exec catch(quote(simulated-error), 
           sal-compile("print set-control-srate(\"bad\")", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SET-CONTROL-SRATE, argument (rate) must be a number, got "bad", a STRING

exec ny:expect("print set-sound-srate(2205)",
               :print, T)
exec #print("print set-sound-srate(2205)")
exec catch(quote(simulated-error), 
           sal-compile("print set-sound-srate(2205)", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("print set-sound-srate(\"bad\")",
               :nyerror, {"SET-SOUND-SRATE" 0 {{NUMBER} "rate"}})
exec #print("print set-sound-srate(\"bad\")")
exec catch(quote(simulated-error), 
           sal-compile("print set-sound-srate(\"bad\")", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SET-SOUND-SRATE, argument (rate) must be a number, got "bad", a STRING

exec ny:expect("plot sound-srate-abs(100, lfo(6))",
               :plot, T)
exec #print("plot sound-srate-abs(100, lfo(6))")
exec catch(quote(simulated-error), 
           sal-compile("plot sound-srate-abs(100, lfo(6))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot sound-srate-abs(\"bad\", lfo(6))",
               :nyerror, {"SOUND-SRATE-ABS" 1 {{NUMBER} "sample rate"}})
exec #print("plot sound-srate-abs(\"bad\", lfo(6))")
exec catch(quote(simulated-error), 
           sal-compile("plot sound-srate-abs(\"bad\", lfo(6))", #t, #f,
                       "<in typecheck.sal>"))
; ERROR MSG: In SOUND-SRATE-ABS, 1st argument (sample rate) must be a number, got "bad", a STRING

exec ny:expect("plot stretch(2, lfo(6))",
               :plot, T)
exec #print("plot stretch(2, lfo(6))")
exec catch(quote(simulated-error), 
           sal-compile("plot stretch(2, lfo(6))", #t, #f,
                       "<in typecheck.sal>"))

exec ny:expect("plot stretch(\"bad\", lfo(6))",
               :error, "1st argument of STRETCH (or 2nd argument of SAL's ~ operator) should be a number (stretch factor)")
exec #print("plot stretch(\"bad\", lfo(6))")
exec catch(quote(simulated-error), 
           sal-compile("plot stretch(\"bad\", lfo(6))", #t, #f,
                       "<in typecheck.sal>"))