November 23, 2024, 08:40:40 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


AP-16+ Random feature

Started by JackMan, July 10, 2010, 05:46:02 AM

Previous topic - Next topic

JackMan

Jon,
    The internal logic for the random feature of SFX files doesn't seem to be working according to the docs. I have 9 files, SFX00 thru SFX08. The Audio select is set to position 8 and the random switch is on. When triggered, a random file does play but I'm getting a lot of repeats before all the files are played. I tried both the 12-24v input and the switch input several times, am I doing something wrong?

JonnyMac

July 10, 2010, 08:31:59 AM #1 Last Edit: July 10, 2010, 09:15:41 AM by JonnyMac
Here's the thing, if any of your files are out of order -- that is, the do not conform to these standards:

WAV
16-bit
stereo
PCM encoded
44.1kHz sample rate (or lower)

... then they will not be inventoried by AP-16+, they'll simply be ignored; this could account for the repeats (the AP-16+ is using few files than you are).

I'm moving this thread; in future, please post in the AP-16+ section.  Thanks.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

July 10, 2010, 09:44:16 AM #2 Last Edit: July 10, 2010, 11:08:24 AM by JonnyMac
Okay, Jack, mea culpa.  I just created a new set of test files and was able to duplicate that error -- it's not a show-stopper at all, but it doesn't behave the way I wanted (repeats before all played).  Will have to look at the code to see what's up, because I had checked that and I asked my beta testers to check as well.

The good news is that once I sort out the issue I can post an update file that you (and anyone else) can load into the AP-16+.  
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Solved!  I fooled myself with a bit of programming trickery in the code -- simplified and cleared up the problem.  The attached ZIP contains AP16.PGM which is the updated firmware. 

Copy AP16.PGM to your SD card and then pop the SD card into the AP-16+ and power-up.  After the AP-16+ boots up you'll see the status LED flash yellow for about 15 seconds; this is the new firmware being loaded from the SD card.  After everything is loaded the AP-16+ will reboot itself.  Once you get a green status LED you are good to go.

Thanks for the catch, Jack, and we're sorry if it caused you any inconvenience.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

BTW... I created a new set of SFX test files to ensure I wasn't fooled by sound-similar files (as I may have been before).  These files (SFX00.WAV - SFX15.WAV) are just me saying "SFX" and the file number.

http://www.efx-tek.com/downloads/sfx_names.zip

The files are encoded at 22.05kHz so that you can test the "S" (playback speed) feature through the serial link at both extremes (50% to 200%)
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Bingo. I have to say, you are on top of things! Works perfect now, thanks for the fix and this was no inconvenience at all, I'm still playing around with this thing. My biggest problem at this point is that I have a ton of useful ideas for my AP-16+ but I can't decide which one to go with! By the way, (I'm sure you already know this) after the update is loaded, it automatically deletes the file from the card, nice. Thanks again.   ;)

JonnyMac

Glad to know that's working -- I am spending the day near the beach with friends, and was wondering if it worked for you as well as for me (I was as thorough as I could be before heading out).

Yes, the update file gets deleted; this is necessary to prevent the AP-16+ from getting trapped a loop when the file is detected (the SD driver will not allow the renaming of files, so deleting is required).
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Quote from: JonnyMac on July 10, 2010, 07:11:49 PM
Yes, the update file gets deleted; this is necessary to prevent the AP-16+ from getting trapped a loop when the file is detected (the SD driver will not allow the renaming of files, so deleting is required).

That is a cool feature! Not just so the AP-16 wont continually loop, but so I dont mess up when......IF, I forget to erase the file!  ::)
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

Just for clarification... after the updated file is loaded it gets erased and the AP-16+ reboots itself to run the new code.  Since the program first looks for the update file, we have to get rid of it when it's loaded.

John and I are visiting our pals at Parallax tomorrow to show them the AP-16+ (since it uses their Propeller processor).
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Jon,
   Just to let ya know, and it's no big deal, I'm still getting an occasional repeat before all the SFX files are played. It doesn't happen often, but the gremlin is still there.

JonnyMac

Wow, that is a surprise because I found the cause of the bug and removed it.  I then created files with me saying the name, dropped them onto the SD card, and then ran dozens of tests to confirm that the repeat did not happen until all files for the SELECT switch setting were played.

Do you have sound-alike files?  This is what caused me to miss the gremlin in the first place.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

No, my wav files are all quite different. I had another weird thing happen the other day. At one point I removed all of the SFX files from the card and had three AUX files loaded, AUX01 thru AUX03. When I triggered the switch input, it would play AUX03. It did this several times in a row. Again, these are not big issues, as soon as I loaded some SFX files it worked fine again. I'm not complaining, I'm very happy with the AP-16+, just passing this along as an FYI.

JonnyMac

Today I added status reporting for locally started files -- I'll use this to keep track of files played (Prop-1 will stimulate START DC input then watch for file played).  During testing I found that if there were no AUX files an SFX file could play.  That is corrected.  That behavior might exist when things are the other way around so I will double check the start logic.  The fix for the first problem may solve what you've seen as I creates separate variables for sfx and aux selection, and strengthened the logic for check for valid files.

I have yet to get 1.03 to repeat a file before all are played for a group.  If there's any way to give me more specifics when you see this that will help me.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Jon,
    I may have been spending too many hours in my workshop. I believe you did indeed fix the random problem. Once all the files have been played the random selection starts over and sometimes makes it appear that a file is repeating.  ::)
I do have one other observation though, the labelling of the left and right channels on the board is reversed. I found this out when I created a couple of files to play on only one channel. They were created for right channel but play thru the left on the AP-16+. Again, no big deal.

JonnyMac

As a matter of fact the left-right switch IS a big deal.  We are using a module provided by Parallax that allows the audio to play cleanly; it may be swapping the channels and I can fix that.

I have a 1.04 in progress that causes the AP-16+ to report playing status of manually-started files; I will check the channel swap thing and include any changes in that update.

Thanks, Jack.
Jon McPhalen
EFX-TEK Hollywood Office