Debian Codegraph @

test/fon/stereoFormula.praat

raw
1 echo Stereo formulas
2 # Paul Boersma, February 1, 2008
3 Create Sound from formula... test Stereo 0 1.5 44100 randomUniform (-1, 1)
4 a = Get value at sample number... Average 100
5 printline 'a'
6 b = Get value at sample number... Left 100
7 printline 'b'
8 c = Get value at sample number... Right 100
9 printline 'c'
10 d = Sound_test [100]
11 d2 = object ["Sound test", 100]
12 printline 'd' 'd2'
13 dd = Sound_test [0, 100]
14 dd2 = object ["Sound test", 0, 100]
15 printline 'dd' 'dd2'
16 ee = Sound_test [1, 100]
17 ee2 = object ["Sound test", 1, 100]
18 printline 'ee' 'ee2'
19 f = Sound_test [2, 100]
20 f2 = object ["Sound test", 2, 100]
21 printline 'f' 'f2'
22 assert a = d
23 assert b = ee
24 assert c = f
25 assert d = dd
26 assert a = d2
27 assert b = ee2
28 assert c = f2
29 assert d = dd2
30 a = Get value at time... Average 0.5 Linear
31 printline 'a'
32 b = Get value at time... Left 0.5 Linear
33 printline 'b'
34 leftAmplitude = Get value at sample number: 1, 22050
35 rightAmplitude = Get value at sample number: 1, 22051
36 average = 0.5 * (leftAmplitude + rightAmplitude)
37 appendInfoLine: "by hand: ", average
38 c = Get value at time... Right 0.5 Linear
39 printline 'c'
40 d = Sound_test (0.5)
41 d2 = object ("Sound test", 0.5)
42 printline 'd' 'd2'
43 dd = Sound_test (0.5, 0)
44 dd2 = object ("Sound test", 0.5, 0)
45 printline 'dd' 'dd2'
46 ee = Sound_test (0.5, 1)
47 ee2 = object ("Sound test", 0.5, 1)
48 printline 'ee' 'ee2'
49 f = Sound_test (0.5, 2)
50 f2 = object ("Sound test", 0.5, 2)
51 printline 'f' 'f2'
52 assert abs (a - d) < 1e-12
53 assert abs (b - ee) < 1e-12
54 assert abs (c - f) < 1e-12
55 assert abs (d - dd) < 1e-12
56 assert abs (a - d2) < 1e-12
57 assert abs (b - ee2) < 1e-12
58 assert abs (c - f2) < 1e-12
59 assert abs (d - dd2) < 1e-12
60 Remove
61 printline OK