501

(22 replies, posted in Sinclair)

Cheers guys wink
Ok, here's an updated version in action: http://irrlichtproject.de/transfer/pytha-demo2.mp3
While still not clean (of course, it's beeper, damnit big_smile), there's a slight but noticable improvement I'd say. Btw just to be clear, both recordings are 100% raw, no EQ or filtering applied.

502

(22 replies, posted in Sinclair)

Ok, here's a hardware recording: http://irrlichtproject.de/transfer/pytha-demo.mp3
Could be cleaner, yes, but still it's nothing a little equalizing can't solve, I think. I'll have another go at shaving off a few more cycles, though, which should push that HF noise a bit more towards the inaudible range.

503

(22 replies, posted in Sinclair)

Hmm, that shouldn't be the case. There is some noise on the pure triangle, and the modulation effect has a pretty sharp sound, but it should be tolerable (unless my ears are getting bad). Are you running on hardware or Fuse emulator? Most other emulators have problems with this type of fast-switching synthesis.

Border masking would cost a lot of cycles, so unfortunately it's pretty much impossible.

504

(22 replies, posted in Sinclair)

Whoops, just noticed that I miscalculated the timing, 220 cycles instead of 224. Got a version which runs in 216, but the improvement to the sound is barely noticable so I'll leave the engine as it is for the time being.

505

(22 replies, posted in Sinclair)

Yep, still totally retired from making new beeper engines... ah, damnit.
Alright then, say hello to Pytha, the first beeper engine that can generate triangle waves in realtime, without wavetable lookup. Just two channels, both of them do the same thing. In addition to triangle waves, there's also saw and pulse (rectangle). There's also an LFO-controlled modulator thingy, which does some weird sweep/resonant filter fx. With the LFO turned off, the modulator can also be used to set the duty cycle for the pulse waveform. All the base waveforms can be turned into noise as well. And of course, there's the usual click drums, with variable starting pitch and slide speed for the kick, and variable volume for noise. The LFO runs at a fixed rate. Tried making that variable, but unfortunately it creates too much noise. It'd also be nice to shave a few cycles from the synth loop for better sound. There's actually 10 cycles wasted on timing, however they are in a really bad spot so it's hard to reduce them to 2.

Anyway, won't make an XM converter for this, for obvious reasons. Got a working MDAL config for it, though, just need to polish up a few things on that. For now, the source code is in the github repo, as usual. Short demo tune is attached.

506

(20 replies, posted in Sinclair)

Not sure if I'll be able to make it. But I'll try.

507

(135 replies, posted in Sinclair)

Another 1-bit puzzle cracked: How to generate a triangle wave without wavetable lookup. There are some killer modulation effects that you can do with this as well, but I still need to find a few free t-states in order to implement those for 2 channels.

Edit: Ok, got it. Here's a shorter and faster version, 11 t-states free which will be enough to pull of the modulation effects.

sloop
    add hl,de        ;11
    
    ld a,0           ;7    ;timing
    nop              ;4    ;timing
    
    ld a,h           ;4
    rlca             ;4
    sbc a,a          ;4
    xor h            ;4
    
    rrca             ;4
    out (c),a        ;12__64
    rrca             ;4
    out (c),a        ;12__16
    ds 4             ;16
    rrca             ;4
    out (c),a        ;12__32
    
    jp sloop         ;10

Edit2: Example with modulation effect attached.

508

(25 replies, posted in Sinclair)

Yeah, I think SID is here to stay wink Port contention will be there in 48k mode, though it can probably be disabled with a setting.
I'm curious how good the beeper sound will be. I expect it to be at least on par with what garvalf recorded from his MiST.

509

(25 replies, posted in Sinclair)

Awesome! Can't wait to see the full documentation for the Next. Guess I'll be writing a sound driver or two for this thing.

510

(25 replies, posted in Sinclair)

Thanks for the info. Seems that either way the Next will be totally overpowered in terms of sound capabilities yikes It's basically a chip orchestra-in-a-box at this point. Especially pleased to hear that SAA support is on the list. Now we just need a decent tracker for all of this...

511

(25 replies, posted in Sinclair)

Thanks!

Did you have this discussion before they upgraded to the SLX16? Maybe at least OPL2 will be possible after all, who knows wink On the other hand, I'll probably stick to the beeper anyways. I need those limitations, with FM I'd just be stuck tweaking sounds all day.

Made by one of the most talented chip artists on the planet wink

Ha, neat. They even got a Sharp Pocket PC!

The Commodorians are actually blessed as far as live music coding goes, since they've got defMON wink

514

(10 replies, posted in Sinclair)

Not sure if Shiru has developed this idea any further yet. He's done a few ports of ZX beeper engines though, as you've probably seen. I've mostly been busy working on MDAL myself, though I've also done a Z80 emulation core in the meantime (not for AVR though, just a C++ experiment to see if I could pull it off in general). I'm sure we'll come back to this at a later point though.

515

(25 replies, posted in Sinclair)

Yeah, programming natively on the thing is what I'm most looking forward to. As far as sound goes, I think the current specs are great already. And there's always the chance for an updated firmware later on wink

Also what? The Lyndon Sharp is active? I've been trying to get in touch with the man for ages, to no avail. He briefly popped up on WorldofSpectrum a while ago, but nobody gave a damn (unsurprisingly, as many people with a serious interest in Speccy things have left that place after the new management took over), so he disappeared from there again. If you could manage to reach out to him and lure him here, that'd be awesome. Not sure if he even knows that there are people actively using his beeper sound routine nowadays...

516

(25 replies, posted in Sinclair)

Holy moly, over 720,000 GBP! Don't think anybody saw that coming. Well deserved though, imo this really is the Speccy of the future.

Haven't tried tasm_on_calc, but judging from the readme, it might not be very useful. It only implements a small subset of commands, and a lot of important stuff like logic, 16-bit arithmetic, relative jumps, and data directives aren't implemented at all. That said, the 84+ can be programmed natively in machine code. So you can always write your asm code on paper, and translate it by hand wink Quite tedious, but it's doable for small projects.

Houstontracker takes up most of the available RAM. However, on the 84+, you can always stuff things into the Flash archive to make room in the RAM. So it's certainly possible to use the same calc for music tracking and asm experiments.

Z80 is sometimes used in the Sega Genesis/Megadrive as a sound co-processor. It's also used for sound generation in a number of other home computers without dedicated sound hardware.

You don't really need an in-depth understanding of the ULA. I suppose my wording was a bit confusing: As far as sound goes, the ULA only converts the digital output from the Z80 into an analogue signal. The actual sound synthesis is done by the Z80.

Basically, you mostly interact with the ULA either by writing to VRAM (0x4000 - 0x5bff) in order to change graphics, or by writing to port 0xfe in order to change the border color, and the state of the 1-bit signal. Bit 4 is the relevant bit for controlling the beeper state.

The tricky part of running graphics and audio at the same time is this: the Z80 shares the data bus with the ULA in the lower 16 KB of the Spectrum's RAM (0x4000 - 0x7fff), and the ULA gets precedence over the CPU. So when the CPU is executing a read or write operation that concerns the first 16K of RAM, it may have to wait a variable amount of cycles. This is called "memory contention". Now here's the catch: When synthesizing 1-bit music, you usually need to use cycle-exact timing. However, the amount of delay caused by the memory contention is very difficult to predict, so cycle-exact code becomes nearly impossible when generating graphics at the same time. There are some tricks to make it appear as if graphics and music are running at the same time, but actual synchronous gfx+msx generation is considered very challenging (though not impossible).

Well, that certainly means taking the hard route wink On the other hand, I can completely understand your desire to stay away from "big" computers. In this case you may want to familiarize yourself with MRS (the Memory Resident System). It's one of the most advanced assemblers that run natively on the 48K, and it should work just fine in conjunction with the divSD.

Regarding the 48K sound, it actually is generated by the ULA chip, which also does the graphics. The ULA sends the signal to both the on-board speaker and the MIC output (and since the latter isn't fully seperated from the EAR port it's audible there as well, at a lower volume). Pretty much all the recordings available online are taken from the MIC port.

Like what I've seen so far of your works on vimeo, nice and dark. Will have to check out more of that wink

Cheers! Another thing you'll want to do is setting up a toolchain. Books usually don't explain how to do this in a modern way. There are many different ways of going about this, ultimately it all depends on your personal preferences. Are you a bit familiar with using the shell on your Mac and compiling simple C/C++ programs?

Well, I'd be more than happy to aid you in your quest to pick up assembly. We definately need more people writing their own sound routines.

Btw check out these:
Mastering Machine Code on Your ZX81, by Toni Baker - There's also a ZX Spectrum version of this book, but this one comes as a hyperlinked html version. Very handy, especially chapter 8.
How To Write ZX Spectrum Games, by Jonathan Cauldwell - Very useful once you've learned some basic assembly theory and are wondering how to put it into practise.

You'll also want a mnemonics table for a quick overview over all the available commands. I mostly use this one. It's missing a few undocumented opcodes, though. The definitive list of all Z80 opcodes is here.

Edit: Oh, and thanks for your contribution on bandcamp btw smile Glad to hear there's at least one person who actually likes my beeper poetry big_smile

Hey Mark, welcome aboard! I realize we don't actually have a sticky about getting started on Speccy 1-bit music yikes And we're always happy to help, so please feel free to ask any beginner's questions you may have.

Man, sucks to hear your stuff got stolen. But great to hear that doesn't discourage you!

Hello HT2 friends, I've uploaded a new beta version (2.24) to the github repo. Fixed a major bug in the keyhandler which was probably responsible for a whole range of stability issues, and added a "loop pattern" playback function (accessible with [ALPHA][(-)]. Provided there are no bugs, this will become the next stable release. Please do test and report any bugs you find.

Also note that the html documentation is no longer updated. For HT2.3, there'll be a new fancy pdf manual. The current draft is attached below.

525

(4 replies, posted in Sinclair)

ZXBaremulator uses the core from JSpeccy, which iirc has the same problems with beeper sound. Sound from the Pi itself should be fine.