Page 4 of 5

Posted: Sun Mar 29, 2009 12:27 am
by Memblers
CKY-2K/Clay Man wrote:
smkd wrote:I used sox to make some 4011 playback roms. i converted some wavs to raw 8bit because i remember i had some trouble getting it to output just 7bit. no problem though, just right shifted it before the write.

http://sox.sourceforge.net/
how'd you do that?
A single LSR instruction will do it. Probably cutting the volume in half on an 8-bit sample would do it too.

Posted: Sun Mar 29, 2009 12:30 am
by smkd
for sox i just used something like:
sox -V in.wav -r 8000 -u -b8 -c1 out.raw
which saves to raw mono unsigned 8bit pcm suitable for playback at 8khz. like in audition there is no 7bit option from what i saw. for saving at raw 8bit it's not a big deal since it's just a divide by two to get it to 7bits, whether you have a little program to do that for you or if you just do it on the NES before sending it to 4011.

Posted: Sun Mar 29, 2009 1:14 am
by frantik
Memblers wrote:Probably cutting the volume in half on an 8-bit sample would do it too.
that will get you half way there.. you also have to adjust the offset

Posted: Sun Mar 29, 2009 11:15 pm
by AWal
I took the hard way and wrote some QBasic code to pre-shift a raw audio clip. Kinda sketchy but got the point across and seems to run on the real thing just fine.

Available here:

mediafire.com/awal browse to NGGYU Instrumental.zip

Posted: Mon Mar 30, 2009 5:25 am
by koitsu
AWal wrote:... wrote some QBasic code ...
???????????????????????????????

Posted: Mon Mar 30, 2009 4:40 pm
by Jarhmander
koitsu wrote:
AWal wrote:... wrote some QBasic code ...
???????????????????????????????
PROFIT!!!

Posted: Mon Mar 30, 2009 6:43 pm
by Banshaku
koitsu wrote:
AWal wrote:... wrote some QBasic code ...
???????????????????????????????
I guess that any programming language/tool, as long as you reach your goal, is fine :)

I remember using qbasic when I started programming (gwbasic and commodore basic too). I just keep a copy for nostalgia only.

Posted: Tue Mar 31, 2009 2:34 pm
by AWal
...I knew that would happen...I use it for file op's because my C++ skills are shot in that department...It does get the job done though...If you think that's bad you probably haven't heard of MPGRAPE...

Posted: Tue Mar 31, 2009 4:32 pm
by frantik
here's a php version :D

Code: Select all

<?php

$wav = file_get_contents('wavefile.raw');
$len = strlen($wav);
$newwav = '';

for ($i = 0; $i < $len; $i++)
{	$newwav .= chr( ord(substr($wav,$i,1)) >> 1 );
}

file_put_contents('newwave.raw', $newwav);

?>
or change the code to use .wav files with a standard header

Code: Select all

$newwav = substr($wav, 0, 0x2C);

for ($i = 0x2C; $i < $len; $i++)

Posted: Tue Mar 31, 2009 7:16 pm
by Banshaku
AWal wrote:...I knew that would happen...I use it for file op's because my C++ skills are shot in that department...It does get the job done though...If you think that's bad you probably haven't heard of MPGRAPE...
Nothing wrong with that. You got the job done and that what is important. You can always port it back to C++ once you remember how to do IO again.

For what you mentioned, never heard of it. (Offtopic->) One that I learn at college long time go was called RPG 4 by IBM, for mainframe.. Just imagine writting code similar to assembler but for... making reports :P

Posted: Fri Apr 03, 2009 10:46 am
by AWal
frantik wrote:$wav = file_get_contents('wavefile.raw');
$len = strlen($wav);
$newwav = '';
It all makes sence...and thanks for that...honestly, I avoided having a larger buffer due to some PITA issues with too large a buffer (I seem to remember a 2KByte buffer working fine with PDS), and I couldn't load the entire file into a single variable, hence a 1Byte buffer :?.

whooooooaaaaaaaaaaaaaaaaahhhhhhh

Posted: Fri Mar 11, 2011 4:47 pm
by johannesmutlu
i tested this demo on my nes powerpak to confirm that it can run on true hardware and not on overpowered emulators,but yes it works.
the looped sample of rick rolf with never let you down is just simply amezing,i dit believe that i was dreaming.
just imagine how infemouse and rare the pcm channel reallly is especially in older gameconsoles,early nes games never maked use of it at alll,i had even readed somewhere that nintendo never had intended to put a pcm channel in their nes rather then fm channels,but that somehow a pcm channel just become possible trrough a discovered trick,not sure if that,s true???
,m mean the fact that the nes can handle samples at 7bits that really blows my miind wich is even better then the 4bit audio you hear in airplanes nasa rockets,millitair airplanes,mobilephones,voice recorder.
it even comes close in quality to the 1 8bit genesis and 1 8bit gba dac,s audio just absolutely amezing!!!!!
now imagine if we can split a hole song in sections and play them one after another trough bankswitching to overcome the limmited memory space.
it would be awesome to listen to craig david music on the nes hey hey!!!

Re: whooooooaaaaaaaaaaaaaaaaahhhhhhh

Posted: Fri Mar 11, 2011 4:52 pm
by tepples
johannesmutlu wrote:just imagine how infemouse and rare the pcm channel reallly is especially in older gameconsoles,early nes games never maked use of it at alll
That's because it requires a lot of ROM space, which was expensive back then.
i had even readed somewhere that nintendo never had intended to put a pcm channel in their nes rather then fm channels
Then explain Kung Fu, Duck Hunt, and a couple other NROM games that used occasional DPCM samples.
the fact that the nes can handle samples at 7bits that really blows my miind wich is even better then the 4bit audio you hear in [...]
A lot of the 4-bit-per-sample applications are actually using ADPCM, which save space by only storing differences from one sample to the next. I've written an ADPCM demo that sounds almost as good as the Rick Roll demo.
now imagine if we can split a hole song in sections and play them one after another trough bankswitching to overcome the limmited memory space.
That would take a lot of CPU time, and doing it while running a game would need some sort of timer to make interrupts.

Posted: Mon Mar 14, 2011 4:52 am
by frantik
as far as the audio quality, i spent a lot of time tweaking the audio, eqing, compressing, etc to make sure it sounded as good as possible even at low bit rates

i was helped by the fact the song is a pop song so it's "loud" all the way through

someone hacked my demo and made a "birthday card" rom for his wife and asked me to put in some different music. the music was just a vocal with lots of silence and it didnt sound nearly as good.. lots of hiss and whatnot

and yeah ive tested it on my power pak and it works fine. coinheaven even put it on a repro cart and it worked. there was a small difference between the power pak and repro carts though.. i guess i didn't initialize the mapper correctly so the song starts at a random place (which is at the beginning of a bank) on the repro cart but always starts at the beginning on the powerpak and all emulators ive tried

Posted: Mon Mar 14, 2011 6:29 pm
by Kasumi
I didn't even notice it didn't start at the same place when I put my hack of it on a repropak, but I guess it wasn't in my hands for very long. I realize now I never showed the result after asking for permission to use it. PM me if you're interested.