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)
Can I put this in my mod?
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
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.
I know how to program
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.
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.