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.

556

(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.

557

(166 replies, posted in Sinclair)

Hehe, better late then never eh? big_smile
Dunno why, but 0.23 also overall feels faster/less jerky for me. And still super happy about the added sequence navigation.

558

(4 replies, posted in Sinclair)

Nice project, bummer about the sound emulation. Might be worth a try porting it to the C.H.I.P, though the timing issues on that machine will probably ruin the emulation.

Thanks! I had initially planned on implementing this, but ultimately abandoned the idea, mostly because of my lack of experience in coding such a system. At the current stage, it would be quite tricky to add, because there's just a few hundred bytes of memory left. And there's actually a few other features that I still want to implement (advanced live mode, better copy/paste/clone support), so I'd rather spend the remaining bytes on this. I might consider it again at some point, but at the moment I'd rather try to convince the TiLP guys to try and add Android support, which would probably solve the problem for many people as well.

Btw, a call for action to everyone: Please do test the latest beta versions from github. There are a couple of nasty issues which I need to sort out before I can progress further. So far I've had no luck with these, so any input on them is highly appreciated.

Talkin' bout da tracker at Revision last weekend: https://www.youtube.com/watch?v=7UgSDAkXAJw
Rather technical, with a lot of uhhm and ehhm, and a failed demonstration of the QED68 sound routine at the end.

561

(135 replies, posted in Sinclair)

The first example can be done faster with 12-bit counters, at the cost of loosing variable duty:

   add hl,de
   ld a,h
   out (#fe),a
   rrca
   out (#fe),a
   rrca
   out (#fe),a

Second example is very powerful. One can create all sorts of waveforms with this, especially if you also play with the distances between the OUT commands. If I understood fourier transformations, I'd have some great fun with this...

My idea was to use a free-running counter. Original idea of an 8-bit counter didn't work, so here is a pretty clumsy version with a 16-bit counter:

    ld de,#80
    xor a
    ld h,a
    ld l,a
    ld b,a
    ld c,a
    
loop
    out (#fe),a    ;11__36
    add hl,de      ;11
    inc bc         ;6
    ld a,h         ;4
    nop            ;4
    out (#fe),a    ;11__36
    add a,b        ;4
    ld r,a         ;9
    jr loop        ;12

Suprisingly it actually works, but wasting a whole 16-bit reg on this seems rather wasteful. Though on the other hand, one free-running counter can serve multiple channels, so maybe not so bad after all.

Edit: On second thought, that register is maybe not wasted at all... because it might be possible to use the frame length counter for this :D
Edit2: Trying out the idea in BeepModular. The effect is less pronounced here because of the volume difference (48 vs 64t), but generally abusing the timer for this seems like a good idea.

Well, generating a huge number of pin pulse channels is not a problem at least, thanks to Jan Deak's buffer method. I wonder though if it's possible to come up with an elegant algorithm that uses only one oscillator and derives the detuned copies from that, like the original SuperSaw supposedly does. For example, a simple 8-bit counter that increments once per loop iteration could already be enough to generate two derivatives (one added to main osc, one subtracted).

Interesting technique! How does it work exactly? Do you think it would be viable for a native implementation on Spectrum etc?

564

(135 replies, posted in Sinclair)

Well, trying to imitate the waveforms of the allophones is basically already a sort of proto-formant synthesis wink

Hybrid Qchan would be doable. Generally, almost any beeper engine can be combined with AY without too much trouble. The main problem is that adding AY would significantly increase row transition noise on most engines, because (re)loading the AY registers takes a lot of time. The other problem is volume balance. For example the classic Qchan is not a good candidate for combining with AY buzzer, because the buzzer is much, much louder. This is why I chose Squeeker-type synthesis for my hybrid experiment, because this type of synthesis produces very loud sound, and it also cloaks row transition clicks pretty well.

Well, as I said earlier, I've retired from writing beeper engines for the time being. So don't put your hopes on me. I do hope though that someone else will pick up these ideas, and I'm of course more than willing to help if somebody is to take up the challenge.

565

(135 replies, posted in Sinclair)

As far as singing speech synths go, there's of course tavzx: https://www.youtube.com/watch?v=KkZKDJwwb2o
I agree, would be interesting to have something like this in an actual music engine. However, I'd be more interested in implementing actual formant synthesis. I've done a sample-based speech synth a couple of years ago (also with variable pitch btw), it's pretty boring work imo.

I think some MIDI solution would be preferable because of its potential impact. Would it be possible to ditch the Arduino MIDI shield and just decode the MIDI messages directly on the Arduino, using one of the digi ports? It would cause some additional load on the CPU of course, but on the other hand there's no need to load sequence/pattern data any more. As far as instruments go, yes, they could be pre-defined patches, but the engine should also make best use of the available standard Control Change messages, which could be linked to settings of duty, vibrato, etc.

Impressive! Never managed to port this engine to TI because of the interrupts. But I guess the variable timer interrupts on the Arduino come in very handy in that case.

So, what's next, any plans for a custom Arduino engine written in C?

568

(15 replies, posted in Other Platforms)

Was just reading about this guy's troubles, so a software issue seems quite possible.

Perhaps it's easier to disable auto-reset until you've found the culprit?

569

(4 replies, posted in Sinclair)

Cheers Tufty wink Both channels are identical, so yes, you can use two SID voices at once. Click drums are synthesized. The drum synth is less advanced than in Phaser1 or Phaser2, but nevertheless you can pass an 8-bit parameter to change their sound. On kicks, you can set the starting pitch, and on click noise, you can select one of two fixed pitches, and set the volume. For really advanced trickery, a completely different drum synth could be swapped in via the "arbitrary code execution" feature, which allows you to literally change any aspect of the engine at runtime. Furthermore, you can of course fake drums via table fx - noise combines nicely with volume envelopes, too, for example.

570

(7 replies, posted in Other Platforms)

Wow Shiru, looks like you're on a roll!

Since Arduino 1-bit seems all the rage now, I thought I'd give the avra+avrdude combo a try. Works like a charm, successfully produced a beep in asm!

Indeed, 16 MHz is a lot, especially considering the instructions are also super-fast. Guess I'll have to get used to writing purposefully slow asm code. Or just write complex enough routines, heh. Well, for now I'll leave things at "yay, my toolchain works" but next time I get bored with my other projects I might actually go and try writing a dedicated routine for this thing.

Edit: Wow, I just found out that ATmega has a fixed-length, 2-cycle MULtiply instruction. This should make it possible to implement stuff like 1-bit Phase distortion, perhaps even FM.

Thanks! Looks like even someone totally inept at soldering like me can construct this.

572

(10 replies, posted in Other Platforms)

Awesome! Listening to the demo tune right now, and I can confirm there's no noticable artifact/carrier noise on my setup.

Well, would be great if this gets some exposition on the Arduino forums. If there's enough interest, we might even consider opening a special Arduino sub-board on here.

573

(4 replies, posted in Sinclair)

esoteric music plays... Imagine... a beeper engine that can play almost any sound ever played by any beeper engine. An engine that transcends the boundaries between data and code by enabling you to modify any part of the player at runtime. An engine that will revolutionize the way we make beeper mu-record scratch

Ok guys, let's cut the crap wink Here's my latest engine. It picks up where wtbeep left off, and combines the modular concept of it with the simplified volume generation technique I posted for the saw wave demo here. It's insanely powerful, but unfortunately, composing music for it will also drive you insane, as there's no editor available and the data format is rather complex. In theory, the latest MDAL should be able to support the engine, but I need to implement mixing of strings and numeric values before it really makes sense to try.

Anyway, have a quote from Uncle Readme.

BM-1 is an experimental sound routine for the ZX Spectrum beeper. It features a
highly versatile synthesis core that can be modified during runtime, which
makes it possible to generate a near-endless range of different sounds.


Features include:

- 2 tone channels, 12-bit or 15-bit frequency dividers
- patches: on-the-fly modifications of the synthesis algorithm
- volume control (8 levels per channel, availability depends on patch)
- tables: change pitch and fx parameters per tick
- functions: arbitrary code execution/modification once per tick
- customizable click drums
- per-step tempo control
- compact player size (375 bytes, can be reduced by disabling features)
- optimized data format

With patches, you can produce

- variable duty cycles
- phatness/harmonics control
- fake chords
- bytebeat-like glitches
- SIDsound (duty sweep)
- PFM (classic pin pulse sound)
- noise

source: https://github.com/utz82/ZX-Spectrum-1- … aster/bm-1
direct dl: https://github.com/utz82/ZX-Spectrum-1- … p?raw=true


This will be more or less my last engine for the ZX beeper, until a some fundamentally new techniques are discovered. I still have two ideas I want to put into practise, but these will be rather simple (one is an engine with vibrato support, and one is applying the volume technique from BM-1 to wavetables, which will save a huge amount of code compared to the multi-core technique). Not sure when I'll do those, if somebody else wants to pick up these ideas in the meantime, that's fine with me. No worries though, I have no intentions of abandoning the Spectrum, but I have some other unfinished projects that I want to focus on in the coming months. Stay tuned.

Edit: Added an example patch for PFM sound.

574

(37 replies, posted in Other Platforms)

Alright, sucessfully uploaded garvalf's hex file with avrdude. The ELF doesn't run however, avrdude claims it's not valid. So I guess it's some intermediate thingy that's not meant to be uploaded. Well, no problem for now.

Good to see that the avr-gcc is reasonably efficient. Also, I still think it's very nice that you get annotated output with avr-objdump.

Still not sure if I want to install the latest IDE, especially not alongside the older install. If it were all contained in a standalone Java app then sure, but afaik it installs a ton of other stuff, namely all the avr tools. And I'm afraid checkinstall won't do the trick on this one.

I'm sorry but I don't have any octode demo tunes to offer. Have several snippets laying around but never managed to actually complete a song with it yikes

So, guys, excuse my absolute electronics ignorance, but what would be the most reasonable approach to adding a line-out to this thing? Right now I have a PC speaker attached like garvalf, with some resistor thrown in for good measure.

575

(37 replies, posted in Other Platforms)

I feel your pain, man. Arduino documentation is good but only as long as you're going to do things their way.

Anyway, dug out my Uno clone today and tried to run Octode, but as expected the ELF compiled with 1.0.5 IDE doesn't work. Could you share your ELF, so I can try to upload it directly?