I ask for some feedback on Beep.pm, a new module i wrote. This is meant to use the computer beeper in some fancier ways.
NB: this module works only on Linux now and requires an external program! (beep)
#functional simple way
use Beep;
beep($freq, $milliseconds);
#OO more musical way
use Beep;
my $beeper = Beep->new();
#lilypond subset syntax accepted
my $music = "g f bes c'8 f d4 c8 f d4 bes, c' g, f2";
# Pictures at an Exhibition by Modest Mussorgsky
$beeper->play( $music );
Download the whole thing from
my CPAN directory.
Look at
http://lilypond.org/ for more info about Lilypond format.
Some questions:
- Is the namespace fine?
- Is anybody willing to write an XS backend? (maybe even simply porting the beep program inside an XS module)
- Any other suggestion is gladly accepted
Update: looking at the posts below i decided the namespace should be Audio::Beep (thanks everybody for the suggestions).
The Prima effort is pretty cool. Looking at the code i think we could take the Win32 beep code directly (i wrote "we" cause i think i will need some help in this). For the Linux backend i would stick to a "beep" (the program) implementation as the one found in Prima requires X.
About the problem with Makefile.PL requiring Perl 5.8: i'm sorry, i don't think we require 5.8. It's just that h2xs produced the Makefile.PL with that header and I didn't realize it was bad. I will update it in next version.
Update2: updated the link to point to my CPAN directory. The new version in Audio::Beep namespace also feature a PurePerl backend (doesn't require the beep executable for root users).
$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g
In reply to Beep.pm
by giulienk
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.