DPCM playback at different pitch

General discussion about chipsounds

Moderators: eric_telemaque, davidv, seb@plogue

Tansunn
Posts: 17
Joined: Tue Oct 20, 2009 11:02 am

DPCM playback at different pitch

Postby Tansunn » Fri Apr 01, 2011 9:31 pm

Is it possible to configure DPCM samples to play back at different pitches? For example, if you listen to the Desert world music from Super Mario Bros. 3, there's an electronic tom sample being played at two separate frequencies. Is there any way to configure this in Chipsounds or does it need a new sample for each note?

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Re: DPCM playback at different pitch

Postby davidv » Sat Apr 02, 2011 7:57 am

DPCM on the NES 2A03 can only run at 16 different pitches (or sample playback rates)

By default I mapped the user SFZ files to the highest quality 'F' which is what was used more often on games,
but you can always change this provided you can dig into SFZ files using a text editor. This would allow you to emulate the chip exactly.

Otherwise you could also modify it so that any pitch is possible, while keeping the DPCM sound as well.

So you would need to tell me what is your preference.

From 2A0X.sfz:

Code: Select all

/* Map from DMC periods to master clock divisor:

chipsounds's oscillators are are based around master clock/divider paradigm.
If you want to use DMC frequency "F", you have to divide the master clock by 54.
If you want to use DMC frequency "D", you have to divide the master clock by 84.
... etc
I verified Pitch "F" against a real NTSC NES with a DMC file.

F   $1B0/8=54  :  33143.94 Hz NTSC / 30789.02 Hz PAL
E   $240/8=72  :  24857.95 Hz NTSC / 23091.76 Hz PAL
D   $2A0/8=84  :  21306.82 Hz NTSC / 19792.94 Hz PAL
C   $350/8=106 :  16884.65 Hz NTSC / 15684.97 Hz PAL
B   $400/8=128 :  13982.60 Hz NTSC / 12989.12 Hz PAL
A   $470/8=142 :  12604.03 Hz NTSC / 11708.50 Hz PAL
9   $500/8=160 :  11186.08 Hz NTSC / 10391.29 Hz PAL
8   $5F0/8=190 :   9419.86 Hz NTSC /  8750.56 Hz PAL
7   $6B0/8=214 :   8363.42 Hz NTSC /  7769.19 Hz PAL
6   $710/8=226 :   7919.35 Hz NTSC /  7356.67 Hz PAL
5   $7F0/8=254 :   7046.35 Hz NTSC /  6545.70 Hz PAL
4   $8F0/8=286 :   6257.95 Hz NTSC /  5813.31 Hz PAL
3   $A00/8=320 :   5593.04 Hz NTSC /  5195.65 Hz PAL
2   $AA0/8=340 :   5264.04 Hz NTSC /  4890.02 Hz PAL
1   $BE0/8=380 :   4709.93 Hz NTSC /  4375.28 Hz PAL
0   $D60/8=428 :   4181.71 Hz NTSC /  3884.60 Hz PAL

If you use any other divider than those specific ones you are cheating!
*/
David Viens,
Plogue Art et Technologie Inc. Montreal.
http://www.plogue.com

Tansunn
Posts: 17
Joined: Tue Oct 20, 2009 11:02 am

Re: DPCM playback at different pitch

Postby Tansunn » Sat Apr 02, 2011 8:21 am

Just being able to play a sample back at one of those 16 pitches would be good enough, I don't need it to be at any pitch.

I want it to be a per-sample effect, though, not global. For example, map G3 to a tom sample, then map A3 to that same tom sample played at a lower frequency. Can that be done?

davidv
Site Admin
Posts: 1567
Joined: Tue Mar 02, 2004 7:23 pm
Contact:

Re: DPCM playback at different pitch

Postby davidv » Sun Apr 03, 2011 1:31 pm

Tansunn wrote:Just being able to play a sample back at one of those 16 pitches would be good enough, I don't need it to be at any pitch.

I want it to be a per-sample effect, though, not global. For example, map G3 to a tom sample, then map A3 to that same tom sample played at a lower frequency. Can that be done?


Yes it can be done, just needs a custom SFZ file made for that.

say you are going to hack user1.sfz using the default user1_036.raw sound:

To get all DPCM pitches you would have to override the main clock divider for each note:

Code: Select all

<region> key=12  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=428   //lowest
<region> key=13  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=380 
<region> key=14  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=340
<region> key=15  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=320
<region> key=16  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=286
<region> key=17  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=254
<region> key=18  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=226
<region> key=19  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=214
<region> key=20  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=190
<region> key=21  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=160
<region> key=22  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=142
<region> key=23  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=128
<region> key=24  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=106
<region> key=25  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=84
<region> key=26  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=72
<region> key=27  sample=$GENERATOR|user/user1_036.raw   sample_const_param03=54   //highest
David Viens,

Plogue Art et Technologie Inc. Montreal.

http://www.plogue.com

Tansunn
Posts: 17
Joined: Tue Oct 20, 2009 11:02 am

Re: DPCM playback at different pitch

Postby Tansunn » Sun Apr 03, 2011 4:39 pm

Perfect, thank you so much!


Return to “chipsounds General”

Who is online

Users browsing this forum: No registered users and 1 guest