Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Ky bug hunt

by premchai21 (Curate)
on Nov 24, 2001 at 01:08 UTC ( [id://127175]=perlquestion: print w/replies, xml ) Need Help??

premchai21 has asked for the wisdom of the Perl Monks concerning the following question:

While attempting use POE, PDL, and Audio::SoundFile together to write a software synthesizer in Perl, I ran into what is definitely some sort of bug(s); it is generating not the 440 Hz sine wave I expect, but instead a different tone, not a sine wave, plus some garbage at the end; not only that, but when it exits, it segfaults. I cannot seem to find the responsible bug(s), and therefore post the code here: Ky.pm and ky.pl. So is it a bug in my code? Or somewhere else?

Edit 2001-12-04 by dvergin to repair second link</link>

Replies are listed 'Best First'.
Re: Ky bug hunt
by st4k (Novice) on Nov 24, 2001 at 18:48 UTC
    Why do you have to use the constant for PI as 24 digits after the standartd 3.14? Im really interested in this code and am going to try to run it on my box as soon as I get home. It sounds like an interesting project

      Well, I tried it with only 5 digits, and it does the same thing... :-) Really I don't need that much precision, and probably some of it gets stripped out by the native data types anyway... mostly this is just personal preference; I think it's better to have a few too many decimal places than a few too few...

      Note that you'll need POE, PDL, and Audio::SoundFile (which relies on libsndfile, which is linked from the perldoc page for the module). These all can be gotten from CPAN.

Re: Ky bug hunt
by premchai21 (Curate) on Nov 25, 2001 at 09:53 UTC
    Update: Many thanks to toma for finding the bug! It was clipping trying to store values of -128 to 8 bits. I feel rather dumb for not having seen it... in any case, that is now fixed. Will now optimize and possibly move to Data::Flow instead of POE, as Data::Flow seems more suitable. :-D!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://127175]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-03-29 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found