It is currently Wed May 22, 2019 3:39 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Wed Jul 18, 2012 2:13 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7711
Location: Chexbres, VD, Switzerland
Oh this clear things up so they'll be running at almost the same frequency.

I think a 5 cent detune between channels would not have any negative effects on music on the other side it could make it sound better.
It's a very common method on the NES to detune slightly Square 1 and Square 2 channels.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2012 3:10 pm 
Offline

Joined: Thu Apr 14, 2011 9:27 pm
Posts: 85
I have a few VRC7 test roms if anyone wants to record them on real hardware. (They're Famitracker files exported to NSF and then compiled with the Vegaplay NSF engine with the actual menu disabled.)

https://dl.dropbox.com/u/26864173/vrc7.rar

None of these work in Nintendulator, probably banking issues.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2012 5:15 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7461
Location: Canada
Grapeshot, FYI, Famitracker had a bug (until yesterday) in the VRC7 driver code that prevents it from playing properly on hardware. The code that updates the instrument registers was failing to delay between writes.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 19, 2012 11:07 am 
Offline

Joined: Wed Apr 04, 2012 2:15 am
Posts: 24
Grapeshot wrote:
I have a few VRC7 test roms if anyone wants to record them on real hardware. (They're Famitracker files exported to NSF and then compiled with the Vegaplay NSF engine with the actual menu disabled.)

https://dl.dropbox.com/u/26864173/vrc7.rar

None of these work in Nintendulator, probably banking issues.

I'd love to test those for you, but I have 2 problems:

a) I can only play NSFs on hardware (with the TNS-HFC3),
b) Those files won't play properly unless you re-export to NSF using the current 0.3.8 beta (as rainwarrior said),


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2012 7:46 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7461
Location: Canada
Alright, I've had some time to get my CopyNES working, and I can now use the VRC7 tuner program with my Lagrange Point cart.

I'm currently going over the patch set; probably in a week or two I'll have a slightly more refined version of the set by quietust that most emulators currently use.

Update: did patch 1 so far, keeping a WIP version here: http://code.google.com/p/usbcopynesblue/source/browse/trunk/bin/PRG/rainwarrior.vrc7

(Also there were bugs in the USB CopyNES VRC7 tuner; I almost lost my work on the patch when the save function didn't work! I wonder if anyone has actually used this program in the past few years...)

vrc7_testing_0.jpg (dropbox link removed, image lost)
vrc7_testing_1.jpg (dropbox link removed, image lost)


Last edited by rainwarrior on Mon Aug 07, 2017 3:08 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 01, 2012 12:53 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7461
Location: Canada
I've finished tweaking my patch set. My results are here:

http://nesdev.com/bbs/viewtopic.php?p=97361


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 02, 2012 11:56 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7461
Location: Canada
I'm curious about the relationship between 1<<23 and 48db. By my reasoning, 48db = 10 ^ (48 / 10) = ~63096 which would suggest 16 bits of precision to me, not 23. Could you explain your reasoning?

The channels are output in series, according to the Yamaha datasheet, though the diagram shows them unevenly clustered in groups of 3; it's kind of unclear about the actual timing output. As you said this is not significant if trying to emulate the audio, since the consequences are above the audible frequency range.

A note about note-off for "percussive" envelopes; if the sustain flag is off for the envelope, note-off appears to generate a release equivalent to a release setting of 7. You mentioned this in your notes (based on emu2413.c?), and I had noticed/verified this independently when testing the hardware patches, but I can't seem to find this described in the YM2413 datasheet. The only thing I found was a little line on the percussive envelope diagram showing a faster release.

One more note that I'm sure must be borne out by the formulae in your description, but I think is worth saying explicitly, is the relationship between the sustain level (4-bit value) and output level (6-bit value) of the modulator. These have an exact 4:1 ratio, i.e. ignoring the attack, +1 to the sustain level is equivalent to +4 to the modulator output level. This was an extremely important property to know when trying to tweak the patches, because if I need to increase the effect of the attack, I can put -1 on the sustain value and +4 on the modulator output, resulting in the exact same effective sustain level, but now the attack level goes higher because I increased the modulator output.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 02, 2012 1:03 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21392
Location: NE Indiana, USA (NTSC)
Assuming constant impedance, doubling the voltage implies doubling the current, which quadruples the output power, and quadruple the power means about 6 dB more. Thus 48 dB is 48 / 6 = 8 doublings.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 02, 2012 1:55 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7461
Location: Canada
Hmm, actually that makes sense, since I'm used to 16-bit audio programs telling me it has a 96db noise floor. Thanks for straightening that out.

So, does this mean the envelope only has 8 bits of precision? Even if they happen to distributed logarithmically during amplification, that seems low... but maybe not.

I've got a fair bit of hardware testing ahead of me to figure these things out.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 02, 2012 1:56 pm 
Offline

Joined: Thu Apr 14, 2011 9:27 pm
Posts: 85
He's just using 23 bits for the envelope attenuation value because on the lowest envelope speed the envelope will change by one LSB every time it's clocked (so a separate divider isn't needed for low rates).

According to the SpritesMind forums, who have decapped and studied a YM2612, the envelope generator output is actually 9 bits which is then shifted to produce a 12 bit (plus sign bit) attenuation value. The actual attenuation value table in the chip, which has been extracted as well, works with 1<<12 = 48db of attenuation. So to be accurate, only the high 9 bits of the envelope generator output should be considered.


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 9:16 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7461
Location: Canada
Grapeshot, that's very interesting. Do you have a link you could share where this information is gathered?


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 9:36 pm 
Offline

Joined: Thu Apr 14, 2011 9:27 pm
Posts: 85
I posted it on the previous page, actually, but I don't blame you for not wanting to read a 40 page thread for relevant info.

Here's the important diagram for the envelope bit widths.
http://nemesis.hacking-cult.org/MegaDri ... erator.png

The only thing about this image is that is probably not correct for the YM2413 or the VRC7 is the DAC at the end. Elsewhere in the thread it's determined that the DAC used on the YM2413 is an 8 bit linear resistor ladder which connects the output pin to VCC or GND depending on the sign bit. (Some variants of the Genesis sound chip use this DAC and some use a completely different design, which is one of the reasons Genesis sound quality varied so much between models.)

e: Another thing that is missing in Disch's documentation is the fact that the attack portion of the envelope increases exponentially, not linearly. This is mentioned in the OPLL programmer's manual, but the actual method of calculating it is mentioned in a patent and discussed at http://gendev.spritesmind.net/forum/vie ... ope+attack as well as in that other thread.


Top
 Profile  
 
PostPosted: Fri Aug 03, 2012 12:04 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7461
Location: Canada
Ah, I missed them on the first page. Thanks for the links; this will be good reading...


Top
 Profile  
 
PostPosted: Thu Apr 11, 2019 3:36 pm 
Offline

Joined: Fri Dec 08, 2017 5:12 pm
Posts: 32
Disch wrote:
**** SIDE NOTE ****
Writing to Regs R:00 through R:07 do NOT seem to have an immediate effect on channels using
instrument 0. Lagrange Point (Track 2 of the NSF) will write to these regs while a channel
using instrument 0 is still keyed on and audible, resulting in an ugly and very noticable
"blurp" noise at the end of a note. This is not heard on the real hardware, so instrument
data must be cached somehow. Perhaps it only takes effect when the channel is keyed on,
or when R:3x is written to? Don't know exactly.

Does anyone have any more information on this?
Do the six channels each have a copy of their active instrument patch? If so, when does it get updated?

Possible tests:
- Set up custom patch (preferably with long sustain)
- Set a channel to use the custom patch
- Change custom patch
- Does sound change here?
- Write note on R:2x.
- Does sound change here?
- Write note off R:2x.
- Write note on R:2x.
- Does sound change here?
- Write R:3x to resend instrument.
- Does sound change here?
- Write note off then on R:2x.
- Does sound change here?

Anything else I missed?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 13 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