November 24, 2024, 04:03:21 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


AP-16 feature request

Started by davisgraveyard, July 07, 2011, 08:54:07 PM

Previous topic - Next topic

davisgraveyard

I would love to be able to play 2 separate mono WAV files at the same time out the left and right channels.   Currently the way to do this is create a stereo WAV file and put the each mono WAV file on each track.  The only problem with this is if the WAV files are not the same length the shorter of the two must be replicated in the WAV file so it is the same length as the longer one.   

Ideally it would be nice if the files could be named so that at power up they would automatically start playing out the correct channel.

In previous conversations I believe that this is possible but the issue comes when trying to open more than one file with the current code.   How far away are we from having an option like this if at all?   I'm going to convert from a Windows PC running a 8 channel surround audio card and playing a single 6 channel WAV file using Windows Media Player to 3 AP-16's with separate WAV files on each SD card.  Right now I will have to create Stereo WAV files for each effect on each AP-16 but am just wondering if I can just split my WAV file into separate mono WAV files this year?



JonnyMac

That may never be possible with the AP-16+, but if things change we'll attempt it.  The reason is that the SD card driver for the Propeller chip supports one open file at a time.  Another issue is that another cog would be required to fill the buffers and we're running short of cogs with everything happening now.

The *problem* we embedded developers face is that this stuff is trivial on a PC hence the expectation is that it should be possible everywhere else.  As my friends in the Dallas Personal Robotics Group often remind us, "It's harder than it looks."

FWIW, I have put in a request to Parallax to write a better SD card driver that supports multiple open files without using additional cogs.  They say they will, but don't have the time to write that code immediately.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

What about some sort of brute force method?   IF I have 2 30 second sound effects what if I broke them down into smaller files and had the system play them one right after another.  If the WAV files only had data on a specific channel wouldn't it sound like 2 separate sounds were coming out both channels? Or is the delay way too slow?


JonnyMac

You could probably pull it off using parallel outputs and the AUX inputs; the AUX inputs have only a 1ms delay (the ear cannot detect) when going from one to another.

Or, you could try to sync using a serial signal.  I just did that on a big "Hollywood" job that uses a Prop-2 and an AP-16+ in a huge prop for a gaming company.  Have a look at the video on this page:

www.firefallthegame.com

Steve Wang (creator of the Predator and many other cool movie creatures) was contracted to build a display that has the male (Typhoon) and female (Morningstar) characters, as well as a full-sized "thumper."  I wish I could post pictures but I'm not at liberty at this time -- I will as soon as I can.  The character work (which uses the Propeller Platform from my N&V for lighting) is astounding: full silicon skin work with glass eyes and hand-punched hair.  They look amazing -- and I got to light them!

The thumper mechanics lift and drop a "hammer."  I had to sync the audio command with the input from a sensor so that the sound effect track playing from the AP-16+ matched the actual device.  It turned out to be really cool -- the bounce of the physical device matches the audio bounce in the sound track.  Here's how I look for the switch input and and pad before sending the audio command:

Trigger_Wait:
  PAUSE 1
  IF (Trigger = IsOff) THEN Trigger_Wait

  ' sync and play sound fx

  PAUSE 125                                             ' pad for sync with thumper
  SEROUT Sio, Baud, ["!AP16", %00, "PS", 4, 1]          ' thud, wind-up


It's a little "brute force" but it does work -- you can try this approach if you want to use a serial command.
Jon McPhalen
EFX-TEK Hollywood Office

JesusFreak1959

Quote from: JonnyMac on July 07, 2011, 09:47:13 PM
That may never be possible with the AP-16+, but if things change we'll attempt it.  The reason is that the SD card driver for the Propeller chip supports one open file at a time.  Another issue is that another cog would be required to fill the buffers and we're running short of cogs with everything happening now.

FWIW, I have put in a request to Parallax to write a better SD card driver that supports multiple open files without using additional cogs.  They say they will, but don't have the time to write that code immediately
.

I may be speaking in ignorance, as I am just coming up to speed on the AP-16, but another reason to get more than one file playing at a time is so the AMBIENT.WAV file can keep playing while an SFX(NN).WAV file is played.  This appears to be a significant limitation to an otherwise great sound card.

JonnyMac

Quotea significant limitation

Are you aware of any product remotely close in price that offers playback of multiple files?  We're not.  It's a serious horsepower issue and may in fact require a small embedded PC to pull it off. 
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

July 17, 2011, 11:03:24 PM #6 Last Edit: July 17, 2011, 11:10:03 PM by bsnut
It's fine that you are coming up to speed. This a great board that puts out alot of sound and heard for myself at the MWHC this year. Jon and JB put alot hard work into this board to give us the sounds that I'm looking for in my haunts.
William Stefan
The Basic Stamp Nut

JesusFreak1959

July 19, 2011, 11:42:38 AM #7 Last Edit: July 19, 2011, 12:38:13 PM by JesusFreak1959
Quote from: JonnyMac on July 17, 2011, 10:39:47 PM
Quotea significant limitation

Are you aware of any product remotely close in price that offers playback of multiple files?  We're not.  It's a serious horsepower issue and may in fact require a small embedded PC to pull it off.

Easy there Mr Mac... I thought we were discussing feature requests on this thread, not defending why the board works the way it does.  It is an impressive board, yes, and I confess ignorance.  I am new to this area of audio, but not new to digital audio.  Back in the late 1980's when game development audio state-of-the-art was the PC speaker making beeps, audio engineers/sound designers worked with hardware developers to push things forward.  Creative Labs and others were very responsive to game developer requests.  If this thread encourages good ideas to come forward, the LBE industry and others can keep moving foward too.

Along those lines, I know that restricting file names to DOS's 8.3 format makes for easier/tighter programming, but it makes for lousy file housekeeping.  By the end of the Halloween/Christmas season, I've created hundreds of new files.  Over the decades, I've gotten pretty good at self-describing file names, albeit, long ones.  8.3 sends me back to having to use cumbersome folder structures and/or Excel spreadsheets.

Again, the nature of a (feature) request is that it can be accepted or declined.  I'd be interested in hearing what others think.

JonnyMac

July 19, 2011, 12:14:36 PM #8 Last Edit: July 19, 2011, 12:25:08 PM by JonnyMac
QuoteEasy there Mr Mac... I thought we were discussing feature requests on this thread, not defending why the board works the way it does.

There is no unease.  There is, however, a responsibility to EFX-TEK for me to prevent [admittedly] ignorant suggestions from becoming run-away criticisms of our products.

1) I simply answered your question with what I thought was a reasonable question.  You suggest that the single-file only capability is a "significant limitation" of the product as if all others in our category are doing it.  In fact, nobody is (at or anywhere remotely near the AP-16+ price point).  Please understand that if the AP-16+ could play simultaneous files it would be doing so now -- WE want that feature.  That's not to say that it won't in the future; we are waiting on a better SD driver from Parallax before we can try.  Even then, there may not be enough horsepower to simultaneously buffer, mix, and play back multiple files; we're using a microcontroller with very small memory vis-a-vis even old generation computers.  Again, we won't know that until we have a driver than can access two files at the same time.

2) As to the 8.3 filename convention; again, not our choice.  Microsoft has a patent on long file names hence the SD card driver available for the Propeller does not support them. Doing so would require EFX-TEK and any other company producing a product using that driver to pay licensing fees to Microsoft.  This is the reason we don't use MP3: it requires a hardware decoder and a chunk of that cost goes to licensing fees.  These fees necessarily drive up the product price and something that we are keenly aware of is the price-sensitivity of the markets we serve.

The AP-16+ (as with all EFX-TEK products) is not right for everybody -- only you can make that determination, and some of its restrictions may cause you to look elsewhere; we accept and understand that.  We can only give (and do now) our best hoping that our best efforts will match most customer desires and requirements.  If you look at the history of EFX-TEK and the AP-16+ (which can be updated by dropping a file onto the SD card), I think it's fair to say that we have been very responsive to customer requests when they could be folded into the product -- even when we first thought they couldn't.

In another thread you'll find that I suggested a request (by our friend, JackMan) would be problematic to implement.  Still, the very next day while having my customary turkey sandwich for lunch I gave it a try -- and I made it work (independent relay control by file).   That code was updated a tad and is available as beta 1.80.  We're adding some additional file checking features to it before final release.

Jon McPhalen
EFX-TEK Hollywood Office

JesusFreak1959

Thanks for the details on the whys of the AP16's architecture.  Currently we use MP3 players in our buildings for ambient tracks and have AP8's for prop SFX.  Now that we are moving everything over to AP16's, I was just dreaming of the possibilities and got a rude awakening at the single file playback and 8.3 limitations.  I seem to remember the irony of MS owning the patent on long file names.  Something Apple users enjoyed long before us PC kids ever did.  I think you need to patent your turkey sandwich before Gates does.  Perhaps there's some sort of technological ether created that is conducive to problem solving?

JonnyMac

Quote...and got a rude awakening at the single file playback and 8.3 limitations.

Sorry, but the way you put that statement compels me to ask again: Are you aware of a product in the AP-16's category that in fact offers multi-file playback?  I'm not trying to be snippy, I'm looking to see where others have succeeded and what I might learn from their success.

I just confirmed with a friend who has used the MP3 decoder hardware in a personal project that those chips are not capable of playing simultaneous streams.  If your MP3 players can play two files at the same time they are using two chips.   Yes, we could do this but then we'd suffer a cost increase and a decrease in responsiveness (when using MP3s; WAVs are not compressed, hence play right now).  Even Gilderfluke recommends using WAVs in its audio repeaters when immediate response from stimulus is required.
Jon McPhalen
EFX-TEK Hollywood Office