BEEP Element

  • cyberdragon
    30th May 2013 Member 0 Permalink

    Tone generator element. Frequency adjustable to 1 Hertz accuracy by tmp. Duration in milliseconds by tmp2. Activated by p-silicon. Beeps for every particle of sparked pscn touching it. (3 pixals = 3 beeps)

     

    Note: will lag while playing tone

     

    I need help with cross-platform support. I don't know how to code for Linux or Macintosh. I just found some supposed tone generating code on the internet that claims to work anywhere. (notice: On other operating systems it needs a plugin to work, It should download it automatically)

     

    http://pastebin.com/hFdjWE3W

  • firefreak11
    30th May 2013 Member 0 Permalink

    @cyberdragon (View Post)

     Can I put this in my mod? 

  • cyberdragon
    31st May 2013 Member 0 Permalink

    I told you I got part of it off the internet. That's why I haven't put it in my mod yet, don't know what it'll do to other computers. (crashy?)

     

    EDIT: P.S. don't forget the plugin thingy

  • Pilihp64
    31st May 2013 Developer 1 Permalink

    Here is a "note" element that actually works.

    https://github.com/mniip/The-Powder-Toy/tree/note

    It may go official when fixed up a bit to sound nice.

     

    Also, please please try learning how to program before you post things.  I don't really mean to be rude, but it is hilarious.  If you need help please ask.

  • firefreak11
    31st May 2013 Member 0 Permalink

    @cracker64 (View Post)

     I know how to program

  • mniip
    31st May 2013 Developer 0 Permalink
    That one fails :C , tone generator takes too long to run for many parallel notes
  • Box-Poorsoft
    31st May 2013 Banned 2 Permalink
    This post is hidden because the user is banned
  • boxmein
    31st May 2013 Former Staff 0 Permalink
    os.system is sadly a VERY very very very laggy way of doing this.
    VERY.

    mniip/The-Powder-Toy/note is the best yet.
  • cyberdragon
    31st May 2013 Member 0 Permalink

    mniip's method and code is dirty. He should use tmp for frequency because it allows for more accurate frequency. So, yes, I may take his code, but I'm going to seriously beef it up.

     

    P.S. It works fine for me, a bit slow but it works. Your computers must be crappy.

     

    P.S. @cracker64. I have an entire working mod. I just don't know any Linux or Mac.

  • Pilihp64
    31st May 2013 Developer 0 Permalink

    @cyberdragon (View Post)

    You said yourself, "will lag while playing tone".

     

    Anyway, no there is nothing wrong with his code, it literally generates a sine wave at specific frequencies (actual in tune notes).  Sure a full frequency range might be nice, but would make it a huge pain to create decent sounding songs.