Very cute. A better namespace might be Acme::Beep as Acme:: is a namespace filled with fun but not necessarily vital bits and bobs. It is hard to justify Beep:: as a new top level namespace given that there are not likely to be that many related 'submodules' (except for Beep::beep of course). Audio::Beep is another option
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
| [reply] [Watch: Dir/Any] |
#
# Copyright (c) 1997-2002 The Protein Laboratory, University of Copen
+hagen
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyrigh
+t
# notice, this list of conditions and the following disclaimer in
+the
# documentation and/or other materials provided with the distribut
+ion.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
+AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, T
+HE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LI
+ABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQ
+UENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE G
+OODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTIO
+N)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN A
+NY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ OF
# SUCH DAMAGE.
#
# $Id: pitch.pl,v 1.3 2002/05/14 13:22:26 dk Exp $
use Prima;
use Prima::Utils;
=pod
=item NAME
A sound example
=item FEATURES
Tests the implementation of apc_beep_tone() function.
=cut
my %octave = (
'C' => 523,
'B' => 493,
'A#' => 466,
'A' => 440,
'G#' => 415,
'G' => 391,
'F#' => 369,
'F' => 349,
'E' => 329,
'D#' => 311,
'D' => 293,
'C#' => 277,
);
$_ = 'E2D#EF2E2 G#2A4';
#$_ = 'AEAEAG#2 2EG#EG#A2 2EAEAG#2 2EG#EG#A2 AB2 BC2 C2BAG#A2 AB2 BC2
+C2BAG#A3';
for ( m/\G([A-G\s][\#\d]*)/g) {
my $d = (s/(\d+)$//) ? $1 : 1;
$octave{$_} ?
Prima::Utils::sound( $octave{$_}, 100 * $d) :
select(undef,undef,undef,0.1 * $d);
}
MJD says you
can't just make shit up and expect the computer to know what you mean, retardo!
** The Third rule of perl club is a statement of fact: pod is sexy.
|
| [reply] [Watch: Dir/Any] [d/l] |
Is the namespace fine?
How about Audio::Beep?
Update And does the module really require Perl 5.8? The first line in Makefile.PL says it does so it won't install on my 5.6.1 system.
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
I think this is a really useful and fun module!
I suggest Audio::Monophone,
since the module is a simple monophonic
perl musical instrument,
which plays a sequence of single tones.
If it played chords,
it would be Audio::Polyphone.
As a module author,
you will get many requests for enhancements,
especially since you have written
such a charming module.
I think you will receive suggestions about
how to make your module work on other platforms.
I would like to use your module
in a client/server environment.
I want programs on several different computers
to connect to a computer on my desk
and play a tune.
For example, I would like to sound the 'red alert'
when the warp core starts to overheat :-).
It should work perfectly the first time! - toma | [reply] [Watch: Dir/Any] |
Please consider finding a new name. Sooner or later Perl will definitely need a BEEP.pm to support the BEEP network protocol (http://www.oreilly.com/catalog/beep/). Sure, it could be Net::BEEP, but I think it would be needlessly confusing to have a Beep.pm that doesn't have anything to do with BEEP.
-sam
| [reply] [Watch: Dir/Any] |
I like this. It gives me an easy way to audibly signal different errors. I see just 1 small glitch. On my suse linux system , and probably many
other linux systems, beep is a predefined shell function. I got around it by changing the name of the c program to beepme, but it's something
to consider. Maybe in your beep.pm where you take the backtick on beep, you could specify the full path, /usr/bin/beep ? | [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
I didn't come up with any particular dialect or notation. I just took one standard i thought as cool, Lilypond. If you look close is also on the page you linked to. I wrote a parser just for a subset of that notation, adding the rpm "note".Of course other parsers could be wrote.
$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |