Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: A program that really makes waves

by QM (Vicar)
on May 10, 2006 at 17:37 UTC ( #548521=note: print w/ replies, xml ) Need Help??


in reply to Re: A program that really makes waves
in thread A program that really makes waves

I've made 2 changes to your code, to randomly play any of these:

my $input; unless ( $input = shift ) { # read from DATA my @tunes = grep { $_ !~ /^#/ and /\S/ } <DATA>; chomp($input = $tunes[rand(@tunes)]); }
and
__DATA__ # Original: <75>[1]vV+|:{1(1)/1C/DEFG+ABCDEFG+ABCBAAbADCBAA-GF#GrG+E-GrF+E-FrF+D-F +rE+D-ErE+C-ErD+C-DrD+B-D^+Cr}:||:(.25)2G+CEDCBA-GFEDCBA-GF*E+EFF#G.E` +Dr:|=1vV-|:{2(2)1C/E~CF~CE+CAB-G#+A-FGCr}:||:(2)EDCB:|=2vV-|:{3(2)0C/ +ECFCE+CAB-G#+A-FGCr}:||:(2)GGGG:|=3 # Twinkle Twinkle Little Star (Main Theme) vV+[1]|:{aCCGG+AA-GGFFEED/D.E`^C/}:|GGFFEEDDGGFFE/E.F`*E~D=avV-[-1]|:{ +bC+CECFCECDBCA-FG*C/}:|+E-G+D-G+C-G+B-G+E-G+D-G+C/C.D`@n*C~B-=bvV-[-1 +]&n*G # TTLS Variation 1 vV+[1]_|:{aDCBCBCBC+A-GF#GF#GF#GG#+ACBDCBAA~-G+EDCBA-GG~F+DCBA-GFF~E+C +BA-GFE*D+A~-GB*Cr_}:|+A-GF#GF#G+A-GGFEFEFGFFED#ED#EFEEDC#DC#DED+A-GF# +G+ECA-GGFEF+DB-GFFED#E+C-GFE*G.~E`*D_=avV-[-1]{bC~+C~E~C~F~C@nE/r.C#` +*D/r.B`*C/r.A`*-FG/}+C-GEG*=b*+C-C+E~-G~+D~-G+C~-G~+F~-G*@o+ED/C/r.C` +E.C`*B[-2]=b*+C-CvV-[0]&nC&o*-GG/GrG # TTLS Variation 2 vV+[1]|:CCGG@nGFFEEDDCCB-Gr+:||:|:GG~FF/E.D`E.F`*E~D:|C~/CB`C`*GG~+AA~ +-GG~F#F~EE~DDCr:|vV-[1]|:*R+A-G/FFEEDDCr:||:CC~CB/C.D`E.F`^B/CC~CB/-G +.+D`E.F`^-G/Grr+C~CC~CBbAAb-G+A~A/-G.F`*Er+:|vV-[-1]|:_C+CBCDCBC-E+CB +CDCBC-F+CBCDCBC-C+CBCDCBC-A+AAbA-B+BBbB-C+CBC-A+AAbA--F+FEF-G+GF#G^-C ++C:||:_G+EEbEFEEbE-G+DDbDEDDbD-G+GF#G+A-GF#G-G+FEFGFEF-G+EEbEFEEbE-G+ +DC#DEDC#D-G+CBCDCBC-G+BBbBCBBbB-C+CBCDCBC-E+CBCDCBC-F+CBCDCBC-C+CBC-C +#+C#BC#-D+DC#D-B+BBbB-C+CBC-A+AAbA--F+FEF-G+GF#G^-C+C:| # TTLS Variation 5 vV+!40!+|:C/rC*G/rG*+A/rA-*G/rGrFrFrErErDrD*Cr:||:G/rG~*F#/rF~*E/rEb~* +D/r-G+*G/r/G~F#~^F/r/F~E~^Eb/r/F#~G~^D/r/F~D~^C/r/C~E~^G/r/G~E~+^A/r/ +A~C~^-G/r/E~GRG~F#RD~FRF~ERG~ERC#~DRF~DRB~C^r:|vV-!40!+|:RRRr/rErErDr +DrCrCrB*Cr:|vV-!40!|:/rCERECRFCRECrDrBrCrA-rFrGR+C-*C+:||:|:/rE-*G/r+ +D-*G/r+C-*G/r+B-*G+:|-/r/C~E~^G/r/+C~E~^G/r/F~+A~-^C/r/E~G~^C/DrBrCr- +ErFrGr+Cr-Cr+*:|
I'm sure you can work up the obfu magic.

Even better, add some "computer generated music" functionality, to get something harmonious and interesting, yet different every time.

-QM
--
Quantum Mechanics: The dreams stuff is made of


Comment on Re^2: A program that really makes waves
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://548521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2015-07-04 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls