test_Sound_paint_where.praat 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # test_Sound_paint_where.praat
  2. # djmw 20110524
  3. Erase all
  4. s1 = Create Sound from formula... s Mono 0 1 10000 0.5*sin (2*pi*5*x)
  5. s2 = Create Sound from formula... 1odx Mono 0 20 100 1/x
  6. s3 = Create Sound from formula... line Mono 0 1 10000 x/2
  7. Select outer viewport... 0 6 0 3
  8. select s1
  9. Paint where... Red 0 0 -1 1 -1 y 1
  10. Paint where... Green 0 0 -1 1 1 n 1
  11. Text top... n Paint where: green above, red below the sin of 5 Hz
  12. Select outer viewport... 0 6 3 6
  13. Paint where... Red 0 0 -1 1 0 n self>0
  14. Paint where... Green 0 0 -1 1 0 y self<0
  15. Text top... n Paint where: green is positive area , red is negative area of sin of 5 Hz
  16. select s2
  17. Select outer viewport... 0 6 6 9
  18. Draw... 0 20 0 1.5 y Curve
  19. Paint where... Grey 0 20 0 1.5 0 y (x>=1 and x<2) or (x>=4 and x<8)
  20. One mark bottom... 1 y y n
  21. One mark bottom... 2 y y n
  22. One mark bottom... 4 y y n
  23. One mark bottom... 8 y y n
  24. Text top... n Paint where: grey intervals (1,2) and (4,8)
  25. Remove
  26. select s3
  27. plus s1
  28. Select outer viewport... 0 6 9 12
  29. Paint enclosed... Grey 0 0 -1 1 yes
  30. Text top... n Paint enclosed: between sine and straight line
  31. removeObject: s1, s3