×

Discussion Board

Results 1 to 13 of 13

Thread: Beep or Click?

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    67

    Beep or Click?

    Is there a way to generate a short beep or click (as in the old OPL command "beep")?

    It's for the metronome in my Musician app - it's all very well being able to summon up MID or WAV or MP3 sound files, but the very act of calling them is going to mess up the split second timing of the program.

    Surely there's a simple way (or hack) to sound something like the built-in system keyclick noise? Or a simple beep?

    Thanks
    Steve Litchfield

  2. #2
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    209

    Re: Beep or Click?

    Quote Originally Posted by slitchfield
    Is there a way to generate a short beep or click (as in the old OPL command "beep")?
    "User::Beep" (see SDK documentation), you could add this e.g. to "audio" but you would need to do C/C++ coding.

  3. #3
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: Beep or Click?

    Just try playing a short WAV sample with the audio module and see if it's good enough.

  4. #4
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    67

    Re: Beep or Click?

    Quote Originally Posted by jplauril
    Just try playing a short WAV sample with the audio module and see if it's good enough.
    After optimising the WAV file and doing all I can in the code, it's just about good enough, together with a fudge factor or two. The beat's still irregular though, I suspect a degree of inefficiency in terms of caching the sound file etc.

    A built-in 'click' or beep function would be far more likely to work quick enough, though. No other ideas?

    Cheers
    Steve Litchfield

  5. #5
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: Beep or Click?

    You could try playing the file from the RAM disk (D: ). I don't know if it makes any difference, but it's easy to try.

  6. #6
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    67

    Re: Beep or Click?

    Quote Originally Posted by jplauril
    You could try playing the file from the RAM disk (D: ). I don't know if it makes any difference, but it's easy to try.
    Hmm.... e32 is already imported. I use:

    file_copy("D:\\metronome.wav","E:\\metronome.wav")

    but Python tells me that global name file_copy is not defined. Any ideas? Is this a misprint in the PDF docs?

    Steve Litchfield

  7. #7
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: Beep or Click?

    If you said "import e32" you need to say e32.file_copy.

  8. #8
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    67

    Re: Beep or Click?

    Quote Originally Posted by jplauril
    If you said "import e32" you need to say e32.file_copy.
    Wayhay! Thanks. And playing from RAM disk (D make a big difference, I think the metronome's sorted now!

    Thanks again

    Steve Litchfield

  9. #9
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: Beep or Click?

    Hello ,

    You can also generate a beep with a midi file !
    Korakot has modified a "smidi" library and showed usage in Snippet PyS60 Generate and play midi on mobile phone..



    links references :
    smidi library : http://larndham.net/service/pys60/smidi.py
    Generate and play midi on mobile phone. : http://www.bigbold.com/snippets/posts/show/572

  10. #10
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    67

    Re: Beep or Click?

    Quote Originally Posted by cyke64
    Hello , You can also generate a beep with a midi file !
    Yes, but I suspect there's similar overhead to playing a WAV file. Anyway, the digitised metronome sound is fine from RAM disk and sounds great in Musician 1.5, if I say so myself 8-)

    BTW, the tuning notes in the program are MID files....

    Steve

  11. #11
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: Beep or Click?

    Is there a way to generate a short beep or click (as in the old OPL command "beep")?
    Now you can emit a beep with this free library and use it in a next Musician version ;-)

    There music.loudest() function and music.tone(freq,duration,volume) function.

    You find there source and sis file for you phone. http://csg.csail.mit.edu/IAP06/pyext.zip

    Curious but in my 6600 Nokia phone It doesn't work :-(

  12. #12
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Bangkok, Thailand
    Posts
    148

    Re: Beep or Click?

    It doesn't work on my 6600 either.
    (That's why I haven't written a snippet about it.)

Similar Threads

  1. Application skips many times when I click the application
    By bb_sathya in forum Mobile Java General
    Replies: 0
    Last Post: 2005-12-20, 04:49
  2. beep within applicaiton for 6230i very quiet
    By gwhistance in forum Mobile Java General
    Replies: 0
    Last Post: 2005-11-30, 14:57
  3. Belkin USB Bluetooth Adapter Works!
    By jonawebb in forum Bluetooth Technology
    Replies: 10
    Last Post: 2003-06-21, 20:10
  4. Replies: 0
    Last Post: 2003-05-07, 10:54
  5. Replies: 0
    Last Post: 2002-12-11, 04:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •