In game beeper music

General software. From trouble with the Banyan Tree to OCP Art Studio, post any general software chat here. Could include game challenges...
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: In game beeper music

Post 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?
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: In game beeper music

Post 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!
User avatar
J. Pirés
Drutt
Posts: 31
Joined: Tue May 09, 2023 10:58 am
Location: Spain

Re: In game beeper music

Post by J. Pirés »

Another one:
Sex Tetris (x-rated)
Music: Jacques Offenbach, "Orpheus in the Underworld" [Overture] (CAN-CAN Music)
✓ Reviewed
RANDOMIZE USR 1333
User avatar
Joefish
Rick Dangerous
Posts: 2059
Joined: Tue Nov 14, 2017 10:26 am

Re: In game beeper music

Post 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
User avatar
J. Pirés
Drutt
Posts: 31
Joined: Tue May 09, 2023 10:58 am
Location: Spain

Re: In game beeper music

Post 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.
RANDOMIZE USR 1333
Art
Manic Miner
Posts: 206
Joined: Fri Jul 17, 2020 7:21 pm

Re: In game beeper music

Post by Art »

Snakes & Hazards, Xmas Ludo, Shove-a-Sledge, Tiddly Drinks. On Spectrum 48K, it plays music through the beeper.
✓ Reviewed
User avatar
+3code
Manic Miner
Posts: 433
Joined: Sat Mar 19, 2022 7:40 am

Re: In game beeper music

Post 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.
User avatar
J. Pirés
Drutt
Posts: 31
Joined: Tue May 09, 2023 10:58 am
Location: Spain

Re: In game beeper music

Post by J. Pirés »

RANDOMIZE USR 1333
User avatar
ParadigmShifter
Manic Miner
Posts: 671
Joined: Sat Sep 09, 2023 4:55 am

Re: In game beeper music

Post 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).
User avatar
Bubu
Manic Miner
Posts: 542
Joined: Fri Apr 02, 2021 8:24 pm
Location: Spain

Re: In game beeper music

Post by Bubu »

I remember this one:

Arcade Zx Collection : TETRIS

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

Image Image
✓ Reviewed
If something works, don't touch it !!!! at all !!!
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: In game beeper music

Post 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.
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: In game beeper music

Post 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.
User avatar
J. Pirés
Drutt
Posts: 31
Joined: Tue May 09, 2023 10:58 am
Location: Spain

Re: In game beeper music

Post 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
RANDOMIZE USR 1333
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: In game beeper music

Post 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!
User avatar
Joefish
Rick Dangerous
Posts: 2059
Joined: Tue Nov 14, 2017 10:26 am

Re: In game beeper music

Post 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).
User avatar
ParadigmShifter
Manic Miner
Posts: 671
Joined: Sat Sep 09, 2023 4:55 am

Re: In game beeper music

Post 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 ;)
User avatar
J. Pirés
Drutt
Posts: 31
Joined: Tue May 09, 2023 10:58 am
Location: Spain

Re: In game beeper music

Post 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
RANDOMIZE USR 1333
User avatar
WhatHoSnorkers
Manic Miner
Posts: 254
Joined: Tue Dec 10, 2019 3:22 pm

Re: In game beeper music

Post 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...".
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
sn3j
Manic Miner
Posts: 500
Joined: Mon Oct 31, 2022 12:29 am
Location: Germany

Re: In game beeper music

Post by sn3j »

POKE 23614,10: STOP      1..0 hold, SS/m/n colors, b/spc toggle
Post Reply