English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 22 January 2015, 22:14   #21
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
Thanks. Ok so something like this?

dir$="df0:gfx"
load iff"swirl16",1
spack 1 to 1
ppsave "swirl16",1

then

ppload"swirl16",1
unpack 1 to 1

EDIT: Looks to be working There's just one thing, with the modules depacking I don't mind the flashing on the borders from the decompression but it's a little jarring when presenting the pictures. Can I "Spack" the pictures and save them without the ppsave?

EDIT: Ok, I got it now, compressing the images with "Spack" and just using "save" with relevant bank number. Less compression than combining with "PPSAVE" but avoids the flashing.

Printing the AMOSPro manual out..Hope I have enough ink!

Last edited by lordofchaos; 22 January 2015 at 22:54.
lordofchaos is offline  
Old 22 January 2015, 23:01   #22
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
hmm, i'm pretty sure Powerpacker format supports not flashing on decompression as a parameter in the crunched file, but AMOS ppsave doesn't support changing it, however it should be possible, knowing which is the relevant byte, to change it manually in some other program.
Mrs Beanbag is offline  
Old 24 January 2015, 14:58   #23
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
There's something really strange going on with my AMOSPro. I can successfully pack the MED modules with "PPsave", once they are saved I can load them back up again with the "PPload" command, so far so good. However after closing AMOS, closing WinUAE and returning, the modules no longer play. I can load them up with "PPload" but they refuse to play, that is to say I can use "MED PLAY" but no audio is heard despite the song being listed in bank 3?

I thought it must be some kind of disc corruption so I repacked all the modules again, after that I played them back in AMOS fine. Another reset and restart of WinUAE later the same issue returns. Mods not playing and often freezing the sytem, sending me to Guru land, even had a yellow screen after directly using the MED play command?..

I even ran a virus check on my system but nothing was detected. I also replaced my the AMOS files with backups just in case they had become corrupted. I`m really scratching my head here. It seems the process only works after doing it, but some time after the modules become non-playable?

Anybody have any ideas what can be causing this strange occurrence?
lordofchaos is offline  
Old 24 January 2015, 16:16   #24
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
oh now wait a minute...

i have never actually tried to use Med files in AMOS, i had assumed they would work pretty much the same as Protracker mods but apparently not. According to the manual, the med bank is "not a data bank," presumably it copies the samples or some other data out to another location, why it does this i have no idea but the conclusion is "Med modules must be loaded anew each time that the program is run".

That means you can't save Med banks and load them in again with any AMOS commands at all. This is a real pain although it explains how you got such "good" compression ratio. Sample data rarely compresses very well.

Oh well. Back to the drawing board.
Mrs Beanbag is offline  
Old 24 January 2015, 16:53   #25
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
Bugger! I thought that changing the powerpacker.library (newer version) may help? Drawing board it is. If all else fails I`ll try find a way to shorten the samples saving space.
lordofchaos is offline  
Old 24 January 2015, 17:19   #26
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
maybe you could convert your mods to Protracker format? that would expand your options at any rate, since i have some tricks for compressing samples for that.
Mrs Beanbag is offline  
Old 24 January 2015, 17:24   #27
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
I can try that, problem is though that I`m using very specific octamed commands that don't translate well into pro-tracker, and a few exploits that I`m not sure are compatible and could prove quite time consuming to convert. I`ll have to take a closer look at the song code.
lordofchaos is offline  
Old 24 January 2015, 18:04   #28
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
If you use the Protracker format, use the AMCAF versions of the commands because current versions of the AMOS music extension are buggy.
Samurai_Crow is offline  
Old 24 January 2015, 18:10   #29
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
Quote:
Originally Posted by Samurai_Crow View Post
If you use the Protracker format, use the AMCAF versions of the commands because current versions of the AMOS music extension are buggy.
Will do I`m going to convert MED into Protacker and see how well it comes out in the conversion process.
lordofchaos is offline  
Old 25 January 2015, 00:26   #30
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by Mrs Beanbag View Post
According to the manual, the med bank is "not a data bank," presumably it copies the samples or some other data out to another location, why it does this i have no idea but the conclusion is "Med modules must be loaded anew each time that the program is run".
Can't you simply poke the banks header so that it thinks it is a data bank? Or did they use those flags in the header for something MED related?
I haven't looked at the AMOS bank header format in ages, but I know it can be slightly different dependant on the type of bank used.

Edit: Remember AMOS banks have to be an even length (e.g. 10402, 12000 etc.) or AMOS gets 'fussy'.
Lonewolf10 is offline  
Old 25 January 2015, 13:57   #31
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
I've given up for the moment Converting med modules into pro-tracker isn't the easiest thing to do, especially if your using lots of different/exotic commands.. Although I managed to convert Med To Protracker, lot's of the pitching was mangled along with other things and end result was awful.

It's so weird how AMOS can let me crunch the MED files with "PPsave" and have them playback fine, but after a re-start no longer work? Unfortunately there is no magic bullet it seems.

I've enclosed the ADF I`m using.

If you load the disk into Amos and load the"ChrunchMe.AMOS" program, it will load the Med file into bank 3 and crunch it, save it to disk, clear memory, load the packed file into bank 3 and play it back fine. If you then reset the Amiga and start up AMOS again, that file will no longer play.
Attached Files
File Type: zip MusicDisk.zip (488.0 KB, 143 views)

Last edited by lordofchaos; 25 January 2015 at 14:28.
lordofchaos is offline  
Old 25 January 2015, 16:25   #32
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by Lonewolf10 View Post
Can't you simply poke the banks header so that it thinks it is a data bank? Or did they use those flags in the header for something MED related?
I haven't looked at the AMOS bank header format in ages, but I know it can be slightly different dependant on the type of bank used.

Edit: Remember AMOS banks have to be an even length (e.g. 10402, 12000 etc.) or AMOS gets 'fussy'.
The manual really isn't very clear, but I presume what it means by "not a data bank" in this case, is that when you load a Med file the bank doesn't completely contain all the data needed to play the music, some of it is loaded elsewhere (probably the samples, which need to be in Chip RAM while the patterns do not) that the programmer doesn't have direct access to. I presume there IS some way to get at it, i might investigate, but the bottom line is, when you save the AMOS bank (crunched or otherwise) it doesn't save everything, so when you load it back it is not complete.

Presumably the reason it works when you save it and load it in again is that although you have overwritten the AMOS bank with the loaded version, the rest of the data that it needs is still in memory in the same place as before. But when you reset, boom it's gone!

Please could you check the length of the music bank against the actual size of the Med file.

Load the Med file into two different banks (using "Med Load") and compare the contents of each.

edit: well i have confirmed this by looking in the AMOS music extension source code, it should be possible to add an extra instruction into the Music extension to allow one to re-relocate the module after loading with ppload. But it also makes me suspect that the whole thing leaks memory like crazy.

Last edited by Mrs Beanbag; 25 January 2015 at 17:37.
Mrs Beanbag is offline  
Old 25 January 2015, 19:46   #33
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
I took a snapshot in AMOS, loaded Med file in two separate banks. The file length seems to be at odds with the file bank size?

Quote:
Originally Posted by Mrs Beanbag View Post
well i have confirmed this by looking in the AMOS music extension source code, it should be possible to add an extra instruction into the Music extension to allow one to re-relocate the module after loading with ppload. But it also makes me suspect that the whole thing leaks memory like crazy.
That sounds promising, would it be difficult to do? Seems like quite a lot of work just to get a packed med module to work. Would be cool of course

Last edited by lordofchaos; 19 July 2019 at 15:19.
lordofchaos is offline  
Old 25 January 2015, 21:08   #34
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
i shouldn't worry about 8 extra bytes, the Med Load command seems to add it on for some reason i can't fathom but it won't affect anything else. i wanted to see the difference between the contents of the two banks (not just the difference in length) but having looked at the source code and the documentation for Medplayer.library (google translated from Polish!) i don't think it's necessary anymore.

i would like you to see if all the memory is freed up when you delete the banks though, because i suspect it is not. do this before loading a Med file, then erase the bank and do it again:
Code:
print "fast: ";fast free
print "chip: ";chip free
Now. it is possible to use library functions directly using AMOS. so try this:
Code:
track load "music.med",5
lib open 1,"medplayer.library"
dreg(0)=0
result=lib call(1,-30)
if result <> 0
   areg(0)=start(5)
   result=lib call(1,-102)
   areg(0)=start(5)
   dreg(0)=0
   result=lib call(1,-42)
   wait key
   result=lib call(1,-54)
else
   print "error opening medplayer.library"
end if
yes i really did mean "track load" - top tip - all that command does is load a raw binary file into a chip memory data bank! (and sets the bank name to "Tracker "!)

Last edited by Mrs Beanbag; 25 January 2015 at 21:39.
Mrs Beanbag is offline  
Old 25 January 2015, 21:47   #35
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
Quote:
Originally Posted by Mrs Beanbag View Post
Code:
print "fast: ";fast free
print "chip: ";chip free
Now. it is possible to use library functions directly using AMOS. so try this:
[code]
track load "music.med",5
lib open 1,"medplayer.library" - This line returns syntax error
dreg(0)=0
result=lib call(1,-30)
if result <> 0
areg(0)=start(5)
result=lib call(1,-102)
areg(0)=start(5)
dreg(0)=0
result=lib call(1,-42)
wait key
result=lib call(1,-54)
else
print "error opening medplayer.library"
end if
I have copied out the code but the line in bold returns syntax error.
lordofchaos is offline  
Old 25 January 2015, 22:01   #36
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
OH sorry i missed the version parameter. just leave it zero
Code:
lib open 1,"medplayer.library", 0
Mrs Beanbag is offline  
Old 25 January 2015, 22:09   #37
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
Ah ok. Now this is happening "ELSE without If"

Last edited by lordofchaos; 19 July 2019 at 15:19.
lordofchaos is offline  
Old 25 January 2015, 22:12   #38
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
sorry again i forgot how to code in AMOS for a moment and you caught my code before i edited it. there shouldn't be a "then" at the end of the "if" line. one of AMOS's little eccentricities.
Mrs Beanbag is offline  
Old 25 January 2015, 22:25   #39
lordofchaos
TinkerTailorContentMaker
 
lordofchaos's Avatar
 
Join Date: Nov 2009
Location: Bedfordshire
Age: 45
Posts: 1,205
That's ok, lot's of this stuff is alien to me! Well the program runs. Loads the song into bank 5 and is listed as tracker in memory bank. It also brings up"error opening medplayer.library".

If I use "track play 5" the borders flash but no audio can be heard.

Last edited by lordofchaos; 25 January 2015 at 22:31.
lordofchaos is offline  
Old 25 January 2015, 22:28   #40
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
yes it won't play as a protracker mod because it isn't one! we are only using track load because it's an easy way to load any file into a bank.

hmm... hang on

i've done another total stupid. it should be "if result=0" not "if result <>0"
Mrs Beanbag is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
AMOS or Blitz Basic 2 Dreedo Coders. General 42 23 September 2014 21:48
Compilation issues using Amos Pro and WinUAE CaptainNow Coders. Language 3 06 May 2014 15:22
jAMOS - new AMOS BASIC reimplementation in Java Mequa News 16 03 June 2012 16:58
jAMAL - AMOS BASIC AMAL reimplementation in Java! Mequa News 26 31 January 2012 02:12
Where's the amos.library on the 3-disk AMOS set? andreas support.Apps 0 15 November 2001 16:04

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:40.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11041 seconds with 14 queries