Debian Codegraph @

test/sys/object.praat

raw
1 writeInfoLine: "object[]..."
2 nsamp = 44100
3 x.Sound = Create Sound from formula: "sineWithNoise", 1, 0, 1, nsamp, "1/2 * sin(2*pi*377*x) + randomGauss(0,0.1)"
4 assert object [x.Sound]. xmin = 0
5 assert object [x.Sound]. xmax = 1
6 assert object [x.Sound]. ncol = nsamp
7 assert object [x.Sound]. nx = nsamp
8 assert object [x.Sound]. dx = 1 / 44100
9 ;assert object [x.Sound]. x1 = 0.5 / 44100
10 assert object [x.Sound]. ymin = 1
11 assert object [x.Sound]. ymax = 1
12 assert object [x.Sound]. nrow = 1
13 assert object [x.Sound]. ny = 1
14 assert object [x.Sound]. dy = 1
15 niter = 1e3
16 stopwatch
17
18 procedure do (formula$)
19 for i to niter
20 Formula: formula$
21 endfor
22 appendInfoLine: fixed$ (1e9 * stopwatch / niter / nsamp, 1), " ns: ", formula$
23 endproc
24
25 @do: ~ 0
26 @do: ~ 5
27 @do: ~ 1/2 * sin(2*pi*377*x) + randomGauss(0,0.1)
28 @do: ~ self + 5
29 @do: ~ Sound_sineWithNoise[] + 5
30 @do: ~ Object_'x.Sound'[] + 5
31 @do: ~ self
32 @do: ~ self [col]
33 @do: ~ self [col] + 5
34 @do: ~ Sound_sineWithNoise [col] + 5
35 @do: ~ Object_'x.Sound' [col] + 5
36 @do: "object [x.Sound, col] + 5"
37 ;@do: ~ x.Sound [col] + 5
38 @do: ~ self
39 @do: "Sound_sineWithNoise [row, col] + 5"
40 @do: "Object_'x.Sound' [row, col] + 5"
41 @do: "self [row, col] + 5"
42 @do: "object [x.Sound, row, col] + 5"
43 ;@do: ~ x.Sound [row, col] + 5
44 @do: "object [""Sound sineWithNoise"", row, col] + 5"
45 name$ = "Sound sineWithNoise"
46 @do: "object [name$, row, col] + 5"
47 appendInfoLine: "OK"
48 Remove