Speaker Mod (With Sound!)

  • realbig
    26th Mar 2014 Member 9 Permalink

    This is a WIP mod that adds sound to the game in the form of a new electronic component:

     

    SPKR Speaker

    • temperature defines pitch (in hertz)
    • tmp defines duration (in frames)

     

    Known bugs:

    Some notes sound harsh together

    Short static when a note releases

    Short static on long notes

    Doesn't work on some machines (please provide feedback so I can troubleshoot)

    Notes don't stop when the simulation does

    --type "Quiet()" into the console to stop sounds

     

    Releases:

    Current

    (Should work for Windows and Linux)

    Edited 6 times by realbig. Last: 28th Mar 2014
  • zBuilder
    28th Mar 2014 Member 0 Permalink

    is your LUA5.1 dll modified? it seems to be packed with another program.

    it may be a false positive,but only if the normal one also gives a warning. if not there might be extra data there

  • realbig
    28th Mar 2014 Member 0 Permalink

    On my machine it didn't run without LUA5.1 dll but I don't have anything else related to lua installed.

  • CeeJayBee
    28th Mar 2014 Member 0 Permalink

    Yep, avast threw up a virus alert for my lua51.dll. Are you sure it's not modded? Where did you dl it. I don't regularly say things are false positives. Sauce please and fix, I'd really like to see how you've done this.

     

    (the only other option is run it in a virtual machine, but effort)

  • mniip
    28th Mar 2014 Developer 0 Permalink
    @realbig (View Post)
    Using a sound library binding to create sound is no big deal.
    Check this out:
    https://github.com/mniip/The-Powder-Toy/compare/note-2
  • zBuilder
    28th Mar 2014 Member 0 Permalink

    CeeJayBee:

    Yep, avast threw up a virus alert for my lua51.dll. Are you sure it's not modded? Where did you dl it. I don't regularly say things are false positives. Sauce please and fix, I'd really like to see how you've done this.

     

    (the only other option is run it in a virtual machine, but effort)

     

     

    Avast is pretty sensitive at times, but since LUA51 is pretty common it doesn't seem like the base library would give a false positive.

     

  • realbig
    28th Mar 2014 Member 0 Permalink

    I'm using proteaAudio (http://viremo.eludi.net/proteaAudio/index.html) which includes those two dlls.  I didn't modify either.  If you really want to, you could re-download their dlls and use them instead, but they should be the same as the ones I packaged.

     

    edit: I changed the dll in the download to be the official one from lua.org.  The only change I made was removing the period to change it from lua5.1 to lua51 because it didn't recognize it until I did.

     

    edit2: I ran the old and new Lua51.dll and the proAudioRt.dll in Avast and I can confirm that the old Lua51.dll did not pass inspection.  The new dll I included does, however, pass Avast inspection, as well as the proAudioRt.dll.  Sorry I didn't check that first, but now the dlls are tested and safe.

    Edited 2 times by realbig. Last: 28th Mar 2014
  • zBuilder
    28th Mar 2014 Member 1 Permalink

    @realbig (View Post)

     looks clean now- thanks!

  • CeeJayBee
    28th Mar 2014 Member 1 Permalink

    @realbig (View Post)

    Nice, works now. Pretty cool element.

  • realbig
    30th Mar 2014 Member 0 Permalink

    @mniip (View Post)

     True, but this is done in lua, meaning that you can stack other lua mods with it and neither I nor the end user have to worry about compiling.  I prefer lua scripting in powder toy due to the accessability, but that's just me.