Device that emits random pitches at random frequencies

Discussion in 'Computer Hardware & Builds' started by Spanky McTrolly, Nov 25, 2008 with 5 replies and 157 views.

  1. Spanky McTrolly

    Spanky McTrolly Enthusiast

    Messages:
    385
    Ratings:
    59
    Not sure if this is the right forum, but i want to build a small circuit board with a speaker on it that emits random pitches at a random frequency. I also want to attach a powerful magnet on the back so that i can turn it on, throw it some where mettle and out of reach, and walk away.

    My computer programming teacher has made one of these before but he wont tell me how to make them. Any idea on how to do this? Any tuts online?


    Thanks
     
  2. Beezy 4 sheezy

    Beezy 4 sheezy Banned

    Messages:
    1,393
    Ratings:
    68
    they sell these somwhere I forgot.
     
  3. RvB rox

    RvB rox Member

    Messages:
    2,379
    Ratings:
    122
    they might have a tut on it for sale on ebay or something...
     
  4. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    I don't know what to do as far as hardware, but if you already have an onboard system speaker, an easy way to make a program that does that in VB would be using something like this.

    Code:
    Console.Beep("1000", "5000")
    1000 is the frequency and 5000 is the duration in milliseconds (5 seconds). A higher number for frequency will be higher pitched, while 1000 is fairly low.

    If you want it to generate some kind of psuedo-random tone try putting something like this on a timer.
    Code:
     Dim RandomNumber As New Random(DateTime.Now.Millisecond)
    Dim OneThroughTenFreq As Integer = RandomNumber.Next(1, 10)
    Dim OneThroughTenDuration As Integer = RandomNumber.Next(1, 10)
    If OneThroughTenFreq < 5 Then
    Console.Beep(OneThroughTenFreq * 4000, OneThroughTenDuration * 1000)
    Else
    Console.Beep(OneThroughTenFreq * 2000, OneThroughTenDuration * 1000)
    End If
    Sorry if that's not what you're looking for, but you did mention that it's a programming class so well yeah.
     
  5. Haxalot88

    Haxalot88 VIP VIP

    Messages:
    8,051
    Ratings:
    2,482
    Best way I could see to build a device like this would to have a PIC microcontroller programmed to output an 8-bit sound output using pseudo-random generation.
     
  6. OP
    Spanky McTrolly

    Spanky McTrolly Enthusiast

    Messages:
    385
    Ratings:
    59
    Thanks Ibdc but i all ready know how to do that :smile:

    Could you maybe point me to some site where i could learn some of this?

    Thanks guys!