November 21, 2024, 05:05:23 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


AP-8+ Configuration

Started by JonnyMac, June 23, 2015, 12:57:58 PM

Previous topic - Next topic

JonnyMac

John B and I met a Disneyland for a meeting on Friday and he handed me the first prototypes of the AP-8+ Audio Player. I'll post actual photos later, but this is the layout of the board (uses our Prop-2/HC-8+ size format).



Based on our experience with the AP-16+, we are adding the ability for the user to configure the AP-8+ behavior in many key areas. For example:

1) You can assign file names for the positions (0..7) of the SELECT switch.
2) You can assign control port (CP0..CP3) outputs for controlling Amigo boards
3) You can assign a pre-delay (between trigger input and audio starting) for each file
4) You can assign a post-delay (between end of file and next possible trigger) for each file
5) You can assign the name of the ambient loop file
6) You can assign a post-delay for all files
7) You can switch the controller from 1-wire half-duplex serial to 2-wire serial (requires hardware mod on board)
8) You can override the serial baud rate

This is quite a handful of option and seems to hit the high spots. Here's an example from text that might be in the file AP8CFG.TXT which you put on the microSD card

' AP-8+ configuration file
' -- any line that beings with apostrophe is ignored
' -- comments may also appear at ends of lines

AMBIENT PLAY WIND                       ' use WIND.WAV for ambient loop

SELECT 0 PLAY WOLF                      ' play WOLF.WAV for position 0
SELECT 0 CPORT %0001                    ' activate CP0 while playing
SELECT 0 PRE 0.5                        ' wait 0.5 secs after trigger
SELECT 0 POST 5                         ' no new trigger for (at least) 5s

SELECT 1 PLAY LIGHTN~1.WAV              ' play LIGHTNING.WAV for position 1
SELECT 1 CPORT %0010                    ' activate CP1 while playing

THOLDOFF 10                             ' wait 10s before retrigger after last file

SERIAL MODE 1                           ' use 2-wire serial (requires board mod)
SERIAL BAUD 57_600                      ' override baud switch settings


Note that the PRE, POST, and THOLDOFF timing are expressed in seconds with a 0.1 second resolution.

We're very excited about a parsing module that we developed as it will allow us to add this kind of flexibility to any product with an SD card. What do you think?
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

June 23, 2015, 01:47:21 PM #1 Last Edit: June 23, 2015, 05:11:24 PM by JonnyMac
Did anyone catch how I sneaked a long filename into the mix? :)

It's a little tricky because the file system in the player can only see short filenames (8.3 format). And even with long file names, the file must be WAV format and have ".WAV" as the extension on the SD card (you don't have to use the .WAV part in the configuration file -- it is implicit in the the PLAY command).

Tip with long file names: Make sure that the first six characters of the name are unique (relative to the other names on the card). When a file is created with a long name, it also gets a short name that uses the first six characters, followed by a tilde, then a number (usually 1). In the example above:

LIGHTNING.WAV --> LIGHTN~1.WAV (to the AP-8+)

I'm working on a way of automating this process so you don't have to think about it, you can simply use LIGHTNING.WAV. Here's where that becomes a problem that will require your input.

LIGHTNING1.WAV
LIGHTNING2.WAV

Notice how the first six characters of these files are the same? What these will look like to the AP-8+ file system is:

LIGHTN~1.WAV
LIGHTN~2.WAV

Uh, oh. You can manually enter these short names into the configuration file and be fine. If you enter the long names there will be a possible conflict.

Again: Keep the first six characters of your long filenames unique. We can fix the above files like this:

1_LIGHTNING.WAV --> 1_LIGH~1.WAV (to the AP-8+)
2_LIGHTNING.WAV --> 2_LIGH~1.WAV
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Looks great Jon, a bunch of nice control options. Can't wait to test it out!  8)

JonnyMac

Do you have an HC-8+ with a microSD card, or a Propeller Activity Board from Parallax? If you do, I'll attach my test code for you to play with. Right now I've got all the features in the above list working; I have decided to add volume for the ambient track, and for individual tracks.

Here's the test file I'm working with at the moment while implementing volume controls by track

' AP-8+ configuration file
' -- any line that beings with apostrophe is ignored
' -- comments may also appear at ends of lines

AMBIENT PLAY WIND                       ' use WIND.WAV for ambient loop

AMBIENT VOLUME 25                       ' set left/right volume to 25%

SELECT 0 PLAY WOLF                      ' play WOLF.WAV for position 0
SELECT 0 CPORT %0001                    ' activate CP0 while playing
SELECT 0 PRE 0.5                        ' wait 0.5 secs after trigger
SELECT 0 POST 10                        ' no new trigger for 10s


SELECT 1 PLAY LIGHTNING                 ' play LIGHTNING.WAV for position 1
SELECT 1 CPORT %0010                    ' activate CP1 while playing

SELECT 3 PLAY JONNYMAC
SELECT 3 CPORT %1111

SELECT 3 VOLUME 100 0                   ' play only through LEFT speaker
SELECT 3 PRE 0.1
SELECT 3 POST 299.99                    ' rounds up to 300s (5m)

THOLDOFF 10                             ' wait 10s before retrigger after last file

SERIAL MODE 2                           ' use 2-wire serial (requires board mod)
SERIAL BAUD 57_600                      ' override baud switch settings


Note the highlighted lines. The VOLUME command takes one or two values (0 to 100); if only one value is specified it is used for both channels, otherwise the numbers are for left and right. Also note that you can specify a long filename. CAVEAT: This only works if the first six letters of your filenames are unique; the code creates short filename (first six letters + ~1) -- but if two long filenames have the same first six letters there will be a problem.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

I don't have a spare HC-8+ at the moment.  :(

JackMan

Any news on the release of the AP-8+?

JonnyMac

Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Just wondering if this is still gonna happen or did it get scrapped?

JonnyMac

Not scrapped; I have the latest PCB on my desk and am working on finalizing the code (amongst a 1000 other things on our plates at the moment).
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Hey Jon! Any word on this board? Will we be able to buy it before Halloween?

Thanks much
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

We had to make some hardware changes so we are dialing it in. Shame on me for breaking my own rule about not sharing something before it's ready to sell. I think, though, that everyone is going to like the configuration file (which will be ported to the AP-16+ as well).
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Quote from: JonnyMac on September 26, 2016, 06:46:33 AM
We had to make some hardware changes so we are dialing it in. Shame on me for breaking my own rule about not sharing something before it's ready to sell. I think, though, that everyone is going to like the configuration file (which will be ported to the AP-16+ as well).

Thanks for the update!!
Shawn
Scaring someone with a prop you built -- priceless!

livinlowe

I guess this board fell through? Was looking forward to it
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

November 22, 2018, 09:01:33 AM #13 Last Edit: November 22, 2018, 09:04:37 AM by JonnyMac
No, it didn't -- we've just been selling what we can build to OEMs. It will be released shortly.

We decided, for the moment, not to go with the [advanced] configuration described in this thread; we're starting more simply. The biggest issue for many was the restrictive naming convention SFX00.WAV, etc. With the AP-8+ (and next code rev of AP-16+) you can append a descriptor to the filename. So instead of:

SFX00.WAV

... you can have:

SFX00_MONSTER.WAV

This mechanism keeps the internal code simpler and allows you to reassign a file to the SELECT position of your choice by changing the number in the filename. The only restriction with this convention is that the normal description is preceded with an underscore, and is at least three characters long -- we don't think this will be a problem. There is a configuration file, but the initial version focuses on the assignment of outputs (there are four) to specific audio files.

This is what the current configuration file looks like:

' Configuration for EFX-TEK AP-8+
' -- matches internal default values

PRE 0 ' no delay after trigger (0..30s)
POST 0 ' no delay after file    (0..300s)


'                3210 ' control port (CPx) bits
'                ||||
CP_SFX00 %0001 ' when SFX00 plays
CP_SFX01 %0001 ' when SFX01 plays
CP_SFX02 %0001 ' when SFX02 plays
CP_SFX03 %0001 ' when SFX03 plays
CP_SFX04 %0001 ' when SFX04 plays
CP_SFX05 %0001 ' when SFX05 plays
CP_SFX06 %0001 ' when SFX06 plays
CP_SFX07 %0001 ' when SFX07 plays
CP_WAV %0001 ' when a remote WAV plays


What's nice about this is that you can decide which outputs are on (none to all four) for each audio track, or when a WAV is remotely commanded.

The AP-8+ doesn't have PRE and POST pots like the AP-8+, so we assign than in the configuration file.

Again, OEMs have been consuming these as fast as we can build them. I have a base file that I use for custom projects, and we will release that so that customers can build custom apps, too. There is only one [built-in] input channel, but the AP-8+ has an I2C port which opens up a bunch of interesting possibilities for inputs and outputs on custom apps. The outputs are 5V so you will need an Amigo board for some things, but if you're driving smart LEDs (like WS2812s or APA102Cs) you can connect them to the outputs (you may need a bigger 5v supply, depending on the number of LEDs).
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Shawn
Scaring someone with a prop you built -- priceless!