BEEPOLA: Exiting after every note

On the creation of AY or Beeper music, including the packages used to do so.
Post Reply
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

BEEPOLA: Exiting after every note

Post by Bubu »

Jarl, torpedos!

Hi, all!

I'm using BEEPOLA as a great tracker to make music for the Spectrum 48K, but I need to exit from the player after every note is played, do things in my program, and then come back to play the following note with something like "CALL NEXT_NOTE"
I'd like to have an engine that makes a 2 channel sound and a drum.
I know that the following engines can exit after every note:

- The Music Box: PROBLEM -> You can't do a note and a drum bit at the same time.
- The Music Studio: PROBLEM ->I don't like that sound. The sound I need is the same as the music box engine
- ROM Beep: PROBLEM -> No drums

I've been trying to modify the Music Studio, Phaser 1 and Tritone engines, with no success at all.
Has any of you been able to modify an engine to get out of the player after every note? Or is any author of any BEEPOLA engine in this forum?
If something works, don't touch it !!!! at all !!!
User avatar
Morkin
Bugaboo
Posts: 3277
Joined: Mon Nov 13, 2017 8:50 am
Location: Bristol, UK

Re: BEEPOLA: Exiting after every note

Post by Morkin »

I've previously tweaked the Music Box code that Beepola creates, but only to run a quick Kempston joystick check between each note, to see if the player is using Kempston and pressed the fire button (to stop the tune).

It may have changed, but I think the exported code contains this bit:

Code: Select all

NEXTNOTE:
                          CALL  PLAYNOTE
                          XOR   A
                          IN    A,($FE)
                          AND   $1F
                          CP    $1F
                          JR    Z,NEXTNOTE                    ; Play next note if no key pressed

                          EI
                          RET                                 ; Return from playing tune
After the CALL PLAYNOTE I think you can insert whatever code you like. You'll have to preserve registers (e.g. pointers to where in the current tune pattern you are) if you want to get back to the next note in the tune.

As far as drums are concerned I'm not sure what it'd sound like to use this gap to shove in a drum hit (especially for Music Box, as it's quite legato-sounding). My guess is it'd be better to use another engine that has drums integrated a bit more, but others may have suggestions.
My Speccy site: thirdharmoniser.com
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: BEEPOLA: Exiting after every note

Post by Bubu »

It's esasy to find out where to return after a note has been played, but the thing is how hard is to find out what registers, stack, darta in ram... to save before exiting. I've been trying to do it in the Tritone engine, but I have to give up... or almost.

Thanx anyway, @Morkin
If something works, don't touch it !!!! at all !!!
User avatar
utz
Microbot
Posts: 116
Joined: Wed Nov 15, 2017 9:04 am
Contact:

Re: BEEPOLA: Exiting after every note

Post by utz »

Have a look at the modified Tritone player in z88dk.
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: BEEPOLA: Exiting after every note

Post by Bubu »

Hi, @utz , I've been googling that but can't find any difference between the Tritone engine included in Beepola, and those in z88dk. I mean, the engine plays the full song or exits after a key is pressed, but you can't exit after a note, do things (move a sprite...) and then come back to the engine and go on from the same point you were before.
Have you any link where this is done?
If something works, don't touch it !!!! at all !!!
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: BEEPOLA: Exiting after every note

Post by hikoki »

Hi. Dunno if this demo can be of your interest.

https://github.com/z88dk/z88dk/tree/mas ... mo_tritone
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: BEEPOLA: Exiting after every note

Post by hikoki »

See what Beepola's manual says about the Music Box engine to have ingame music
http://freestuff.grok.co.uk/beepola/help/compiling.html
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: BEEPOLA: Exiting after every note

Post by Bubu »

hikoki wrote: Fri Aug 18, 2023 5:27 pm Hi. Dunno if this demo can be of your interest.

https://github.com/z88dk/z88dk/tree/mas ... mo_tritone
Not really, there'snt any example I'm looking for: exit after every note.

hikoki wrote: Fri Aug 18, 2023 5:46 pm See what Beepola's manual says about the Music Box engine to have ingame music
http://freestuff.grok.co.uk/beepola/help/compiling.html
Mmmm... the thing is that Music Box can't play a musical note and a drum bit at the same time, or at least I don't know how to do it.
If something works, don't touch it !!!! at all !!!
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: BEEPOLA: Exiting after every note

Post by Bubu »

Now I'm tryning the "Lindon Sharp MB" engine implemented in the "1tracker", it's seems not so difficult to implement the exit after every note.
I'll let you know when I do the tests.
If something works, don't touch it !!!! at all !!!
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: BEEPOLA: Exiting after every note

Post by hikoki »

How is it made in Manic Miner? Dividing each note in micronotes of the same duration? Ir produces a ratchet effect, sort of a percussion ;)
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: BEEPOLA: Exiting after every note

Post by Bubu »

I think that Manic Miner uses only 1 note at the same time (semiquavers), even I use more or less the same technique in my ArcZX-Tetris, but this is with 2
polyphony tones. But what I need now is something a bit more... professional, with good drums.
If something works, don't touch it !!!! at all !!!
User avatar
utz
Microbot
Posts: 116
Joined: Wed Nov 15, 2017 9:04 am
Contact:

Re: BEEPOLA: Exiting after every note

Post by utz »

Bubu wrote: Fri Aug 18, 2023 5:04 pm Hi, @utz , I've been googling that but can't find any difference between the Tritone engine included in Beepola, and those in z88dk.
My bad, I thought they had a modified version that can be called note-by-note, but apparently that's not the case.
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: BEEPOLA: Exiting after every note

Post by Bubu »

I did it! I started with the "A" engine and then modified the code so that it exits on every note played, rather than on a key press. This engine sounds totally the way I like (arcadish), with drums, and it's very easy to customize and modify.

:dance :dance :dance :dance :dance



If there is any interest in this, ask me and I'll upload the code here, which only has about 230 lines.
If something works, don't touch it !!!! at all !!!
User avatar
Mpk
Dynamite Dan
Posts: 1008
Joined: Tue Feb 09, 2021 8:10 am

Re: BEEPOLA: Exiting after every note

Post by Mpk »

Bubu wrote: Sun Aug 20, 2023 5:09 pm If there is any interest in this, ask me and I'll upload the code here
Hey, can you upload the code?
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: BEEPOLA: Exiting after every note

Post by Bubu »

Sure! :lol: Have you trying to add some in-game music in any game of yours? Let me rewrite a little bit the code and then I'll post it here.
If something works, don't touch it !!!! at all !!!
Post Reply