![]() |
![]() |
![]() |
#1 |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,478
|
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 Akira; 16 January 2021 at 01:46. |
![]() |
![]() |
#2 |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,478
|
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 Akira; 19 January 2021 at 16:18. |
![]() |
![]() |
#3 | |
Registered User
![]() Join Date: Sep 2009
Location: Norway
Posts: 1,503
|
Quote:
|
|
![]() |
![]() |
#4 | |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,478
|
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: |
|
![]() |
![]() |
#5 |
Registered User
![]() Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 5,104
|
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} |
![]() |
![]() |
#6 | |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,478
|
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 Akira; 24 February 2021 at 02:06. |
|
![]() |
![]() |
#7 |
Registered User
![]() Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 5,104
|
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.
|
![]() |
![]() |
#8 | |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,478
|
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) |
|
![]() |
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
SetPeriod Sound Issues | LuMan | Coders. Blitz Basic | 20 | 19 January 2021 16:32 |
Default display values | chip | support.WinUAE | 6 | 06 January 2018 15:00 |
Finegrain_cpu_speed values | hexaae | support.WinUAE | 2 | 14 August 2016 15:36 |
Discretizing / Normalizing Values in C/C++ | Zetr0 | Coders. General | 4 | 04 December 2006 10:29 |
|
|