15 January 2021, 23:36 | #1 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,646
|
SetPeriod does not seem to like values I am inputting
I'm trying to change the pitch of a sound I loaded using SetPeriod, and I am using the following table (taken from the Protracker player source):
Code:
856,808,762,720,678,640,604,570,538,508,480,453 428,404,381,360,339,320,302,285,269,254,240,226 214,202,190,180,170,160,151,143,135,127,120,113 Code:
C-1,C#1,D-1,D#1,E-1,F-1,F#1,G-1,G#1,A-1,A#1,B-1 C-2,C#2,D-2,D#2,E-2,F-2,F#2,G-2,G#2,A-2,A#2,B-2 C-3,C#3,D-3,D#3,E-3,F-3,F#3,G-3,G#3,A-3,A#3,B-3 Any ideas? Last edited by Amiga1992; 16 January 2021 at 00:46. |
18 January 2021, 17:11 | #2 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,646
|
Nobody?
[edit] for reference, this is a simplified version of the code I am using: Code:
Statement LaunchSample {track,period} SHARED channelMask SetPeriod track, period Sound track, channelMask End Statement Last edited by Amiga1992; 19 January 2021 at 15:18. |
16 February 2021, 12:28 | #3 | |
Registered User
Join Date: Sep 2009
Location: Norway
Posts: 1,711
|
Quote:
|
|
23 February 2021, 23:10 | #4 | |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,646
|
Quote:
Code:
_data.l ;00: NULL if no sound present, else pointer to sound data _period.w ;04: period of sound _length.w ;06: length, in words, of sound data _loop.l ;08: repeat to loop position of sound _looplength.w ;12: length of looping section, in words _pad.b[2] ;14: |
|
24 February 2021, 00:05 | #5 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,368
|
Hmmm, I haven't looked at this properly on my own machine, but is it possible your types are getting mixed up? The struct definitely does use a word type, but if your function is taking a value of a different type, things might be getting mangled. Try defining the types in your statement definition:
Code:
Statement LaunchSample {track.w, period.w} |
24 February 2021, 00:57 | #6 | |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,646
|
Quote:
Code:
DEFTYPE .w [edit] gave it a try, same problem. Could this be a bug in the sound library of Blitz? Last edited by Amiga1992; 24 February 2021 at 01:06. |
|
24 February 2021, 09:42 | #7 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,368
|
Absolutely, it could definitely be a bug, or even something silly like an error in the Newtype definition in bb2objtypes... At some point when I have time I'll try it out and see if I can spot anything.
|
24 February 2021, 19:55 | #8 | |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,646
|
Quote:
I installed the latest UBB, I thought the sound library was patched, but I still get that "Illegal Chanel" (sic) error on compiling on the specific line that sets the period (which doesn't even use channel mask to work) |
|
10 March 2021, 00:28 | #9 | |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,646
|
Quote:
At the very least, SetPeriod is bugged and uses the wrong data type to try to change the period. If anybody got it to work, ever, please post here and share exactly how. My solution was to make my own routine to change the period. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SetPeriod Sound Issues | LuMan | Coders. Blitz Basic | 20 | 19 January 2021 15:32 |
Default display values | chip | support.WinUAE | 6 | 06 January 2018 14:00 |
Finegrain_cpu_speed values | hexaae | support.WinUAE | 2 | 14 August 2016 14:36 |
Discretizing / Normalizing Values in C/C++ | Zetr0 | Coders. General | 4 | 04 December 2006 09:29 |
|
|