Page 2 of 2

Re: In game beeper music

Posted: Wed Mar 06, 2024 8:43 am
by djnzx48
druellan wrote: Sat Feb 03, 2024 11:05 am Hi! I'm pretty sure I saw a similar thread in the past (can't find it), but a list was never produced, so, I can start a new one here and see how many we can find.
This thread was probably the one which you were thinking of?

Re: In game beeper music

Posted: Wed Mar 06, 2024 9:41 am
by druellan
djnzx48 wrote: Wed Mar 06, 2024 8:43 am This thread was probably the one which you were thinking of?
Yes!!! That one, thanks!

Re: In game beeper music

Posted: Wed Mar 06, 2024 11:09 am
by J. Pirés
Another one:
Sex Tetris (x-rated)
Music: Jacques Offenbach, "Orpheus in the Underworld" [Overture] (CAN-CAN Music)
✓ Reviewed

Re: In game beeper music

Posted: Wed Mar 06, 2024 12:26 pm
by Joefish
Head Over Heels plays short melodies when you pick up various objects, though there's nothing plays continuously. It's really just an extension of the sound effects.

In my own games the beeper sound effects are done by twiddling the speaker bit high/low off the back of a more vital loop of code (e.g. screen or sprite drawing) that's already running at roughly a rate that counts as 'audible' (1-2 scanlines per loop). So the timing is nowhere near good enough to play a note, just farts or squeaks and the occasional crunch. But at least they don't need their own devoted CPU time.
✓ Reviewed

Re: In game beeper music

Posted: Wed Mar 06, 2024 1:02 pm
by J. Pirés
Joefish wrote: Wed Mar 06, 2024 12:26 pm Head Over Heels plays short melodies when you pick up various objects, though there's nothing plays continuously. It's really just an extension of the sound effects.
A similar case is the game 'Jack the Nipper II: In Coconut Capers'. It reproduces different music jingles associated with specific actions without interrupting the gameplay.

Re: In game beeper music

Posted: Wed Mar 06, 2024 1:33 pm
by Art
Snakes & Hazards, Xmas Ludo, Shove-a-Sledge, Tiddly Drinks. On Spectrum 48K, it plays music through the beeper.
✓ Reviewed

Re: In game beeper music

Posted: Wed Mar 06, 2024 3:13 pm
by +3code
J. Pirés wrote: Wed Mar 06, 2024 1:02 pm A similar case is the game 'Jack the Nipper II: In Coconut Capers'. It reproduces different music jingles associated with specific actions without interrupting the gameplay.
In dynamite dan 2 it happens too. I remember that when you take the vinyl to the jukebox, a melody plays. And picking some objects too.

Re: In game beeper music

Posted: Wed Mar 06, 2024 8:22 pm
by J. Pirés

Re: In game beeper music

Posted: Wed Mar 06, 2024 9:18 pm
by ParadigmShifter
So are you saying playing a note at a random point in a frame might sound bad?

In Turbo Manic Miner I played a tune note every couple of frames in the ISR (I also did all my drawing in the ISR for that lol, not doing that these days). That sounded fine to me even though I did the tune update after the draw in the ISR.

I was planning on borrowing some code from that but playing after drawing completes (maybe also in the ISR if an ISR has gone off and it did not play a note the previous frame and it should have).

Unfortunately I do all my draw code with the interrupts disabled (since all the draw routines use the stack to blit the graphics). All drawing is done in only 1 place from a list of what to draw. (When I add the HUD I may draw parts of that which need updating without using the stack though and outside the main draw loop with interrupts enabled - not too bothered if the HUD drawing does not beat the raster). I haven't done much checking whether I ever miss an ISR though (how to do that as well when interrupts are turned off during drawing hmm). It looks to me that nearly all the time drawing has finished within a frame (maybe the game logic that follows could cause it to drop a frame though - but the ISR will be enabled for that so that was why I was thinking of also checking in the ISR if I should update a tune).

I could do the tune playing in the ISR and the drawing afterwards but I don't know how many scanlines playing the note will take, can't be too many since I am drawing directly to the screen and I want to start drawing ASAP after the HALT returns.

EDIT: Ok my code from Manic Miner Turbo just pasted into the code after the drawing has finished is definitely not feasible lol

Image

takes nearly half a frame when the tune timer plays a note (every 4th frame - black border).

Re: In game beeper music

Posted: Thu Mar 07, 2024 12:16 am
by Bubu
I remember this one:

Arcade Zx Collection : TETRIS

https://spectrumcomputing.co.uk/entry/3 ... rum/Tetris

Image Image
✓ Reviewed

Re: In game beeper music

Posted: Thu Mar 07, 2024 10:13 am
by druellan
+3code wrote: Wed Mar 06, 2024 3:13 pm In dynamite dan 2 it happens too. I remember that when you take the vinyl to the jukebox, a melody plays. And picking some objects too.
Dynamite Dan games case is easier to justify, because they have many and recognizable melodies (I added them to the list). In Jack the Nipper II is more tricky, because it plays mostly some escale notes and sound effects, but it has some melodies when you pick up some objects or you complete some actions.

Re: In game beeper music

Posted: Thu Mar 07, 2024 11:55 am
by druellan
J. Pirés wrote: Wed Mar 06, 2024 8:22 pm Cómeme
Stop Ni-gel
Cavelon
Thanks! Cómeme was also missing some credits (specially Sandra Ariza with the level design, love when other members of the family help with the game). That is also fixed.

Re: In game beeper music

Posted: Thu Mar 07, 2024 12:03 pm
by J. Pirés
druellan wrote: Thu Mar 07, 2024 10:13 am Dynamite Dan games case is easier to justify, because they have many and recognizable melodies (I added them to the list). In Jack the Nipper II is more tricky, because it plays mostly some escale notes and sound effects, but it has some melodies when you pick up some objects or you complete some actions.
It's complex but necessary to set the limits; if we include 'Jack The Nipper II' , it opens the door for other games with similar characteristics, like 'Cobra'.

According to as I remember or discover more games with in-game beeper music, I'll put them here, if it's not a problem.

Another one for the list
Stack Up
✓ Reviewed

Re: In game beeper music

Posted: Thu Mar 07, 2024 12:19 pm
by druellan
J. Pirés wrote: Thu Mar 07, 2024 12:03 pm It's complex but necessary to set the limits; if we include 'Jack The Nipper II' , it opens the door for other games with similar characteristics, like 'Cobra'.
Yes, I agree, but we can handle that as we discover more. For now, I'm adding everything that plays a tune in-game for more than a second, and it is a melody, not a scale of notes, etc. I added a new column so we can keep track of the special cases.
J. Pirés wrote: Thu Mar 07, 2024 12:03 pm According to as I remember or discover more games with in-game beeper music, I'll put them here, if it's not a problem.
Of course it is not! This is going to be a group in the database, and a very interesting one, giving that this is considered challenging to do in the system, and for that reason is also a defining feature. Any help to make the list more complete is welcome!

Re: In game beeper music

Posted: Thu Mar 07, 2024 5:22 pm
by Joefish
ParadigmShifter wrote: Wed Mar 06, 2024 9:18 pmSo are you saying playing a note at a random point in a frame might sound bad?
If that was directed at me then no, there's no argument. It doesn't sound bad exactly, just I expect a bit farty as it's constantly stop-start, and it's a harsh-sounding square-ish wave behind that as it's all 1s and 0s and nothing in-between, just like Manic Miner does. But it is vaguely in tune.

What I said was, my code doesn't even bother with the timing necessary to tune a note to the right frequency, it just sends a 1 or a 0 to the speaker from some entirely unrelated loop, like as it copies up each line of the screen. That means the note frequency is completely arbitrary (e.g. a multicolour routine timed to the scan lines could also pump out 0s and 1s at 156 Hz, somewhere just below a D#, or variant harmonics thereof). As I said, good enough for effects; not accurate enough to even play a single good note, let alone a tune (unless you have a whole tune made up of D# played badly in assorted octaves).

Re: In game beeper music

Posted: Thu Mar 07, 2024 5:44 pm
by ParadigmShifter
I can hear occasional clicks anyway if I try and play the manic miner tune after my drawing has finished even if it does not drop a frame.

So I guess the only way to do it would be to play a note in the ISR at the beginning but as you can see from the timing that takes too long for me to start drawing afterwards and then still be ahead of the raster.

So I'm probably going to forget about that and just not play any ingame tune :(

Here is the code I use to play the Manic Miner tune (I think this was straight out of the Manic Miner source, maybe I modified it slightly, all the data addresses changed anyway)

Code: Select all

	; play tune
	ld a, (tune_tick)
	dec a
	ld (tune_tick), a
	jr nz, .skipnote
	ld a, (tune_offset)
	inc a
	ld (tune_offset), a
	ld a, 4

.playnote
	ld (tune_tick), a
	ld a, (tune_offset)
	and #7e
	rrca
	ld e, a
	ld d, 0
	ld hl, tune_data
	add hl, de
	ld a, (bdr_colour)
	ld e, (hl)
	ld bc, 3
.tuneloop
	out (#fe), a
	dec e
	jr nz, .noflip
	ld e, (hl)
	xor #18
.noflip
	djnz .tuneloop
	dec c
	jr nz, .tuneloop
.skipnote
Here is the data for the tune

Code: Select all

bdr_colour db 0 ; black border

tune_offset		db 0
tune_tick		db 4
tune_data		db #80, #72, #66, #60, #56, #66, #56, #56, #51, #60, #51, #51, #56, #66
			db #56, #56, #80, #72, #66, #60, #56, #66, #56, #56, #51, #60, #51, #51
			db #56, #56, #56, #56, #80, #72, #66, #60, #56, #66, #56, #56, #51, #60
			db #51, #51, #56, #66, #56, #56, #80, #72, #66, #60, #56, #66, #56, #40
			db #56, #66, #80, #66, #56, #56, #56, #56
If I change

ld bc, 3

to

ld bc, 2

it uses a bit less time (still too much though) and it still sounds ok. If I change it to 1 instead it sounds bad ;)

Re: In game beeper music

Posted: Fri Mar 08, 2024 7:41 pm
by J. Pirés
More games with in-game beeper music for the list:

Chinese Juggler
Carpet Capers
Donkey Kong Jr.
Fizzy Wizzy
Cobra (Occasional short tunes)
✓ Reviewed

Re: In game beeper music

Posted: Fri Mar 08, 2024 10:38 pm
by WhatHoSnorkers
I did a Snorkified version of "Ant Hill" from "Spectrum Gamesmaster" where it plays a beeper tune. In BASIC.

It's horrendous, a sort of arpeggiated version of "The Ants Are Marching Two By Two...".

Re: In game beeper music

Posted: Mon Mar 18, 2024 9:44 am
by sn3j