[GLLUG] Beep Toy-Program

Chris Fritz fritzc at poweronlansing.com
Thu Oct 13 18:16:25 EDT 2011


I'm going to play with this on my laptop when I get home. But if I'm up all
night trying to write music for my pcspkr, I'm blaming you.

Thanks for sharing!

Chris Fritz
*Founder & CEO
Power On, LLC
poweronlansing.com
(517) 798-6098
114 W. Allegan, Lansing, MI
48933<http://maps.google.com/maps?q=114+W.+Allegan,+Lansing,+MI+48933>
*

*If you enjoy working with us, let your friends know *
*by **liking us on
Facebook<http://www.facebook.com/pages/Power-On/181028965285517>or
tweeting
us on Twitter <http://twitter.com/#!/poweronlansing>. *
*If there's an area where we can improve, let us
know<https://docs.google.com/a/poweronlansing.com/spreadsheet/viewform?hl=en_US&formkey=dHJXcVhfTkMza1BpV0RkODEyNFdHbkE6MQ#gid=0>
.*

On Thu, Oct 13, 2011 at 5:49 PM, Karl Schuttler <karl.schuttler at gmail.com>wrote:

> Smoke.sh is just a batch script that runs the beep command multiple
> times and pauses inbetween beeps. Command arguments for beep command
> are -f (frequency) and -l (length in milliseconds)
>
> while true #loop forever
>  if `vmstat|tail -1|cut -d\" \" -f2`.to_i > 2 #vmstat dumps system
> info, the rest formats it to get just the processor queue. "If queue >
> 2"
>   system("beep -f " + (200+rand(400)).to_s + " -l 150") #runs beep
> command with a random frequency between 200-600hz for 150ms.
>  end
> end
>
> To end program, do pkill ruby or ctrl-c. Program is ran by "$ruby wopr.rb"
>
> On Thu, Oct 13, 2011 at 5:33 PM, Stanley C. Mortel <mortel at cyber-nos.com>
> wrote:
> > Karl,
> >
> > As a public service, why don't you annotate, comment, explain what each
> > little bit of this thing is doing, for those of us to whom the syntax is
> not
> > particularly perspicuous.
> >
> > Stan
> >
> > On 10/13/2011 4:36 PM, Karl Schuttler wrote:
> >
> > Hi all,
> >
> > Some of you may remember my world famous beep scripts from back in the
> > day, including great beep hits like Smoke on the Water (attached), and
> > Iron Man. I felt inspired yesterday and wrote up this quick ruby
> > script which makes random beeping sounds reminiscent of old sci-fi
> > computers when your linux computer is doing anything that requires a
> > bit of processor. Required is the linux beep utility (apt-get install
> > beep), ruby (probably already installed), and your pc speaker turned
> > on (modprobe pcspkr and use alsamixer to pump up the volume).
> >
> > wopr.rb
> > =========
> > while true
> >   if `vmstat|tail -1|cut -d\" \" -f2`.to_i > 2
> >     system("beep -f " + (200+rand(400)).to_s + " -l 150")
> >   end
> > end
> >
> >
> > Leave it running in the background and have a little fun. To test it,
> > you can always do a dd if=/dev/urandom of=/dev/null to generate some
> > processor cycles.
> >
> > Enjoy,
> > Karl
> >
> >
> > _______________________________________________
> > linux-user mailing list
> > linux-user at egr.msu.edu
> > http://mailman.egr.msu.edu/mailman/listinfo/linux-user
> >
> > _______________________________________________
> > linux-user mailing list
> > linux-user at egr.msu.edu
> > http://mailman.egr.msu.edu/mailman/listinfo/linux-user
> >
> >
> _______________________________________________
> linux-user mailing list
> linux-user at egr.msu.edu
> http://mailman.egr.msu.edu/mailman/listinfo/linux-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.egr.msu.edu/mailman/public/linux-user/attachments/20111013/fc55b859/attachment.html>


More information about the linux-user mailing list