![]() |
![]() |
![]() |
#21 | |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,438
|
Quote:
Could you just redirect a sound object to this data, with a pointer, then? I guess if the sound data is in Fast RAM, that would be a problem. |
|
![]() |
![]() |
#22 |
Registered User
![]() Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 5,007
|
Ah yeah, if you load it as a bank you can specify which memory type you want. I assume LoadModule would automatically load it into chip RAM so it can be played, but might be worth checking, just in case.
|
![]() |
![]() |
#23 |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,438
|
I meant here's nothing wrong with using Fast RAM if you have it, but I am aiming for the absolute lowest denominator.
I guess memory management will be something I have to get into at some point, scary. |
![]() |
![]() |
#24 | |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,438
|
Quote:
There's a page in Amigacoding defining the Blitz objects, and the module object's _mt_data sub-item would have the module data. How would I traverse through this data, for example with some "For" statement reading every byte straight? I'm sorry if this is super newbie, but I am not sure I understand how to refer to t he module object loaded in memory exactly. For the time being, finding it in RAM and reading the module's name (which is at offset 0 and is 20 bytes long) would be enough for me to understand how to do the rest. [edit] Well this is getting complicated fast... I don't think I can have a pointer inside a newtype definition, can I? I really don't know how to create a copy of the actual sample data, there's no variable that can hold that that I can think of, so the best choice here would be to point at the sample data already in memory thanks to LoadModule, but I wanted to create an array of sample objects where the actual sample data was one of the elements. I guess I cannot. SoundData pushes a byte of info at a time into a sound object, so I guess I would have to make consecutive SoundData calls until "sample length" is reached, starting from the sample address in memory. It would be easier if I could, somehow, just redirect the sound data part of a sound object to the memory location where there's already sound data, but I don't know how I could do that, feel like it has to do with the sound data type, but don't really know how I can access it, as I said before. My mind is getting really mushy with all this ![]() ![]() ![]() ![]() [edit 2] aghhh i am in tears haha. Sorry EAb to use you as my rubber ducky debug So having this in mind: 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: Assuming I am dealing with a sound that Initialized as Sound 1, how can I access this _data parameter of that sound object when I have no variable name for it? this is the part that confuses me. Last edited by Akira; 18 January 2021 at 23:31. |
|
![]() |
![]() |
#25 | |||||||
Registered User
![]() Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 5,007
|
Quote:
Quote:
Quote:
Code:
*moduleData.module = Addr Module(0) Code:
offset.l = 0 If moduleData NPrint Peek$(*moduleData\_mt_data + offset) End If Code:
offset.l = 0 name$ = "" If moduleData If peek.l(*moduleData\_length) > 20 For i.l = 1 to 20 name$ + Peek.b(*moduleData\_mt_data + offset + i) Next i NPrint name$ End If End If Quote:
Quote:
Quote:
Quote:
So having this in mind: 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: Assuming I am dealing with a sound that Initialized as Sound 1, how can I access this _data parameter of that sound object when I have no variable name for it? this is the part that confuses me.[/QUOTE] You create a sound Newtype pointer to the Sound object, and then the fields will point to the values you want: Code:
*mySound.sound = Addr Sound(1) ; mySound is now a pointer to that object If *mySound ; Make sure it exists *mySound\_data = address_of_new_data.l End If |
|||||||
![]() |
![]() |
#26 | |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,438
|
Man you're a godsend, thanks for helping out with this!
Let's skip to the part that seems relevant as a solution, after all my mumbling. Quote:
And if I read you correctly in the other thread, there's something I need to include here to make sure it works? I feel bad asking all this because it feels like it's buried somewhere in the shit manual and I cannot find it. I searched several pages for the "Addr" command and was not able to find it, for example. Also no explanation on how to create these type of objects, how to work with pointers, etc... just a really bad manual. |
|
![]() |
![]() |
#27 | ||
Registered User
![]() Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 5,007
|
Quote:
Quote:
![]() |
||
![]() |
![]() |
#28 | |
Black Lives Matter
![]() Join Date: May 2001
Location: New York
Posts: 19,438
|
Quote:
I need to recollect my thoughts now and put all t his new knowledge to use. As soon as we're talking pointers and stuff, I am far more in my game than I was before, so hopefully I can make this work. Thanks again to you and idrougge, you will be heavily credited in whatever I make :P |
|
![]() |
![]() |
#29 |
Registered User
![]() Join Date: Nov 2019
Location: Croydon
Posts: 144
|
jesus I leave a few days and this thread blew up, thanks to all for the input, I think I can work form this point on in a solution to my problem but I don't really understand pointers and all that, must learn more.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Protracker file format, number of samples | phx | Coders. General | 21 | 02 August 2019 23:45 |
Blitz Basic 2 and Protracker mods | Radertified | Coders. Blitz Basic | 3 | 13 September 2018 23:55 |
Can't Create File error using Protracker 2.3d | ViLXDRYAD | support.Apps | 5 | 09 December 2016 16:44 |
Protracker 3.xx Load Sample | womagrid | support.Apps | 3 | 27 May 2016 07:28 |
Load Cubase made sample in protracker | Brick Nash | support.Other | 4 | 26 May 2016 19:28 |
|
|