robertsonics / WAV-Trigger-Arduino-Serial-Library

WAV Trigger Serial Control Arduino Library
27 stars 13 forks source link

trackFade function limitation #1

Open shawnrk opened 9 years ago

shawnrk commented 9 years ago

trackFade appears to not work with transition times of less than about 200 ms. 300ms and above works perfectly. With short durations, the function appears to have no effect at all. If you want quick transitions, just use trackGain instead. Given that, this bug doesn't really have practical consequences, other than potentially tripping up the developer for an hour as it did me. Other than this, my experience with this lib and the WAV Trigger in general has been amazing! Thanks a lot Jamie!

robertsonics commented 9 years ago

Thanks for the feedback. The fader time calculation is a bunch of complicated integer math that I'll have to get my head wrapped around again in order to investigate. I have to convert the fade time to a volume delta from the current volume to the target volume, and a number of sample periods to apply (or skip) the change. There could easily be a problem with the math for a large change over a short time.

I'd be interested to know if you have need for library functions that return information from the WAV Trigger. I haven't added them because I haven't had much feedback that folks are using the library.

shawnrk commented 9 years ago

I figured as much. I heard some digital clipping when I increased the fade time up to 200ms from 0, which tipped me off that it may be a scaling issue on the sample amplitude. Sure enough, above 300ms everything started worked perfectly. And since trackGain is a viable workaround for short timeframes, I'd say it's worth more right now to just add a note concerning this on the readme so others don't trip on it.

I might use the return info functions if they were there, but honestly the wav trigger has worked so flawlessly that I've gotten by fine by monitoring the audio output. But my app doesn't really push the limits of what the trigger is capable of, so more sophisticated users may need it more than I do. Actually, the one function I would really like would be to turn off the return information completely. Right now the return data clutters up my arduino serial monitor screen where I'm watching the status messages from my arduino app.

robertsonics commented 9 years ago

What return information are you seeing? Unless you send the CMD_GET_VERSION or CMD_GET_SYS_INFO, I don't think I send anything unsolicited.

shawnrk commented 9 years ago

That's funny. I get a few ascii chars appearing in the serial mon immediately after I make a wt library call. I did glance at it briefly with a hex viewer and I thought it corresponded to your protcol format... But now that I think about it, I think what I'm seeing is the transmit data from your library. That makes more sense. Duh. I'm a bit of a noob, sorry!

robertsonics commented 9 years ago

Well, one way to know for sure would be to simply not connect the WAV Trigger TX pin to your Arduino RX pin. You don't need it anyway if you're not using any of the commands that return data.

shawnrk commented 9 years ago

Ah - good point. Will try that. Thanks!

On Apr 20, 2015, at 12:47 PM, robertsonics notifications@github.com wrote:

Well, one way to know for sure would be to simply not connect the WAV Trigger TX pin to your Arduino RX pin. You don't need it anyway if you're not using any of the commands that return data.

— Reply to this email directly or view it on GitHub https://github.com/robertsonics/WAV-Trigger-Arduino-Serial-Library/issues/1#issuecomment-94505415.