1#!/bin/sh
2# the next line restarts using wish \
3exec wish8.4 "$0" "$@"
4
5package require -exact snack 2.2
6
7set f [snack::filter generator 440.0 30000 0.0 sine 8000]
8snack::sound s
9#snack::audio playLatency 100
10
11wm resizable . 0 0
12
13proc Beep {freq} {
14  $::f configure $freq
15  s stop
16  s play -filter $::f
17}
18
19pack [button .b1 -text C4 -command [list Beep 261.6]] -side left
20pack [button .b2 -text D4 -command [list Beep 293.7]] -side left
21pack [button .b3 -text E4 -command [list Beep 329.7]] -side left
22pack [button .b4 -text F4 -command [list Beep 349.3]] -side left
23pack [button .b5 -text G4 -command [list Beep 392.1]] -side left
24pack [button .b6 -text A4 -command [list Beep 440.0]] -side left
25pack [button .b7 -text B4 -command [list Beep 493.9]] -side left
26pack [button .b8 -text C5 -command [list Beep 523.3]] -side left
27