File: testsuite_sound_include.kbs

package info (click to toggle)
basic256 2.0.99.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,888 kB
  • sloc: cpp: 17,185; yacc: 4,025; lex: 1,466; java: 1,091; sh: 39; xml: 33; makefile: 20
file content (75 lines) | stat: -rw-r--r-- 1,953 bytes parent folder | download
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
# testsuite_sound_include section for BASIC256

# Modification History
# date		programmer	description
# 20140606	j.m.reneau	split from test suite
# 20160806	j.m.reneau	added list of list tests
# 20161031  j.m.reneau  added polysoud 2 3 and 4 voices
# 20161101  j.m.reneau  added [] to all array passing to functions
# 20170515  j.m.reneau  added back polyohonic sounds and added duration testing

currentsuite = "sound"

l = msec
t = "hello."
say t
l = msec - l
call range("say "; t, l, 500, 2500)
call q("did the computer say 'hello'")

l = msec
t =  3 + 7
say t
l = msec - l
call range("say "; t, l, 500, 2500)
call q("did the computer say 'ten'")

l = msec
sound 440,500
l = msec - l
call npercent("note play for 500 MS", 500, l, 1)
call q("did a half second sound play")

l = msec
sound {440,200,220,100,300,200}
l = msec - l
call npercent("note play for 500 MS", 500, l, 1)
call q("did three sounds play from a list")

c = {440,200,220,100,300,200}
l = msec
sound c[]
l = msec - l
call npercent("note play for 500 MS", 500, l, 1)
call q("did same three sounds play from an array assigned a list")

a = {261,2000}
l = msec
sound a[]
l = msec - l
call npercent("note play for 2000 MS", 2000, l, 1)
call q("did c play for 2 seconds")

## requires padding elements 0,0 because of loading into array
b ={{261,2000,0,0}, {0,200,329,1600}}
l = msec
sound b
l = msec - l
call npercent("note play for 2000 MS", 2000, l, 1)
call q("did c then e play for 2 seconds")

## requires padding elements 0,0 because of loading into array
c ={{261,2000,0,0}, {0,200,329,1600}, {0,400,391,1200}}
l = msec
sound c[]
l = msec - l
call npercent("note play for 2000 MS", 2000, l, 1)
call q("did c then e then g play for 2 seconds")

## does not require padding elements
l = msec
sound {{261,2000}, {0,200,329,1600}, {0,400,391,1200}, {0,600,523,800}}
l = msec - l
call npercent("note play for 2000 MS", 2000, l, 1)
call q("did c then e then g then c play for 2 seconds")