File: notescale.tcl

package info (click to toggle)
snack 2.2.10.20090623-dfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,764 kB
  • sloc: ansic: 32,662; sh: 8,558; tcl: 1,086; python: 761; makefile: 582
file content (26 lines) | stat: -rwxr-xr-x 826 bytes parent folder | download | duplicates (7)
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
#!/bin/sh
# the next line restarts using wish \
exec wish8.5 "$0" "$@"

package require -exact snack 2.2

set f [snack::filter generator 440.0 30000 0.0 sine 8000]
snack::sound s
#snack::audio playLatency 100

wm resizable . 0 0

proc Beep {freq} {
  $::f configure $freq
  s stop
  s play -filter $::f
}

pack [button .b1 -text C4 -command [list Beep 261.6]] -side left
pack [button .b2 -text D4 -command [list Beep 293.7]] -side left
pack [button .b3 -text E4 -command [list Beep 329.7]] -side left
pack [button .b4 -text F4 -command [list Beep 349.3]] -side left
pack [button .b5 -text G4 -command [list Beep 392.1]] -side left
pack [button .b6 -text A4 -command [list Beep 440.0]] -side left
pack [button .b7 -text B4 -command [list Beep 493.9]] -side left
pack [button .b8 -text C5 -command [list Beep 523.3]] -side left