object.praat 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. procedure do (formula$)
  18. for i to niter
  19. Formula: formula$
  20. endfor
  21. appendInfoLine: fixed$ (1e9 * stopwatch / niter / nsamp, 1), " ns: ", formula$
  22. endproc
  23. @do: ~ 0
  24. @do: ~ 5
  25. @do: ~ 1/2 * sin(2*pi*377*x) + randomGauss(0,0.1)
  26. @do: ~ self + 5
  27. @do: ~ Sound_sineWithNoise[] + 5
  28. @do: ~ Object_'x.Sound'[] + 5
  29. @do: ~ self
  30. @do: ~ self [col]
  31. @do: ~ self [col] + 5
  32. @do: ~ Sound_sineWithNoise [col] + 5
  33. @do: ~ Object_'x.Sound' [col] + 5
  34. @do: "object [x.Sound, col] + 5"
  35. ;@do: ~ x.Sound [col] + 5
  36. @do: ~ self
  37. @do: "Sound_sineWithNoise [row, col] + 5"
  38. @do: "Object_'x.Sound' [row, col] + 5"
  39. @do: "self [row, col] + 5"
  40. @do: "object [x.Sound, row, col] + 5"
  41. ;@do: ~ x.Sound [row, col] + 5
  42. @do: "object [""Sound sineWithNoise"", row, col] + 5"
  43. name$ = "Sound sineWithNoise"
  44. @do: "object [name$, row, col] + 5"
  45. appendInfoLine: "OK"
  46. Remove