English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Releases

 
 
Thread Tools
Old 13 March 2010, 17:25   #1
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Optimized Player 6.1 Playroutine 'p6107.lha'

Important: I've updated The Player (P61) playroutine since this post! The latest version, P6112 is available from Aminet. Use that instead.

Spent more time than expected on optimizing p6106.lha from Aminet. Optimization was done last weekend+Monday for testing a bunch of modules, and then I tried SetPosition (the routine to jump to a certain songposition under program control), and it didn't work.

Well, it didn't work in the original either, most likely it has never worked with compressed patterndata. So the routine was probably untouched since the playroutine versions before ThePlayer came

After digging into the original code even more (bluergh) and using what I learned when I recoded the decrunch-part, I made it aware of the compression scheme, and it worked. Then I made it callable on any P61_cn (on any frame) and take effect immediately.

While I was there I noticed a bug in SetPosition that was also present in Bxx/Dxx/NextPattern, but not in P61_Init, to set the 'new pattern trackdata ptrs'. This is probably seldom noticed, it only takes effect when compressed patterndata is >32K. The new correct code also was a few cycles faster.

This took several days and lots of cursing, and then it was time for final-testing, documentation and general cleanup.

I ran speed measurement of all the modules and made a table, which showed "playroutine takes max 5.5 scanlines instead of 7.5" for all modules. Except one, the worst case one, which was only 1.7 scanlines faster instead of 2.


I also uploaded it to Aminet just now, so it should be available there soon I hope.

I've delved deeper than anyone since the original authors, I think. (And I hated every minute of it. :P) So if you have questions or feedback, ask me now before I've forgotten everything.

There's a lot of documentation and comments in the sources and readme though.

Last edited by Photon; 28 February 2015 at 23:50.
Photon is offline  
Old 13 March 2010, 17:39   #2
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Legendary work Photon!
pmc is offline  
Old 13 March 2010, 17:44   #3
kriz
Junior Member
 
kriz's Avatar
 
Join Date: Sep 2001
Location: No(R)Way
Age: 41
Posts: 3,185
Real cool work man!!
kriz is offline  
Old 13 March 2010, 20:36   #4
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
Nice, but it's still based on protracker which wasn't really good to begin with and didn't exploit the whole range of Paula's capabilities.
hitchhikr is offline  
Old 13 March 2010, 22:10   #5
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by hitchhikr
Nice, but it's still based on protracker which wasn't really good to begin with and didn't exploit the whole range of Paula's capabilities.
In that case, what would you recommend as a better alternative...?
pmc is offline  
Old 13 March 2010, 22:54   #6
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
A brand new protracker
hitchhikr is offline  
Old 13 March 2010, 23:14   #7
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
A new version of ProTracker would be nice.

But what would a new version need in order to be the daddy...?
pmc is offline  
Old 14 March 2010, 00:17   #8
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
Cleaner code (basically restarting from zero using the same look for the interface with a more modern twist), more octaves, waveforms envelopes and maybe modulations presets for instruments.

Last edited by hitchhikr; 14 March 2010 at 00:26.
hitchhikr is offline  
Old 14 March 2010, 12:18   #9
Frog
Junior Member
 
Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,385
isn't it called DigiBooster tracker ?
Frog is offline  
Old 14 March 2010, 14:06   #10
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,522
Quote:
Originally Posted by Frog View Post
isn't it called DigiBooster tracker ?
True. Bet hitchhikr wants to do it from scratch, open sourced and for free. Might take a while to get it done and then it surely would have to be 'backwards' compatible to PT anyway. Happy coding guys
TCD is offline  
Old 14 March 2010, 15:15   #11
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
Frog: Digibooster was just a clone of protracker with 8 channels (no envelopes or anything fancy). Digibooster pro imported several FastTracker II features (like volume envelopes) but won't work on an A500 (it needs a 68020 minimum) also afaik it uses AHI (so probably no Paula) and the replay routine is outrageously huge and yes, it's a closed source commercial product.
hitchhikr is offline  
Old 15 March 2010, 01:04   #12
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Thx 4 kudos!

Tried Musicline? What I've heard of it reveals that the quality is there.


When it comes to music programs that go beyond the Protracker features, envelopes are fine, and you can do some effects basically for free, but as soon as you add more channels and/or sound processing, you're looking at a lot more CPU time consumed. For the ordinary solutions - buffering and sound mixing - this needs to take place frequently and on time, which means a frequent interrupt which must finish in time for the next interrupt.

On the 68000, this solution basically means "not too much CPU/DMA used besides playing the music, or it will be run ass-slow". Which means that for games or demos, or even normal Workbench use, you need 68020 and probably fastram.

Extra octaves is easy, just sample the instrument for a couple of octaves to increase the range. There's no other way of magically making very low notes sound good on any platform. The only thing you can do if quality is lacking on a sample "that is already on your harddisk" is to resample+filter+eq it in a high-end program, or convert it from 16-bit to "14-bit" and add even more CPU processing to the replay.

At the high octaves end, there is no way to beat the 28KHz limit other than feed individual samples to Paula very rapidly using an interrupt or similar, which on 68000 will steal a huge chunk of the CPU time just because ...the musician won't resample a sound?


I like Protracker, and I like how sampled instruments/vocals give more life to a song. I'm not saying I don't love chipmusic, because I'm guilty of having fresh.ogg on while coding a lot of the time But of the features hitchhikr lists, many of them can be made on high-end equipment before composing, such as studio PCs and virtual or real analog synthesizers.

The Amiga isn't really made for chipmusic, which was invented for lower spec home computers that had synthesizer chips to help the slow CPU play sounds. Amiga steps that up to a different technology, samples, and helps the slow CPU play samples. Porting chipmusic to Amiga makes it awkward, and raising the bar to PC specs (more channels, higher quality) makes it even more of a bastard In many visual or calculation aspects, tricks can be pulled to wring more out of the hardware, but with the audio hardware it's different. There's no way out for high spec chipmusic than to raise the CPU specs of the Amiga platforms capable of running it.

Also, no high end music program will make a song interesting or enjoyable. Composition and 'immersion in the barrage of sounds' is at least to me what makes me play a song again.

There I go, lecturing (or informing) again. But it was like, 'musicians want just a few more channels and just play it an octave higher, how hard can it be!?' and ... this is how hard it can be.

I bet you know all this already. But actually I got some ideas while typing (a favorite hobby of mine) this. I already have some 8 channel experiments with synth-like effects from back when, but I have many projects I need to finish before I start on a whole new music program.


If you don't mind stepping up the specs though, check out MusicLine. It has 8 channels, chip music instruments and samples.

Last edited by Photon; 15 March 2010 at 02:19.
Photon is offline  
Old 15 March 2010, 09:50   #13
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Photon
I like Protracker
So do I.

With all those demos and games using ProTracker songs and sooooo many classic .mods and great memories from listening to that stuff it can't be *that* bad.

So, again, great work on the replayer code fixes.
pmc is offline  
Old 16 March 2010, 13:40   #14
TheDarkCoder
Registered User
 
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 213
Well done Photon!

I did the 610.6 patch and that time I had noticed that SetPos didn't work.
But I was unable to fix it, a deep understanding of the p61 working was needed and I don't have it :-(

My patch was just the consequence of noticing a evident bug using 020 flag and my own researches on interrupts management on the Amiga.

So I am very happy that you finally fixed the stuff!
TheDarkCoder is offline  
Old 16 March 2010, 18:50   #15
Noname
 
Posts: n/a
Quote:
Originally Posted by Photon View Post
Download it here.
I've delved deeper than anyone since the original authors, I think. (And I hated every minute of it. :P) So if you have questions or feedback, ask me now before I've forgotten everything.
Good stuff. Although I haven't tried it, yet, I wanted to mention that P61 sometimes needed some pattern position(s?) in the beginning of a song after a reboot to get the speed right. Always felt like some variables or registers had not been initialised correctly. Have you discovered this issue as well?
 
Old 17 March 2010, 02:31   #16
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Great fix Photon, thanks a lot

Quote:
Originally Posted by Noname View Post
Good stuff. Although I haven't tried it, yet, I wanted to mention that P61 sometimes needed some pattern position(s?) in the beginning of a song after a reboot to get the speed right. Always felt like some variables or registers had not been initialised correctly. Have you discovered this issue as well?
Sounds odd. Not sure why a reboot would cause this if stopping and reinitialising the module wouldn't. The Amiga audio hardware is not aware of pattern speed and position, those are concepts that only exist in the replay routine.

A common mistake is to return from an interrupt, in which you call the replay routine, before the interrupt request bit has been cleared, and the interrupt might trigger immediately again and the replay routine gets called twice. Maybe that's it?
Leffmann is offline  
Old 17 March 2010, 13:12   #17
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Quote:
Originally Posted by Noname View Post
Good stuff. Although I haven't tried it, yet, I wanted to mention that P61 sometimes needed some pattern position(s?) in the beginning of a song after a reboot to get the speed right. Always felt like some variables or registers had not been initialised correctly. Have you discovered this issue as well?
Well, if you can describe it more accurately (if you remember) or send a module that doesn't replay right (with the converter's play button), or suggest a test case I might have a chance to fix it.

There are two things I don't understand in your description:
1) need some pattern positions? Make the song longer by inserting one or two whole patterns? I think you mean the musician forgot to put an Fxx command in the very first step in the first pattern of the song? If there is no Fxx command there, you get F06 by default.
2) after a reboot? You sure you don't mean song restart? If the song changes speed during the song, and it not reset at the very first step (see 1)), then it will continue at the last set speed and not revert to default speed 6 - as it would if you start playing the module from the start.

You can test this in Protracker if you set speed 2 as default in the Setup panel. All the songs that play correctly then have set the speed properly.
Photon is offline  
Old 19 March 2010, 00:33   #18
Noname
 
Posts: n/a
Guys, I mixed things up. The bug I mentioned was inherent to Tracker Packer and could be fixed by playing the module for a moment, then restarting it. Sorry for the confusion.

@Leffmann: I am not actively trying to get it working right now. My observation was from ten years ago, when I made P61 work on A4060 and integrated it into my demosystem in the first place.
 
Old 19 March 2010, 08:24   #19
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Noname
My observation was from ten years ago... my demosystem...
What demos did you make Noname? Got any links to them so we can see your work...?
pmc is offline  
Old 19 March 2010, 10:31   #20
Noname
 
Posts: n/a
Quote:
Originally Posted by pmc View Post
What demos did you make Noname? Got any links to them so we can see your work...?
I started with Sector 7 and then joined Haujobb in 1997, after releasing Synergy with JCS and Marc. Our bigger productions, each with screenshots, are available at Amiga Demoscene Archive (c.f. list filtered by noname).
 
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Super Optimized P6108.lha playroutine :) Photon Coders. General 15 07 November 2013 18:15
Looking for ArtOfNoise Playroutine (68k assembler) Herpes Coders. Asm / Hardware 5 05 September 2012 00:10
Tracker/Playroutine to play tubular.mod Photon Coders. General 15 10 March 2006 21:09
Optimized Protracker playroutine? Photon Coders. General 10 11 June 2005 00:54

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 01:46.

Top

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