popmilo Posted February 19, 2018 Share Posted February 19, 2018 Hi guys !Anybody knows how to stop RMT music play but keep sfx playing ?I've tried stopping music, disabling irq (that calls music play), but I either get music+sfx or nothing... I would like to turn of music so it doesn't waste cpu time, but keep possibility of playing sfx when needed. Any help appreciated ! Vladimir Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted February 19, 2018 Share Posted February 19, 2018 Looking at the player's entry points, wouldn't the rmt_sfx be the desired call?e.g. set A,X and Y and then JSR RASTERMUSICTRACKER+15 RASTERMUSICTRACKER jmp rmt_init jmp rmt_play jmp rmt_p3 jmp rmt_silence jmp SetPokey IFT FEAT_SFX jmp rmt_sfx ;* A=note(0,..,60),X=channel(0,..,3 or 0,..,7),Y=instrument*2(0,2,4,..,126) EIF rmt_init Quote Link to comment Share on other sites More sharing options...
vitoco Posted February 20, 2018 Share Posted February 20, 2018 Just add an empty song line with a loop to that line in the RMT file and initialize to it when you want to shut up the other voices. ldx #<MODUL ;low byte of RMT module to X reg ldy #>MODUL ;hi byte of RMT module to Y reg lda #Silence ;starting song line 0-255 to A reg jsr RASTERMUSICTRACKER ;Init I hope this helps... 3 Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 20, 2018 Share Posted February 20, 2018 Generally wouldn't you want to resume music playback where it stopped? The silence call would be the way. I thought about this problem and associated things in the past. The solution I deduced is to modify the player to store to shadow registers for AUDC/F etc. Then copy those registers to Pokey with your own code. This was in aid of doing buffering of music data for situations where you wanted maximum CPU availability. Such a method could also allow selective muting or quieting of part or all of the song instruments while keeping effects at normal volume. Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 20, 2018 Author Share Posted February 20, 2018 Thanks guys ! @Wrathchild: sfx is not a problem. It works so good that I don't need music at all @Vitoco: sounds like most promising solution. Will try when I get home ! @Rybags: My game has music on title screen and then when game starts only sfx. When player dies or gets to the end of level I need to play another "song". So no resume music needed. Call to "stopmusic" did nothing for me. Music plays as without that call... Who knows, maybe I didn't setup something properly. Shame we only have such a limited choice of music trackers on A8. Would be great to have something current with online repo that we could all contribute to. If I had any music inclination or talent I would jump on it, but alas I'm total anti-talent music wise Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 20, 2018 Share Posted February 20, 2018 It's been a while... possibly an empty "null" song or something could help. Quote Link to comment Share on other sites More sharing options...
shanti77 Posted February 20, 2018 Share Posted February 20, 2018 I use goto procedure to fast change music pattern. 1 Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 20, 2018 Author Share Posted February 20, 2018 I use goto procedure to fast change music pattern. What exactly do you mean by "goto procedure" ? Quote Link to comment Share on other sites More sharing options...
shanti77 Posted February 20, 2018 Share Posted February 20, 2018 (edited) I use "goto" procedure to play chosen song line. I use "Init" only on beginning. Song lines takes last bytes of .rmt file. rmt_goto=last address of song.rmt + 1 - (number of song_lines)*4 then mwa #rmt_goto+number_song_line_to_play*4 p_song jsr GetSongLine example: if I load song.rmt to adr=>from $A506 to $B6FF , and I have song lines from 00 to $1E, and I want play 6 song line rmt_goto= $B6FF+1-1F*4 ;= $B6FF - $7B = $B684 mwa #rmt_goto+6*4 p_song jsr GetSongLine Edited February 20, 2018 by shanti77 1 Quote Link to comment Share on other sites More sharing options...
vitoco Posted February 20, 2018 Share Posted February 20, 2018 My game has music on title screen and then when game starts only sfx. When player dies or gets to the end of level I need to play another "song". So no resume music needed. That is very similar to what I did in my game Toy'Swap. The RMT has a main song for the title screen, a song for the end of game (just some chords), and a blank song. During the game it is possible to toggle on/off the same main title by pressing OPTION, which swaps between the main and the blank songs, but by default the main song is on. Quote Link to comment Share on other sites More sharing options...
MaPa Posted February 20, 2018 Share Posted February 20, 2018 You can set RMTGLOBALVOLUMEFADE variable to $F0 (if this feature is used) to mute the music and SFX will still work. Only that the music play continues and eats the CPU time. Quote Link to comment Share on other sites More sharing options...
shanti77 Posted February 20, 2018 Share Posted February 20, 2018 (edited) With "rmt_goto" you can off music (go to songline with empty tracks) but not stop gfx. This method is also faster than rmt_init. Edited February 20, 2018 by shanti77 Quote Link to comment Share on other sites More sharing options...
Sheddy Posted February 20, 2018 Share Posted February 20, 2018 This thread reminds me, I wanted to see why songs that end by just looping on a blank line suck so much CPU. All the songs I had for my project do that, but is there a better way of a song ending itself? Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted February 20, 2018 Share Posted February 20, 2018 (edited) The original music you had before the switch to rmt appeared to no have that problem. Sure would have made life easier as you were getting ready to let the bird leave the nest if rmt didn't eat as much as it did. Edited February 20, 2018 by _The Doctor__ Quote Link to comment Share on other sites More sharing options...
Sheddy Posted February 21, 2018 Share Posted February 21, 2018 Much more basic than RMT though, certainly nothing a musician could do anything fabulous with. Just a slightly extended sfx player. Quote Link to comment Share on other sites More sharing options...
peteym5 Posted February 21, 2018 Share Posted February 21, 2018 Make a blank song line somewhere and loop back to it inside the RMT song file. Either at the end of the song file. For Multiple songs on one file, just goto where the loop is. If you want your program to stop the song after a time or some event, just set song line to where the loop is. Quote Link to comment Share on other sites More sharing options...
Sheddy Posted February 21, 2018 Share Posted February 21, 2018 That's pretty much what I thought they are doing already. I will have another look though as CPU use on end loop may not be as bad as I remember. Thanks Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 22, 2018 Author Share Posted February 22, 2018 Hmmm.... Something is seriously wrong with my code... Although I can't find errors Only way I managed to silence the song is by deleting all song data from my RMT file, and inserting single empty line at position zero, and loop back to it. That way game starts silent and all sfx work. What ever I tried with setting start position in song didn't work... Code I tried is this: ldx #<MODUL ;low byte of RMT module to X reg ldy #>MODUL ;hi byte of RMT module to Y reg lda #$0A ;starting song line 0-255 to A reg jsr RASTERMUSICTRACKER ;Init What ever I put in aumulator doesn't change a thing. Song always started from start.... I looked for any other kind of init that would mess with that and didn't find any.... If anyone has a simple music play src demo with rmt file I would appreciate if you could upload it here for testing with my own rmt. Thanks ! Quote Link to comment Share on other sites More sharing options...
Sheddy Posted February 22, 2018 Share Posted February 22, 2018 You are just doing "jsr rastermusictracker+3" in VBI, nothing else? Quote Link to comment Share on other sites More sharing options...
shanti77 Posted February 22, 2018 Share Posted February 22, 2018 How you do export RMT? You must check only SFX support , enter start address and use "Copy all to clipboard" then , paste it to rmt_feat.asm Rmt_player takes also memory before PLAYER address.(-$400) Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 22, 2018 Author Share Posted February 22, 2018 You are just doing "jsr rastermusictracker+3" in VBI, nothing else? Yes. Once per frame I call it just like that. And music plays so I don't see a problem there... How you do export RMT? You must check only SFX support , enter start address and use "Copy all to clipboard" then , paste it to rmt_feat.asm Rmt_player takes also memory before PLAYER address.(-$400) SFX support is checked and I guess that's why sfx work. I do copy rmt_feat settings to my source. Memory before PLAYER is reserved ... I will check that to make sure it isn't used by anything else... Looking at that setting "play song always from 0" looks like exactly what my xex is doing... Even thou that flag is not set. I'll try experimenting with it... If it doesn't help, I'll make a small example and post it here, so some good person could compare it and maybe discover what's going on Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.