topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday December 11, 2024, 11:21 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Noisemaker  (Read 17230 times)

nhk220

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Noisemaker
« on: August 21, 2005, 09:56 AM »
I would like to have a program that runs on XP that will generate a musical tone form 1-3 seconds in length at random time intervals that I can specify.  E.G. random beeps from 2 to 9 minutes.  It would be nice if it would run behind any other programs running at the time.  Cheers

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Noisemaker
« Reply #1 on: August 21, 2005, 10:37 AM »
some questions:

does it matter what tone? random tone? fixed tone?

you want to be able to say, generate a tone every 7 minutes that lasts for 2 seconds, or you want to say, generate a tone ever x minutes (where x can change and be random from 2 to 9 minutes) of random duration that can range from 1-3 seconds.

what a strange request - mind telling us what it is to be used for?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
DONE: Noisemaker
« Reply #2 on: August 21, 2005, 07:38 PM »
 :huh: Noisemaker waits ... minutes, plays random 1-3 second notes for ... minutes.

Fearful of the new terrorist act, I still post this solution to the request.

Download and install AutoHotKey from www.autohotkey.com. Save the script as Noisemaker.ahk and doubleclick to run.

Skrommel


;Noisemaker.ahk
; Waits ... minutes, plays random 1-3 second notes for ... minutes
;Skrommel @2005

#Persistent

IN:
InputBox,in,Noise,Start playing in ... minutes:
If in<1
  Goto,IN

FOR:
InputBox,for,Noise,Play for ... minutes:
If for<1
  Goto,FOR

in*=60000
for*=60000
SetTimer,START,%in%
Return

START:
SetTimer,START,Off
SetTimer,STOP,%for%
Loop
{
  Random,duration,1000,3000
  Random,frequency,200,10000
  SoundBeep,%frequency%,%duration%
}

STOP:
SetTimer,STOP,Off
ExitApp

zridling

  • Friend of the Site
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,299
    • View Profile
    • Donate to Member
Re: Noisemaker
« Reply #3 on: August 21, 2005, 08:47 PM »
Oh man, am I going to have some devious fun with this. "Dang, Boss, looks like you've got the latest Sasser worm! I'm going to need your credit cards and all your available cash to fix it."
 :)

nhk220

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Re: Noisemaker
« Reply #4 on: August 22, 2005, 05:52 AM »
As I reread my first post I see that I didn't explain my need very well the first time.

I need to generate a tone for 1-3 seconds, once every few minutes. The time inteval between tones needs to vary, and I need to be able to specify the extremes on the time delay interval: it might be from 1-3 minutes one time and 5-20 minutes the next.

The tone can be the same tone (one easily heard) or it can vary as well. 

The program needs to run until I stop it, so if it could monitor for a keypress, that would be nice, or I can just stop it from the task bar as I did with ahk.

Thanks so much.

Cheers

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: Noisemaker
« Reply #5 on: August 22, 2005, 06:12 AM »
 :) NoiseMaker v2.0 - Waits a random number of minutes, plays a random note for 1-3 sec, waits a random number of minutes...

Skrommel


;NoiseMaker.ahk v2.0
; Waits ... minutes, plays a random note for 1-3 sec, waits
;Skrommel @2005

#Persistent

SHORT:
InputBox,short,NoiseMaker,Shortest pause (in minutes):
If short<1
  Goto,SHORT

LONG:
InputBox,long,NoiseMaker,Longest pause (in minutes):
If long<%short%
  Goto,LONG

Loop
{
  Random,duration,1000,3000
  Random,frequency,200,5000
  SoundBeep,%frequency%,%duration%
  Random,pause,%short%,%long%
  pause*=60000
  Sleep,%pause%
}

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Noisemaker
« Reply #6 on: August 22, 2005, 07:03 AM »
skrommel is the best  :-*

i'll update the noisemaker in skrommel's pack#2 when this gets to final version,
but this might be a good time to recap how easy it is to make a standalone exe out of these autohotkey scripts.

just install autohotkey from http://www.autohotkey.com/

then copy and paste skrommels script to a text editor (like notepad) and save it as as he says (noisemaker.ahk).

now you can double click that ahk to run it inside autohotkey right away

OR

right click on it from windows explorer and select compile

OR

from your start menu autohotkey group choose "convert .ahk to .exe" and select it.

voila you have a standalone exe you can run on any computer.

nhk220

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Re: Noisemaker
« Reply #7 on: August 22, 2005, 07:17 PM »
Wow!

I do believe you have done it.  This is great!  I can't wait to try it out.

I really do believe all the good things people have said about you now! 

Thnak you, thank you, thank you!

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,069
    • View Profile
    • Donate to Member
Re: Noisemaker
« Reply #8 on: August 22, 2005, 07:36 PM »
Still intrigues though - what is this for ????

Come on spill the beans  >:(