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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.