xpixels=1024
ypixels=768
ypersamp=8
-rate=96000
fsd=0.3
-test -f t.nmra$rate.dat || \
-sox -r $rate -u -b -t ossdsp /dev/dsp t.nmra$rate.dat trim 0 0:1
-
-perl -e <t.nmra$rate.dat '
+perl -e <t.nmra.dat '
for (;;) {
@l= ();
+ $ticks= "";
+ undef $tickat;
+ print "\n"x3;
for ($x=0; $x<'$xpixels'; $x++) {
$_= <>;
last unless length;
next if m/^\;/;
- m/^\s*[-e0-9.]+\s+([-0-9.]+)\s*$/ or die;
+ m/^\s*([-e0-9.]+)\s+([-0-9.]+)\s*$/ or die;
+ ($t,$samp)=($1,$2);
$h= sprintf "%d",
- ($1/(2.0*'$fsd') + 0.5) * ('$ypersamp'-1);
+ ($samp/(2.0*'$fsd') + 0.5) * ('$ypersamp'-1);
for ($y=0, $l=0; $y<'$ypersamp'; $y+=2, $l++) {
$c= $h==$y ? "_" : $h==$y+1 ? "~" : " ";
$l[$l] .= $c;
}
+ if (!defined $tickat && $samp > 0 && $lastsamp < 0) {
+ $tickat= $t;
+ }
+ if (defined $tickat && $t >= $tickat) {
+ $ticks.= ".";
+ $tickat += 58e-6 * 2;
+ } else {
+ $ticks.= " ";
+ }
+ $lastsamp= $samp if $samp < 0 || $samp > 0;
}
foreach $l (reverse @l) {
print $l, "\n" or die $!;
}
- print "\n"x('$ypersamp'+1) or die $!;
+ print "\n"x2, $ticks, "\n"x6 or die $!;
last unless length;
}
-' >t.nmra$rate.ptxt
+' >t.nmra.ptxt
xterm -fn nil2 \
-geometry ${xpixels}x$(($ypixels * ($ypsersamp+1)/2)) \
-e less -sS t.nmra$rate.ptxt
exit 0
- for ($l=0; $l<@l; $l++) {
- print $l[$l], "\n";
-
-
-sox -r 96000 -u -b -t ossdsp /dev/dsp t.dat trim 0 0:10
-exit 0
-perl -pe '$_= m/\-/ ? "_" : "~"' <t.dat | fold -1024
-
-
-| perl -pe 's/$/\n\n\n/' >u