From 0834d3f322abf9fc9058be1135e78a061ec46bd4 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Fri, 18 Oct 2002 12:05:15 +0000 Subject: Pitch steps changed to 0.1% instead of 1%. Holding down ON+RIGHT/LEFT increases/decreses pitch 2% while key is held down, then returns. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2718 a1c6a512-1295-4272-9138-f99709370657 --- firmware/mpeg.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'firmware/mpeg.c') diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 85054d7cf0..d75ac2085e 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -1985,16 +1985,19 @@ void mpeg_sound_channel_config(int configuration) #ifdef HAVE_MAS3587F /* This function works by telling the decoder that we have another crystal frequency than we actually have. It will adjust its internal - parameters and the result is that the audio is played at another pitch */ -void mpeg_set_pitch(int percent) + parameters and the result is that the audio is played at another pitch. + + The pitch value is in tenths of percent. +*/ +void mpeg_set_pitch(int pitch) { unsigned long val; - /* invert percent value */ - percent = 10000/percent; + /* invert pitch value */ + pitch = 1000000/pitch; /* Calculate the new (bogus) frequency */ - val = 18432*percent/100; + val = 18432*pitch/1000; mas_writemem(MAS_BANK_D0,0x7f3,&val,1); -- cgit v1.2.3