Playing Wav files...
cavelamb
Posts: 720
It didn't work Saturday.
Then this morning I had an idea and rebuilt the audio output circuit - and it worked as advertised.
I'm using Ray Allen's 8 bit wav player from the OBX and playing the Microsoft Windows sign-on music
that was included in the example. That's about 3 or 4 seconds or so long?
But Ray jumps over the header and say "so you better have the right format!"
Sounds like good advice, but what format is that????
Anyway, it runs from EEPROM, so now when it powers up it makes "real" computer sound -
then goes and blinks it's LED. Some habits are had to break...
Great big sound - from a tiny little computer.
Looking forward to getting the Ships' Bell Dinger digitized next.
Ray? You out there?
Then this morning I had an idea and rebuilt the audio output circuit - and it worked as advertised.
I'm using Ray Allen's 8 bit wav player from the OBX and playing the Microsoft Windows sign-on music
that was included in the example. That's about 3 or 4 seconds or so long?
But Ray jumps over the header and say "so you better have the right format!"
Sounds like good advice, but what format is that????
Anyway, it runs from EEPROM, so now when it powers up it makes "real" computer sound -
then goes and blinks it's LED. Some habits are had to break...
Great big sound - from a tiny little computer.
Looking forward to getting the Ships' Bell Dinger digitized next.
Ray? You out there?
Comments
-- http://forums.parallax.com/showthread.php?123900-EFX-TEK-shows-the-Propeller-AP-16-WAV-Audio-Player-at-Parallax-wow!
[Edit] I should have qualified that: it's if you want to start playing WAV files (stereo, up to 44.1kHz) from an SD card.
The format for playing from HUB RAM (loaded from eeprom) is:
8-bit PCM mono 16000 or 8000 sample/second WAV
At least it's better than the "Propeller standard" of 1.6 kHz. (all Parallax boards uses it.... argh..)
/Johannes
Thank you, Rayman! That's the info I needed to digitize my bell.
Jakak, Ahle2i:
While the SD card suggestion sounds plausable, the extra load on the battery isn't.
And that's part of the project spec - to be portable and self contained - battery powered.
Managing power will be one of the bigger headaches - er Challenges? - in this project.
Turn off audio amp power when not needed, and even see if I can put the CPU to sleep (sort of)
to help extend battery life.
The RTC has it's own battery support and it will run for ages.
But I don't (yet) see a way to have the RTC alarm power up the Propeller, et al.
Working on it though.
JonnyMac:
Thanks for that link.
That's pretty much what I'm trying to do as well.
And to all who donate their work to the OBX - you guys make it possible for us newbies.
BIG thanks
Richard
Johannes,
What values do you suggest?
And if you want to get true eight bit and sixteen bit sounds, programs like Raster music maker and VGM music maker are free to download and can export .wav files. But you wuld need to use an sd card, because even short ones average 1mb....
The whole tune takes 1.4 kB and that includes both instrument and music data.
After some optimizations Retronitus now has got almost twice the sample rate of CD audio.
/Johannes
@Ahle2, have you ever thought of making a pokey cog emulator?
Anyway Richard I think you just ran into the house all excited and out of breath "it didn't work this morning" because you didn't give us any of the details that you now have since you have your breath back. I suppose you may have another thread somewhere but I'm not familiar with it.
It WAS pretty exciting when it actually made music.
The project is a Ships Bell Clock. It dings the bell every half hour, but in a traditional nautical pattern.
I'm a sailor and like the bells. It marks the passage of time through he day, kinda like a grandfather clock does.
I have a ships bell simulator on my desk computer. I thought I'd try to make a portable version that I could
take out on the boat as well. That's actually how I came to meet the Propeller. Can you imagine trying to
play sounds like that on a PIC?
So, I ordered a couple of Propeller boards and a couple of real time clock boards and sat down to make
that "I wish I had a" daydream come true.
At first I wasn't sure that the prop could do it all by itself, but now I'm convinced it can.
The SD card keeps getting better and better! I had no idea it went to sleep.
As for the Propeller, in this project it doesn't do anything most of the time -
only twice and hour for a few seconds.
Most logic chips use more power when they run faster. And they use more power
when more transistors are flippin' on and off.
So I was thinking of 1) running as slow as possible until time to go to work.
It will evolve, I'm sure...
Just takes time.
and 2) maybe do a long series of waitCnts (29.9 minutes worth) until a few seconds before the mark.
Then check the RTC until time to ding, and take a nap again.
Thou shalt not covet thy neighbor's scope...
The waveform below is a double stroke bell - and although only 27K bytes, it sounds great.
I thought I'd try to skip past the first ding to the start of the second ding to play a single stroke.
(for those unfamiliar with nautical bells they come in patterns of one or two strokes)
Thereby getting both of the necessary sounds from a single data set.
Two problems with that though...
1) 27Kb doesn't leave much room in 32kb EEPROM for code.
2) While it sounds fine on the PC, it doesn't play on the propeller.
I'm going to need sharper tools for converting wav files to something usable.
Or maybe look at MP3 players.
But either way, it's going to need more storage space.
The Propeller Platform from Gangster Gadgets has a micro SD socket already on board, so
that's the one I'm using now.
I forgot what's it called, I think like VIZ media player or something, but converts any kind of playabe music or video file into any other kind of music file imaginable!
Retronitus uses "every trick in the book" and relies on both the strength and limitations of the Propeller to achieve good results without "eating cycles for breakfast"... The end result is high sample rate and low aliasing distortion.
(^_−)−☆ apologies for confusion.....
Well, the Pokey is an interesting and relatively simple sound chip to emulate. It's an excellent chip for sound effects.
The problem is that it only has got an 8bit frequency register per channel and that will make everything sound out of tune.
So for music it isn't very pleasant to listen to.
What are we looking at on the 'scope? There are two traces, but with some kind of chopping.
It's remarkable sound. Still wondering how you did it! My son who has much more of a musical ear than I do, discerned 4 sections of 4 bars each in the loop. Is that right?
Why not just desolder the EEPROM and replace it with a much larger EEPROM that is still compatible with the propeller's boot logic? ... or put a second EEPROM on the same i2c pins as the 'boot' EEPROM?
An EEPROM is a whole lot cheaper than an SD card and socket.