It is currently Mon Jul 15, 2019 11:22 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Sun Mar 29, 2009 12:27 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3697
Location: Indianapolis
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 29, 2009 12:30 am 
Offline

Joined: Sun Apr 22, 2007 6:07 am
Posts: 101
for sox i just used something like:

Quote:
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 29, 2009 1:14 am 
Offline

Joined: Tue Mar 03, 2009 3:56 pm
Posts: 316
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 29, 2009 11:15 pm 
Offline
User avatar

Joined: Wed Oct 06, 2004 8:00 am
Posts: 132
Location: Northern New York
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 5:25 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4146
Location: A world gone mad
AWal wrote:
... wrote some QBasic code ...


???????????????????????????????


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 4:40 pm 
Offline
Formerly ~J-@D!~
User avatar

Joined: Sun Mar 12, 2006 12:36 am
Posts: 488
Location: Rive nord de Montréal
koitsu wrote:
AWal wrote:
... wrote some QBasic code ...


???????????????????????????????

PROFIT!!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 6:43 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2303
Location: Fukuoka, Japan
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 2:34 pm 
Offline
User avatar

Joined: Wed Oct 06, 2004 8:00 am
Posts: 132
Location: Northern New York
...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...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 4:32 pm 
Offline

Joined: Tue Mar 03, 2009 3:56 pm
Posts: 316
here's a php version :D

Code:
<?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:
$newwav = substr($wav, 0, 0x2C);

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 7:16 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2303
Location: Fukuoka, Japan
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 10:46 am 
Offline
User avatar

Joined: Wed Oct 06, 2004 8:00 am
Posts: 132
Location: Northern New York
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 :?.


Top
 Profile  
 
PostPosted: Fri Mar 11, 2011 4:47 pm 
Offline

Joined: Fri Mar 11, 2011 2:22 pm
Posts: 26
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!!!


Top
 Profile  
 
PostPosted: Fri Mar 11, 2011 4:52 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21500
Location: NE Indiana, USA (NTSC)
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.

Quote:
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.

Quote:
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.

Quote:
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2011 4:52 am 
Offline

Joined: Tue Mar 03, 2009 3:56 pm
Posts: 316
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2011 6:29 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1288
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group