19 January 2019, 20:43 | #1 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
Amiga sfx/mod conversion & play
Hi,
My question is for Amiga 500 OCS using asm language. I'm next to zero concerning music and sound on Amiga (it took me ages to figure out the use of P61a replay). I have several question about programming sound on Amiga : - Is it possible to use 3 channels protracker mod compacted with P61Con and sfx at the same time AND the more important not using CIA timing but VBL synch instead. Trust me, I can't use the level 6 interrupt flag to play this module. -The musician sent me sfx in IFF format. Is it possible to convert (or extract?) the raw sample and play it or, is it better to stick to IFF ? - Does the phx replay could be used with VBL sync and module compacted format ? I could try to find the solution myself but I'm on time pressure these weeks. Thanks for help, |
20 January 2019, 15:53 | #2 | |||||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Quote:
But you will have to tell your musician that he can no longer set any finer grained replay speeds with the 'F' command. And you are wasting cycles (see below). Quote:
Quote:
Quote:
|
|||||
20 January 2019, 16:33 | #3 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
I think I have to use the replay for P61 compacted and build myself a simple sfx 1 voice managing, because the compacted generated P61 file is saving quite a lot of Kb. The replay 6.1a allows vbl sync.
Anyway, your answer is complete and helpfull. Thanks pal. |
20 January 2019, 16:47 | #4 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
I use phx’s replayer and it is fantastic, i have no idea why u would use anything else.
I’m happy to give pointers around how i drive it. Very straight forward. Geezer |
20 January 2019, 17:33 | #5 | |||
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
So you can leave off IRQ6 for something more 'aggressive'. A module player that can interrupt a VBI can be excessive in some case, but yes, all depends on how you write your code Quote:
I would also add the ability to 8-bit delta adjust samples data (so use less disk space when compressed, in addition to using less RAM space for module data). Quote:
Absolutely a must if used in a video game. Anyway also P6112 has is advantages (more 'demo' related). Maybe one day a mix of the two.. -- PS: there is somewhere in a hukka's pack a new version of the Photon's P61 replayer. From the history: Code:
;SPECIAL NOTE FOR THIS VERSION: ;----------------------------- ; hacked by hukka/Void in 2016-06-30 to play EFx (Invert Loop) effect ; as it's played in ProTracker editor ; small fix/optimization to the hukka hack by ross in 2018-01-29 Last edited by ross; 20 January 2019 at 17:53. Reason: PS |
|||
20 January 2019, 20:35 | #6 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
@Geezer : Thanks for the help proposal, much appreciated, but as already stated I need memory save.
@ross : PM sent. |
21 January 2019, 18:34 | #7 | ||
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Quote:
Quote:
Ross, Hukka: nice find, I'm changing mine! But consider uploading as P6113 to Aminet as it's open source now. (This actually fixes all versions of The Player 6.1 so even if you have maybe a P6106 that has gotten fixed over the years you could make the same change in that.) |
||
21 January 2019, 18:44 | #8 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
@Photon : Indeed I asked the musician to not use > F20 effects -as written in the replay header source-.
And thanks for the additional tips. |
21 January 2019, 20:39 | #9 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
But I forgot to answer your questions about channels for SFX
Set channels=3 (f.ex.) and splitchans=0. This should leave the other channels untouched and could gain a few bytes in song file size. |
22 January 2019, 15:23 | #10 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
07 February 2021, 21:08 | #11 |
Registered User
Join Date: Feb 2021
Location: Brighton
Posts: 2
|
Let me give you my input on this matter as I've used P41A -> P61A extensively in many demos and intros. Even written my own mod player.
P61A is actually very easy to do just about anything you want with, it's all about setting options and that's what source gets assembled. There is a setting in the replayer for VBL playback under a level-3 IRQ. For playing music with P61A, by default it uses CIA-B on which there are two timers A and B. Timer A is set to ONE-SHOT mode and is used to control the Audio DMA. Timer B is set to CONTINUOUS and is used to play music that is tempo based, where the tempo is not 125bpm. CIA-B generates Level-6 interrupts, so when using audio timed DMA, you need to switch your IRQ handler so that it does the audio DMA and also the calls the play routine for the module. So it basically works like this... You load your audio registers, but you need to wait for the DMA to start (which is usually about 6 scan lines, maybe more which is why you had those busy-loops in older replayers). However, with a CIA timer, you can load the audio registers and start a timer (in one-shot mode) and this timer will be set for about 6 scan lines, when you get the IRQ your DMA has started and you can set the registers accordingly. The useful this about this technique is that there is no busy waiting because you get signalled by an IRQ when the DMA starts. During this IRQ, you also switch out the current IRQ handler for the other one that is running on timer B for the tempo. It's actually quite tricky to do nicely, but once you get there, everything is fine! Now, you're talking about using CIA-A, which also has two timers A and B. Sure, you could use these timers, but be aware that CIA-A generates level-2 IRQ's and is used for the mouse and keyboard. The problem with using these timers is that since they're level-2 IRQ's, they can interrupt Level-3 IRQ's which is your Copper, Blitter and VBL. This can lead to all sorts of unfortunate tearing on the screen if get a level-2 IRQ interrupt your level-3 and eats your VBL interval. Moreover, if you've got any plans to return to the OS on exiting, you're going to find it INSANELY difficult to reset CIA-A back to a state where it's friendly to the operating system again. |
07 February 2021, 21:20 | #12 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
|
Your explanation is very interesting, specially the non-busy waits that a lot of players DON'T use, and use empty dbfs instead, which trashes the sound on fast machines.
For the CIAs, one thing is sure: you cannot save the reload timer value that was there before you changed it. But tools like whdload are able to get back to the OS nicely. Not saying that it's easy, but it's doable. Alain Malek (Hornet from HRTMon) provided me with such a routine, and I used it successfully with JST. Are you sure that level 2 interrupt is going to interrupt level 3 interrupt? I don't think so. When entering copper/vblank/blitter interrupt, SR is set so it cannot be interrupted by a lower priority interrupt (unless you hack SR from within the interrupt of course) |
07 February 2021, 21:23 | #13 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Yeah correct, it's the other way around. So your code in a level3 vbl will be interrupted by a level6 CIA. It wouldn't be interrupted by a level 2.
|
07 February 2021, 21:45 | #14 | |
Registered User
Join Date: Feb 2021
Location: Brighton
Posts: 2
|
Quote:
You're right.... the other way around. Whoops, although my StatusMonitor in my demos (a bit like Sanity's one, but not as good, used to do some horrible things to the SR to force stuff to happen) My apologies people... I'm old. What else can I say. I've managed to find some old source where I did this, but had to extensively modify a Noisepacker player because that was the format the module was in! np_irq1: movem.l a0-a1/a6,-(sp) lea $dff000,a6 tst.b $bfdd00 move.b #$19,$bfde00 lea np_irq2(pc),a0 move.l np_vbr(pc),a1 move.l a0,$78(a1) move.w np_block+16(pc),$96(a6) move.w #$2000,$9c(a6) movem.l (sp)+,a0-a1/a6 nop rte np_irq2: movem.l a0/a6,-(sp) tst.b $bfdd00 lea $dff000,a6 move.l np_voidat1+18(pc),$d0(a6) move.w np_voidat1+22(pc),$d4(a6) move.l np_voidat1+50(pc),$c0(a6) move.w np_voidat1+54(pc),$c4(a6) move.l np_voidat1+82(pc),$b0(a6) move.w np_voidat1+86(pc),$b4(a6) move.l np_voidat1+114(pc),$a0(a6) move.w np_voidat1+118(pc),$a4(a6) move.l np_vbr(pc),a0 move.l np_oldirq(pc),$78(a0) move.w #$2000,$9c(a6) movem.l (sp)+,a0/a6 nop rte |
|
08 February 2021, 20:02 | #15 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
As a sketch, there are 3 timings for Protracker module replay:
This is for a straight player, no extra stages performed, like requiring 1 frame to decompress notedata, or distributing decompression across multiple frames (requires SUBSTEP TEMPO Fxx <$20 and > than number of channels). Last edited by Photon; 08 February 2021 at 20:07. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Lemmings with sfx & CD audio tracks | jotd | project.CD32 Conversion | 12 | 21 April 2019 15:44 |
Gods with sfx & audio tracks | jotd | project.CD32 Conversion | 60 | 24 January 2019 13:16 |
Casual Play & Serious Play Amiga Setups | ransom1122 | Retrogaming General Discussion | 3 | 20 October 2015 21:35 |
Trapped I & II - Music & SFX? | ecamber | support.Games | 5 | 28 March 2015 19:23 |
Amiga game mod player for PC aka how to play BP files | wlcina | support.Other | 6 | 16 March 2012 00:03 |
|
|