29 August 2013, 13:12 | #1 |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
How to test audio channel in replay
Hello everyone,
I'm new to this forum, a few days ago, I started to try to recode Amiga 500 for fun. I lost all my knowledge on this machine, do not get old lol! In short, a thing I never learned to do is to test the four audio channels of the amiga. example the following link (the loader copperbarres bottom of the screen): [ Show youtube player ] What interests me is just how it retrieves information in their replayroutine. If someone has a small example and a clear exeplication I'm interested. Sorry for my English. Thank you in advance Powergoo |
29 August 2013, 13:15 | #2 |
The Original Domainiac
Join Date: Oct 2012
Location: Stafford/UK
Age: 47
Posts: 1,292
|
I've no idea sorry, but welcome to the EAB Powergoo
|
29 August 2013, 13:18 | #3 |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
|
29 August 2013, 13:30 | #4 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Usually you will have the source of the replay routine as part of your project, so you can read the channel status from it. For example I released an optimized Protracker replayer here: http://eab.abime.net/coders-releases/65430-protracker-player-support-external-sound-fx.html"]eab.abime.net/coders-releases/65430-protracker-player-support-external-sound-fx.html There is a channel status structure for each of the four channels. The first two words of the structure (n_note and n_cmd) contain the current note and command to be played. You could just check if n_note is non-zero and set your copper bar to full length. When it is zero make the bar smaller until reaching minimal height. |
|
29 August 2013, 13:34 | #5 | |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
Quote:
Ok i try this thanks |
|
29 August 2013, 21:12 | #6 |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
I wanted to test your code, but I use Devpac 2 (yes I know this is old but I know that one and seka or Asmone)
So I get errors when I want to assemble your replay code as Devpac. ; Channel Status rsreset n_note rs.w 1 rsreset is a label? rs.w what is it? xref _LinkerDB ??? near a4 ??? code ??? , ------------------------------------------------- -------------------------- xdef mt_install_cia ??? mt_install_cia: ??? is what i don't understand Vasm looks great for use on my pc, I'll have to test it |
30 August 2013, 14:01 | #7 | ||||||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Quote:
You can define structure offsets with RSRESET and RS. RSRESET resets the counter to 0 and RS.W <cnt> increases the counter by 2*<cnt>. Quote:
Most linkers support it: e.g. blink, slink, PhxLnk, vlink, ... Quote:
It is not even needed as an assembler should recognize a small data addressing mode when seeing "LABEL(An)" (vasm does, PhxAss perhaps not). Just tested it and saw that Devpac cannot handle it. You may have to convert all small data accesses to absolute ones, i.e. delete the NEAR and remove the (A4) from all operands. Or try it with AsmOne and the BASEREG directive. But then you must have a single source and cannot link anymore. Quote:
Quote:
All assemblers support it. Definitely. Is there a TAB missing again? Last edited by phx; 30 August 2013 at 14:11. |
||||||
01 September 2013, 01:03 | #8 |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
first I change the beginning of the code
Code:
; near a4 ; code section code,code_c Code:
mt_install_cia: ; Install a CIA-B interrupt for calling mt_music. ; a6 = CUSTOM ; a4 = small data base ; a0 = AutoVecBase ; d0 = PALflag.b (0 is NTSC) ; clr.b mt_Enable(a4) clr.b mt_Enable Code:
mt_TimerAInt: ; TimerA interrupt calls mt_music at a selectable tempo (Fxx command), ; which defaults to 50 times per second. movem.l d0-d7/a0-a6,-(sp) ; lea _LinkerDB,a4 lea CUSTOM,a6 ; it was a TB interrupt, set repeat sample pointers and lengths ; lea _LinkerDB,a4 move.l mt_chan1+n_loopstart,AUD0LC(a6) ("bss section or an offset can not contain data") : Code:
; section __MERGED,bss section __MERGED,data_c I add a test routine Code:
; code section code,code_c Start: lea module,a0 lea CUSTOM,a6 jsr mt_init move.b #1,mt_Enable Wait: MOVE.L $DFF004,D0 LSR.L #8,D0 AND.W #%111111111,D0 CMP.W #$0019,D0 BNE.S Wait move.b #1,mt_Enable lea CUSTOM,a6 jsr mt_music BTST #6,$BFE001 BNE.S Wait lea CUSTOM,a6 jsr mt_end End: rts Code:
sfx_vol: ds.w 1 module: incbin mod.mymodule where i'm wrong ??? |
01 September 2013, 10:22 | #9 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Sounds like the interrupt code might not be called. Add some "move.w $dff006,$dff180" debug flashing in the interrupt routine, if you see the flashing colors it at least means the interrupt code is called correctly.
Edit: Seeing that you included the module right after the variables I have to ask if the module is in chip ram? Last edited by StingRay; 01 September 2013 at 10:53. |
01 September 2013, 14:57 | #10 | |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
Quote:
I do not use the Interupt, but since I call my music in my main loop I should normally have the music? the module is in chip i use : Code:
; section __MERGED,bss section __MERGED,data_c |
|
01 September 2013, 15:01 | #11 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Can you upload your modified code? So we can have a look.
|
01 September 2013, 15:20 | #12 |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
yes !!!
|
01 September 2013, 15:37 | #13 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
You need to call "mt_init_cia" to install the cia interrupt as the replayer relies on that as far as I can see. Try that and see if it changes anything.
|
01 September 2013, 16:42 | #14 | |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
Quote:
Code:
Start: ;(a6=CUSTOM, a4=SmallDataBase, a0=AutoVecBase, d0=PALflag.b) lea CUSTOM,a6 move.l #0,a0 move.b #1,d0 jsr mt_install_cia lea module,a0 lea CUSTOM,a6 jsr mt_init move.b #1,mt_Enable Wait: MOVE.L $DFF004,D0 LSR.L #8,D0 AND.W #%111111111,D0 CMP.W #$0019,D0 BNE.S Wait BTST #6,$BFE001 BNE.S Wait lea CUSTOM,a6 jsr mt_remove_cia lea CUSTOM,a6 jsr mt_end End: rts Right now I must make VU meter like ProTracker |
|
01 September 2013, 18:24 | #15 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Yes, in a "real world example" you would need to get the location of the VBR as it can be relocated to fast memory. Just check the CPU type (on 68000 you don't have to do anything, no VBR there) and use movec VBR,dx/ax to get the VBR location.
|
07 September 2013, 12:00 | #16 |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
Hello,
I've coded my routine of Vu-meter I do not know what I'm doing wrong, but I do not otient the same result as the VU meter of ProTracker. if someone can take a look |
07 September 2013, 12:34 | #17 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Had a quick look at your code, Protracker (at least 3.xx series) uses "real" VU-meters, i.e. the volume is taken into account too. You only check if a new note has been played which is why you get a different looking VU-meter.
|
07 September 2013, 13:42 | #18 | |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
Quote:
ok and how to test volume in each channel ? I hope volume ha a range of 0-64 no ? |
|
07 September 2013, 17:17 | #19 |
Registered User
Join Date: Aug 2013
Location: france
Posts: 20
|
ok i found volume for each channel and modify my code with :
Code:
TestZic: lea joue,a5 ; height of the vu-Meters lea mt_chan1,a0 ; position of the first channel move.l planeadr,d6 add.l #40*(256-HEIGHT)+10,d6 ; first position of the first vu-Meter in the bitplan jsr TestChannel ; display the Vumeter for this channel add.l #6,d6 ; next position lea mt_chan2,a0 ; position of the second channel jsr TestChannel ; display the Vumeter for this channel add.l #6,d6 ; next position lea mt_chan3,a0 ; position of the thrid channel jsr TestChannel ; display the Vumeter for this channel add.l #6,d6 ; next position lea mt_chan4,a0 ; position of the fourth channel jsr TestChannel ; display the Vumeter for this channel rts TestChannel: move.l (a5),d3 ; height of vu meter move.w 0(a0),d0 clr.l d1 move.w n_volume(a0),d1 ; volume of the note cmp.w #0,d0 ; a note is played ? beq.s .suite ; no then we continue move.l #HEIGHT-1,d3 ; vu meter height maximum bra.s .fin .suite: ; no note is played cmp.l #0,d3 ; is you are already at the bottom beq.s .fin ; yes then we continue sub.l #1,d3 ; no we descend the vumeter .fin: move.l d3,(a5) mulu.w d1,d3 ; multiply the height of vu-meter with volume of the note lsr.l #6,d3 ; and divide by 64 (range volume is between 0 - 64) move.l d6,a6 move.l #HEIGHT-2,d4 ; -2 because we wanted alway 1 pixel minimum show sub.l d3,d4 ble.s .pas0 .boucle: move.w #$0000,(a6) ; erases the difference add.l #NCOL,a6 dbra d4,.boucle .pas0: .boucle2: move.w #$ffff,(a6) ; displays the meter relative to its height add.l #NCOL,a6 dbra d3,.boucle2 addq.l #4,a5 ; next height for the next vu-meter rts joue: dc.l 0,0,0,0 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A4000 Rev B Audio Low One Channel | Loedown | support.Hardware | 4 | 20 March 2013 14:47 |
Amiga audio channel split by hardware? | Amiga1992 | Hardware mods | 58 | 20 January 2013 11:12 |
CD32 Frog Feast test available. Test out the final! | cdoty | News | 42 | 01 April 2008 16:20 |
Virtual "Fifth" audio channel | wanderer | request.UAE Wishlist | 3 | 03 September 2007 20:31 |
Picasso IV 4 Audio Channel Mixer setup | Tony Landais | support.Hardware | 0 | 25 December 2003 15:45 |
|
|