.bbsong files don't actually play on a zx spectrum, but .tap files do
BotB Academy Bug Reports and Feature Requests
Level 23 Mixist
post #15602 :: 2011.03.24 6:24pm
  Interrobang Pie, raphaelgoulart, KungFuFurby and goluigi liēkd this
Why is it that until today with my blood sweat and tears (ok that's *QUITE* an overstatement) coding my own driver, that EVERY. ZXBEEP. ENTRY. is a .bbsong file?

BBSONG FILES BY THEIR OWN *DO NOT RUN ON A ZX SPECTRUM*. This would be like someone uploading an .ftm file to an NSF compo.

Furthermore, does anybody notice the "Compile Song" feature? USE IT YOU HERETIC.

So, here's my proposal.
- Forbid .bbsong uploads and tell people to use the "Compile song" feature.
- Permit .tap and .tzx uploads. A lot of emulators can accelerate loading, but I find these quite fun.

This *shouldn't* be unpopular. You have a "Compile song" feature, USE IT.

Or I'll upload stuff in .tfm format. (Not TFM maker, but TurboFM. It's a tracker I've made and haven't released let alone finished.)
Level 22 Chipist
post #15603 :: 2011.03.24 6:28pm
I agree with this, and I have thought this before. It is agreed with.
Level 24 Chipist
post #15604 :: 2011.03.24 6:32pm
  raphaelgoulart, Slimeball, Modus Ponens, Soiled Bargains and ElHuesudoII liēkd this
i wouldn't mind people uploading .ftm to nsf compo :3
Level 27 Mixist
post #15607 :: 2011.03.24 6:56pm
im agree too add the right format and the right player would be good!
Level 16 OHCist
Soiled Bargains
post #15610 :: 2011.03.24 7:24pm :: edit 2011.03.24 7:27pm
My, my.

I see it as people being too lazy to try and find a good ZX emulator. In the case with my recent 1-bit wonder, I just went with the flow with the rest of the Spectrum Beeper entries.
Level 27 Renderist
post #15611 :: 2011.03.24 9:05pm
  anewuser liēkd this
iamgreaser: why not create the stub format that encompasses PLAY, INIT, LOAD addresses? BotB could make the Speccy stub format for Beepola to save to and a player of the stub format could be created for the Spectrum by possibly Shiru and someone else could code the plugin or player for PC.
Level 10 Chipist
post #15620 :: 2011.03.25 12:35pm
  b00daw liēkd this
There is AY format for these things, and my tool to make AY files from TAPs created with Beepola. Some details: http://shiru.untergrund.net/1bit/pivot/entry.php?id=91

iamgreaser, could you give more details about your driver, so I'd made a post in the 1-bit blog?
Level 23 Chipist
irrlicht project
post #15626 :: 2011.03.26 9:21am
  goluigi, Slimeball and anewuser liēkd this
i strongly disagree on this - .bbsong files are very nice because it enables users to learn from each other.
regarding accuracy, NONE of the existing emulators come even close to emulating the beeper correctly. so unless everybody goes and buys a real Speccy it's not really necessary to provide files usable with emulators - if someone wants .tap, they can always compile it themselves. besides, the compiling feature in beepola is rather buggy and frequently fails to compile Savage and SpecialFX songs correctly.
also let's not start a discussion about .tzx - i like the format but many people don't ;)
Level 25 Mixist
post #15630 :: 2011.03.26 3:01pm
Is there some kind of issue with the compiling feature in beepola, as far as getting the .tap to work on a real speccy?

I was contacted by YERZMYEY, who runs this site: http://z80.i-demo.pl/ , asking for the .tap for my dungeon babe tune. I compiled it through beepola and sent it to him, but there was apparently a problem. I really couldn't understand what he was saying, being that I've never even SEEN a speccy with my own eyes and don't know how it works/the lingo(?):

"Actually I need the TAP _exactly_ to record it from real hardware and add to my portal site"

I bring this up cos I'm wondering how many people have actually rendered the bbsong to .tap and successfully got it to work on the hardware/emulator.

But to keep this post on topic, I'm saying I agree with irrlicht.
Level 16 OHCist
Soiled Bargains
post #15634 :: 2011.03.26 3:33pm
The ZX Spectrum loads programs from casette tapes. I guess YERZMYEY (one of few ZX music masters) is requesting a physical tape?
Level 30 Mixist
Baron Knoxburry
post #15639 :: 2011.03.26 4:07pm
I've always wondered what this stuff would actually sound like. It's a crappy metal coil speaker right? Like the ones commonly used on old PC's? Probably only has a single volume that you can't rock when your parents are asleep.
Level 27 Renderist
post #15641 :: 2011.03.26 4:16pm
Shiru: Wasn't aware of that. AY and beeper are completely different. As you also know that the 'buzzer' and 'beeper' are different as well. I guess it makes sense that it would work as *.AY format since it's emulating the hardware anyway.

I guess all Beepola songs should be exported to *.AY format and *.AY format should be preferred. This is also being that *.AY format should also be playable on hardware.

Shiru: Are *.AY beeper music files playable by any known hardware player?
Level 16 OHCist
Soiled Bargains
post #15646 :: 2011.03.26 5:03pm
b00daw: I'm for .AY, but irrlicht project brings up a good point about how well the files export.
Level 22 Chipist
post #15650 :: 2011.03.26 6:04pm
irrlicht project: first of all, it is better for users to learn from eachother, but bbsong is a source format, and so is .ftm, but not everyone can play those. Second of all, if beepola doesn't compile well, then that's like a tracker that doesn't compile to nsf well. It's the creator of the tracker's problem, and there are multiple buzzer trackers.
Level 10 Chipist
post #15651 :: 2011.03.26 6:05pm
Never had any problem with TAP (and other) export in Beepola, and I've exported like few tens of songs for sure.

Actual ZX Spectrum has small built-in speaker with plastic membrane, just like in cheap headphones (search for 'zx spectrum pcb' in Google image search). It has no adjustable volume. It is possible to redirect sound to tape output (or output to both tape and speaker, or even make some 'stereo').

Haven't heard about hardware players, but it is possible to play *.ay file on actual ZX.
Level 25 Mixist
post #15656 :: 2011.03.26 8:09pm :: edit 2011.03.26 8:52pm
Level 23 Mixist
post #15691 :: 2011.03.29 1:35am
"regarding accuracy, NONE of the existing emulators come even close to emulating the beeper correctly."
... serious? It shouldn't be that hard. The worst that should happen is that the pitches would sound all weird due to incorrect timing, and I don't believe anyone does the "PCM" trick that you can do on the PC speaker (which requires a little bit of low-pass filtering).

"if someone wants .tap, they can always compile it themselves." <-- Not everyone has Wine let alone Windows (e.g. last time I checked, NetBSD didn't have a Wine port). Depending on Wine is STUPID.

From what I gather, .ay is for the AY chip and not the coil speaker, though I could be wrong. Nevertheless, .sna should be sufficient.
Level 10 Chipist
post #15692 :: 2011.03.29 6:07am
Problem with low quality beeper emulation is serious. It is all about resampling, you can produce frequencies above 200 kHz with beeper, and actual multichannel engines often produce frequencies above the audible range.

I gave link to explaination how the AY format could be used with beeper music, why take guesses if you could just read and know for sure?
Level 27 Renderist
post #15693 :: 2011.03.29 7:17am :: edit 2011.03.29 7:18am
  anewuser liēkd this
The quality of the *.AY files are rather poor on most players.

Here is RushJet1's entry:


I did some research, and according to Bulba's site, the *.AY format was indeed made to support 48K music in version 3.

PlayerVersion:byte; //Required player version. Micro Speccy
//works as player of version 3.
//Now available values:
//0 Use zero, if you do not
// know what player version
// you need
//All other player versions and short
//description of these players next:
//1 initial player version
//2 first 256 bytes is
// filled with 0xC9 (ret),
// not just last init byte
//3 PC rewrite, different
// Z80 init routine, full
// Z80 emulation, supports
// 48k tunes.

Also it appears that there are no good Winamp/XMPlay plugins for Beeper. NEZPlug++ is very poor for Beeper *.AY format tunes. Per ant1, I've found that Bulba's AY_EMUL is probably the best I've heard so far.

So indeed the problem is emulation and convenience. Either or *.AY still appears to be the superior format as it could be played by any player (including hardware) but is not currently up to standards.

In conclusion, I think it would be best to output to *.AY format and then play on AY_EMUL (as it is both for Windows and Linux as well.)
Level 10 Chipist
post #15696 :: 2011.03.29 8:41am
Why you need to do research to ensure if there is beeper support in AY files, if I said it here two times, also said that I've made a tool that converts Beepola output to AY, and linked article with all the details?

The format itself is more or less OK. Bad things are documentation (not too clear), and that ROM data is not presented in emulated machine, and many engines need it to work correctly, so you have to put it into every AY file if needed. The problem with the sound is not with the format, but with the players, they have poor beeper emulation, just like emulators do. AY Emulator is maybe best of available players, but not too good - check any Music Box or Phaser1 music in AY format.
Level 27 Renderist
post #15697 :: 2011.03.29 9:15am :: edit 2011.03.29 9:16am
I do research because I find things on my own before trusting the first source. :D

That is my conclusion too, but thanks for the clarification and helping make the issue have more solidarity.

Is the beeper hard to emulate because of the expected sound output from a single beeper? A piezo beeper, a clockrate, emulation of the opcodes and registers used, register and memory mapping, etc... is all that should be needed emulated. What is the general issue? My guess is poor emulation of the electronics between the processor and the beeper, a filter needed for truer hardware piezo beeper sound, or.. I dunno, really. I'm not an expert on Speccy or beeper.

Your thoughts?
Level 10 Chipist
post #15698 :: 2011.03.29 10:06am
  anewuser liēkd this
'It is all about resampling, you can produce frequencies above 200 kHz with beeper, and actual multichannel engines often produce frequencies above the audible range'.

'Actual ZX Spectrum has small built-in speaker with plastic membrane, just like in cheap headphones', there is no piezo beeper in original ZX Spectrum models.

Most emulators apply a filter, which sometimes makes sound more similar to the real thing, but they sometimes filter too much or not enough.

I guess some small part of the problem in some cases could also be in emulation of OUT opcodes, because actual change of port value happens somewhere in middle of the opcode execution, not exactly when it begins or ends.
Level 23 Chipist
irrlicht project
post #15699 :: 2011.03.29 10:09am
  anewuser liēkd this
regarding the emulation, there are 2 issues. first and most problematic is indeed poor emulation of the actual hardware circuitry. this concerns mostly 3 sound characterisics, namely hardware delay, high frequency filtering, and differences in bass (eg. phaser1 has less bass than savage on real hardware). the latter 2 shouldn't be too hard to emulate. however to emulate the hardware delay would take some research and precise measuring. also this is not about only about the beeper (it's not exactly piezo), you get the same hardware effects if you take sound from the EAR port which bypasses the beeper.
second issue is as described by shiru. zx beeper routines operate with up to 400 kHz, which is impossible to reproduce accurately on a 44.1 kHz soundcard.

regarding the formats, let me sum up the discussion.
.tap/.tzx - easy to run on both hardware and software. however not all beeper editors can produce them, and converting from other formats can be rather messy. also note that not all emulators can save .tap files.
.sna/.z80 - works on most emulators and can easily produced with all engines. doesn't run on hardware, though.
.ay - highly compatible on both hardward and software, but existing converters cover only a few engines.

so as long as there is no dedicated beeper file standard, i think the best solution would be to keep a variety of formats. .bbsong could be dropped in the future, but i think the easy accessability of the format has contributed a lot to the popularity of beeper music here on botb.

@iamgreaser oh don't worry, speccy can do the PCM trick as well: http://parishq.net/proposed//sound/mister_beep-digital_world.mp3
but yeah i hope you're gonna publish your 1bit routine!!!
Level 23 Mixist
post #15700 :: 2011.03.29 11:14am
Uh yeah, here's the code I used for that entry: http://pastebin.com/HDU8DnjL

It's not exactly the most flexible routine (it just loops 256 notes). I also used a few python scripts, one outputs it to a .tap, while another converts raw samples into the required 1-bit form. I also have a simple BASIC stub.

The LD bc,$000A line just before the epic loop is the song speed in a weird way - look at the code to see why (DJNZ / DEC c / JP nz) before you screw around with it (to increase the speed by $80, you'd have to do $800B -- I think).

The samples I used were CloseHihat, BassDrum3, and Snare5 (I think these are all ST-01 samples) resized to 2048 samples and then converted to 1-bit samples. Note: this reads LSB first.

When assembling with WLA-DX (that's what I used, btw), use a linkfile that only contains the outputted object, and link as a program (-b) rather than a ROM (-r) if you're taking the .tap route. Then, shove in a BASIC stub, wrap the file in a .tap header/data block pair, and you should be ready to go.

More info here (and as you can possibly tell, checksums are dead simple to calculate): http://www.zxmodules.de/fileformats/tapformat.html
Level 24 Chipist
post #15721 :: 2011.04.01 9:22am
i have some questions re: AY format

1) all AY players support beeper or just some?
2) AY players for zx spectrum will run on a 16/48k with no AY? seems improbable but i guess this is not much of an issuue seee belowwwww....

i think it's much more important to focus on other things (must have windows/mac/linux player, must be convenient to create from beepola in a small amount of time (1hr), etc) than to first worry about playing back on hardware, which is something that maybe only 1 or 2 users would want to do. i doubt any person here is intending to listen to all battle entries on hardware before voting so i really think that it's not something that should be top priority at all
Level 10 Chipist
post #15731 :: 2011.04.01 6:02pm
1) Some, because beeper support wasn't in the standart from the beginning. It was added really long ago, though, so chances you'll use a player that is so old are low.

2) SpecAY is for 128K. I think it is doable to convert an AY file with beeper music into loadable program for 48K, seems it just wasn't needed yet.
Level 22 Chipist
post #15743 :: 2011.04.02 1:40pm
emulator compatibility is not botb's problem, in my opinion.
Level 23 Chipist
irrlicht project
post #15868 :: 2011.05.04 6:42am
  iamgreaser liēkd this
paging mister greasemonkey!
was going to add your beeper routine to our 1bitblog (..), but i realized there is probably little point in doing so without proper documentation.

would you care to make a zip file containing player code, example song, some drums, and a bit of documentation (ie what you wrote some posts above)? i can also host this if you don't have space.
Level 23 Mixist
post #15907 :: 2011.05.22 11:45pm
irrlicht project: There's nothing to it really, uhh, let's see what I can recall...

ins_* stuff must be aligned to a 256-byte boundary.

ins_sq1 and ins_sq2 are for your notes. output_frequency = some_frequency * value_given. Yes, you use harmonics (!), not a 12-note scale. If you want to, you can try slowing it down by chewing cycles or something, but be warned that it slows the drums down (which AFAIK wouldn't be a bad thing).

ins_drm is just a list of pointers, except only the upper byte is stored, and the lower byte of the pointer is treated as $00. If you don't want a drum to play at the given tick, use smp_blank>>8.

If you want to change the drum volume, find the "and 24" and change it, the number is your volume. Or something like that.

Drums don't loop.

The line that says "ld bc,$000A" can be changed if you want a different speed, I think, though I suspect that B has to be $00.

Anyways, dev directory: http://pubacc.wilcox-tech.com/~greaser/stuff/jeep.zip

smp21bit.py converts a 2048-byte raw sample (signed/unsigned doesn't matter) into a 256-byte 1-bit sample.
Level 23 Chipist
irrlicht project
post #15910 :: 2011.05.23 10:22am
ahh good, you heard my call after all ;)
anyway, could you please add a readme.txt to the zip with the stuff you mentioned in your last 2 posts? also how do you want the engine to be called and how should i credit you? iamgreaser or just greaser?
Level 27 chipist
post #49499 :: 2014.11.14 12:46pm
damn cars own the road you may as well just treat the tarmac like a sheer drop these days
Level 26 Chipist
Lukas Eriksson
post #49503 :: 2014.11.14 1:11pm
i no rite
Level 27 Chipist
post #49537 :: 2014.11.15 6:44am :: edit 2014.11.15 6:54am
  goluigi liēkd this
Not sure why this topic got bumped, but I'll add my two cents:

.bbsong files are the worst formats for me to play for ZX Spectrum music in because Beepola is for Windows computers only (I don't accept WINE as a multi-platform solution: that's only because these days the latest and greatest seem to run on Intel processors only).

I've actually run afoul myself because the .tap files I produced for my earliest ZX Spectrum music was exported directly from an actual ZX Spectrum application (specifically: the ZX Spectrum version of Phaser1), and therefore I realized that it didn't record the player code to the tape. I rendered those immediately because I couldn't re-import them into the emulator, presumably because of the emulator deciding to import them to a wrong memory location since none was defined.

I have yet to make any ZX Spectrum music on the Intel Mac. In the past, I made .sna files instead of .tap files on the grounds that I could more easily edit data in .sna files in a hex editor. This was especially important because I used a DOS version of SJASMplus, which was missing support for a key parameter, meaning I had to work off of the example files to correct this issue.
Level 22 Chipist
post #49564 :: 2014.11.16 12:52am :: edit 2014.11.16 12:53am
I totally agree with KFF.

Also, while .bbsong is not ZX Spectrum friendly, .ay might be managable for both AY and beeper since tiboh/debris wrote an .ay player for the real Spectrum.
Level 27 Chipist
post #49570 :: 2014.11.16 8:46am
I am now in the process of attempting to get the two earliest .tap files made with Phaser1 to a workable condition (My Tritone and Octode music are in .sna format, and therefore they're much better off than the Phaser1 music I made, so they're de-prioritized). I have determined what data I need to make the music work standalone (I found a Phaser1 player in the original .tap file with demonstration player and music)... so now all I need to do is debug and get the tape to load.

LOGIN or REGISTER to add your own comments!