Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > NSF Importer v0.5 Owner: rainwarrior New post
Page 7 of 19 Sort: Goto Page: << Previous [1] [2] [3] ... [6] [7] [8] ... [17] [18] [19] Next >>
Posted: 2011-07-12 04:53  (Last Edited: 2011-07-12 04:56) Reply | Quote
TechEmporium

Avatar

Member for: 5942 days
Status: Offline

#19835
rainwarrior wrote:
What FamiTracker requires to play a DPCM sample is not as versatile as what the NES can do with it. Pitch, looping, and length are all independent things you could change without retriggering the sample.


Thanks for clarifying this.

Perhaps there is a way of stopping a looped sample from following through its normal course; one thing that FamiTracker technically should be doing when playing a looped sample is resetting the DPCM delta counter, once the sample has played through once & begins to play again (which results in a slight pop just before the sample is replayed).

If there were a way to track the point at which the delta counter resets before restarting the loop, then it could help in making an algorithm that detects the sudden change & plant a note-stop.

Now, the drastic problem that I can see with my rambling is this; how can the importer differentiate between the looped samples that you want to halt from those you don't want to halt... Again, since FamiTracker isn't exactly as versatile as the original hardware, there'd still be a problem due to the way it's programmed.

_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!

(Lousy modern technology! )
Posted: 2011-07-12 05:04  (Last Edited: 2011-07-12 05:46) Reply | Quote
rainwarrior

Avatar

Member for: 5607 days
Location: Canada
Status: Offline

#19836
Resetting the counter (i.e. Zxx) will only ever produce more pops, as it always creates an abrupt change of signal strength.

I'm not sure where you'd get a pop on a looped sample, actually, the counter stays where it is when the sample begins again. If the sample ends off-centre the first peak might clip a little, but it shouldn't pop.

The 6502 can be notified with an IRQ when the loop restarts, and you can write code to respond to it, but it's not really that useful a capability overall. (I'm not sure what you'd do with it.) Within the importer I can detect exactly where a loop happens, but it's not very useful either because I can only respond to things exactly on a frame (and the loop will happen somewhere between frames).

It might be neat if FamiTracker had a feature that let you set a loop point (that loops to beginning) and use note-release to turn off the loop and play to end, like this NSF. (Doesn't even require using the IRQ.)

Posted: 2011-07-12 06:02  (Last Edited: 2011-07-12 06:03) Reply | Quote
TechEmporium

Avatar

Member for: 5942 days
Status: Offline

#19839
Yes; I think we're on the same wavelength here (even though my rambling most likely sounds more confusing to everyone else, including you). Sometimes, I just don't know how to say things properly.

The delta counter doesn't only reset itself with the use of the Zxx command; there's also a reset that occurs naturally near the end of the loop, as the sample's actual volume approaches 0. Sure, I used the word "pop" instead of "click" or "clip," but essentially, there is an effect on the delta counter as the sample approaches the end of the loop.

Sadly, I don't see any attached NSF.

_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!

(Lousy modern technology! )
Posted: 2011-07-12 06:50 Reply | Quote
rainwarrior

Avatar

Member for: 5607 days
Location: Canada
Status: Offline

#19840
I meant like the mysong.nsf jrlepage posted.

The delta counter doesn't do anything special whena loop happens. At least, I haven't read any document or seen emulator code that would suggest this.

If you hear a pop it might be because the sample length has to be on a 128 sample boundary (16 bytes) and the end of your sample doesn't match where it was in the WAV, though it will be much duller pop than setting the counter would cause.


Also, on another note, there's some code in FamiTracker for setting and using a loop point (not in the way I described though; I don't see anything for release), but there doesn't seem to be any UI exposing it. Kind of interesting... maybe it's a planned feature.

Posted: 2011-07-12 07:46  (Last Edited: 2011-07-12 09:27) Reply | Quote
rainwarrior

Avatar

Member for: 5607 days
Location: Canada
Status: Offline

#19841
Also, regarding the triangle wave example, NotSo Fatso seems to read an extra byte at the end of the sample. I'm not sure if this is correct behaviour; the docs I can find seem to suggest that it is, but there is some ambiguity.

After looking at FamiTracker's source and output closely, I've noticed that FamiTracker actually loads this extra byte, but only plays one sample from it, so there is still one extra sample (instead of all 8 from the byte) happening per loop.

I could change it in NotSo Fatso but it wouldn't make any difference to the importer, since the actual sound output is irrelevant.

Has anyone tried that triangle DPCM example on real hardware? I'm interested in knowing what the correct behaviour is.


At any rate, looping DPCM seems to be pretty rare; it's problematic for a number of reasons, so maybe developers avoided it generally. (Actually, does anyone know any looping DPCM examples from a game NSF? I'm curious to see a "real" example.)

Posted: 2011-07-12 18:09  (Last Edited: 2011-07-12 18:16) Reply | Quote
Rushjet1
Moderator

Avatar

Member for: 6470 days
Location: Atlanta, GA
Status: Offline

#19850
Thought I'd try an old triangle-dpcm song of mine too. Seems to be fine.


Attachments:
singforabsolution.ftm (208 Kb)
Posted: 2011-07-13 02:31  (Last Edited: 2011-07-13 02:34) Reply | Quote
TechEmporium

Avatar

Member for: 5942 days
Status: Offline

#19864
But have you exported it to NSF & tried it on different players & emulators? And how about if the triangle samples were used with ppMCK; would that produce a different NSF?

That DPCM fault was something I've noticed since the triangle samples first surfaced here. I'm unsure if generating an NSF with the samples under ppMCK would make a difference, but I know for sure that the fault appears most noticeably in NSF players that use Blargg's engine; it not only plays as it otherwise would in NotSo Fatso (with an audible volume beat,) but Blargg's engine plays the triangle samples slightly detuned.

I just thought I'd highlight rainwarrior's findings when comparing FamiTracker's output to NotSo Fatso.

_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!

(Lousy modern technology! )
Posted: 2011-07-13 04:10 Reply | Quote
rainwarrior

Avatar

Member for: 5607 days
Location: Canada
Status: Offline

#19870
Rushjet1's singforabsolution.ftm uses long samples too, so looping/sample-length doesn't really show up as an issue anyway.

Posted: 2011-07-13 09:51 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 6440 days
Location: Canada
Status: Offline

#19882
How's the progress on the update? I'm especially awaiting the VRC7 note release bug fix and custom pattern length!

Posted: 2011-07-13 15:19  (Last Edited: 2011-07-13 16:06) Reply | Quote
bucky



Member for: 6952 days
Location: philly
Status: Offline

#19884
Thanks so much for making this! I always like learning more about NES sound design. I'll likely use this to make a handful of perfect recreations. I have 3 measures of Silver Surfer track 1 done so far: incomplete ftm

This is the best tool for analyzing NES music. I used to use nsfplay/plug slowed down x8 to try and look at things closely.

Regarding Wolverine, probably already said but it has no expansions. The nsf itself should be fixed first.

rainwarrior wrote:
Anyone know any original game NSFs with looping samples?

The Immortal is the only one I know of. Try track 2, for example. It should have a constant bass tone generated by a looped sample.


Posted: 2011-07-13 15:32  (Last Edited: 2011-07-13 17:24) Reply | Quote
bucky



Member for: 6952 days
Location: philly
Status: Offline

#19885
The sample in Final Fantasy 3, track 33 also doesn't load/ import. It should come in with the opening bassline. You won't hear it if you're using an nsf player that has some sort of DMC pop reducer enabled. It's not a looping sample like The Immortal, but it's another one that's very small in size.

(edit, not exactly true- read below!)


Attachments:
final_fantasy_3_1990square.nsf (56 Kb)
Posted: 2011-07-13 16:56  (Last Edited: 2011-07-13 16:57) Reply | Quote
rainwarrior

Avatar

Member for: 5607 days
Location: Canada
Status: Offline

#19888
Thanks for the examples, bucky.

Immortal is a neat example. It imports fine, but FamiTracker doesn't play it back at the right pitch (this is a looping sample length issue with FamiTracker, see the thread in bug reports); but export to NSF again and it'll sound fine in other emulators.

Final Fantasy 3 Track 33 is using direct writes (Zxx), not the DPCM. The next version will pick up the writes, but can only set one Zxx value per frame, so it doesn't actually make up a sound in the import. (Yeah, it kind of is like a very short raw PCM.) You'll see them visually as Zxx effects though.

Posted: 2011-07-13 17:16 Reply | Quote
bucky



Member for: 6952 days
Location: philly
Status: Offline

#19889
Ah, cool. Good to know!

That explains a lot with Final Fantasy 3. I was wondering why I couldn't find the 'sample' with jsr's nsf live. Do you know of other games that use direct writes similarly to FF3?

Posted: 2011-07-13 17:48  (Last Edited: 2011-07-13 18:13) Reply | Quote
rainwarrior

Avatar

Member for: 5607 days
Location: Canada
Status: Offline

#19891
On page 6 of this thread there's a very similar example that actually mixes a popping rhythm via volume writes with an already playing DPCM sample (mysong.nsf). Rather advanced use of the channel. I commented on it there. This is not an original game though.

Some games do a Zxx at the start of every DPCM sample (Akumajou Densetsu, TMNT2), though I personally feel this is bad practice; better to let the output level float and clip the first peak than introduce a pop.

There are games that play raw PCM samples this way (which I can't support in FamiTracker); BattleToads' title screen, for instance.


You can get an effect very much like what FF3 is doing in FamiTracker by placing alternately Z00 and Z7F on the rows where you want pops to appear. (Or other values if you want quieter pops.)

Posted: 2011-07-15 08:58 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 6440 days
Location: Canada
Status: Offline

#19956
Do you have an ETA for the update yet?

Page 7 of 19 Sort: Goto Page: << Previous [1] [2] [3] ... [6] [7] [8] ... [17] [18] [19] Next >>