26

(14 replies, posted in Sinclair)

Hi guys, I thought that you may appreciate this one here:

PunBB bbcode test

(click on the image to see the youtube video). This is the corresponding download: http://introspec.retropc.ru/demo/rain.zip

Only possible with "Octode XL" *

* not really smile

27

(135 replies, posted in Sinclair)

Ha-ha, I actually have a soundcore prototype with this kind of idea. Never had time to complete it, maybe one day smile

28

(5 replies, posted in Sinclair)

You are welcome, mate! It was worth it, right? smile

Very cool work. I am really looking forward for when you (or someone else?) actually create longer and more sophisticated tracks with this style of synthesis.

29

(5 replies, posted in Sinclair)

Powerful!

30

(130 replies, posted in Sinclair)

I do not remember a beeper-compo this strong for a number of years. Lovely work, guys!

Guys, I thought that one of you might be interested in this advert:
http://wanted.scene.org/post/58/looking … roductions

(just to clarify, I am not involved into this project, but I thought that no-one from here tracks scene-related boards).

32

(8 replies, posted in General Discussion)

Would be lovely if you could try it at least. It is not a major issue, just a bit of annoyance really.

33

(8 replies, posted in General Discussion)

Almost every time I post something onto the forum, the forum asks me how many bits are needed to produce great sound.
The first 10 times I answered it it was even fun! but I guess my patience is wearing thin now. Could you please consider removing this protection measure? We do not seem to have many spambots around here, or do we?

No, I did not remove border masking! It is still there. But since you used 224 t-states per sound loop iteration, I felt that it would be an excellent way to show that there is no contention anymore. The actual trick is kinda crazy actually:

playRegular
    exx            ;4
    add hl,de        ;11
    ld a,h            ;4
duty1 equ $+1
    cp #80            ;7
    sbc a,a            ;4
    and #12            ;7
    out (#fe),a        ;11    ; 12 + 11+4+7+4+7+11 = 56t
    
    add ix,bc        ;15
    ld a,ixh        ;8
duty2 equ $+1
    cp #80            ;7
    sbc a,a            ;4
    and #12            ;7
        exx            ;4
    out (#fe),a        ;11    ; 15+8+7+4+7+ 4 +11 = 56t

        nop            ;4
        nop            ;4
        add hl,sp        ;11
    ld a,iyh        ;8
duty3 equ $+1
    cp #80            ;7
    sbc a,a            ;4
    and #12            ;7
    out (#fe),a        ;11    ; 4+4+11+8+7+4+7+11 = 56t
    
        add iy,de        ;15
    ld a,h            ;4
duty4 equ $+1
    cp #80            ;7
    sbc a,a            ;4
stopch equ $+1
    and #12            ;7
        dec c            ;4
        exx            ;4
    out (#fe),a        ;11    ; 15+4+7+4+7+ 4+4 +11 = 56t

    jr nz,playRegular+1    ;12
                ;224
    exx
    ld a,b
ch1Length equ $+1    
    sub #ff                ;= timer - actual length
    jr z,_skip
    djnz playRegular
    jp rdptn

_skip
    ld (stopch),a
    
    djnz playRegular
    jp rdptn

I personally always work hard to keep border masking in all my engines. I know you can argue it is an aesthetic decision, but I kinda like my aesthetics less random smile

Just as an illustration: this is what quattropic would sound like, when it is aligned to 8t. As we discussed, the effect of alignment can be subtle, but I hope you can hear that the messy distortion is gone now (I do not even know how to describe it).

Update: looked into xtone, hmm, nah, maybe next time! smile

36

(22 replies, posted in Sinclair)

No, I do not like it too much myself. It is "cleaner", but the balance does get distorted.
Just wanted to compare my perception with someone elses, thanks... smile

Yeah, that would be way to do it smile
I actually have got several types of PWM coded this year, which are, surprise, surprise, not literally "out (#fe),a : rrca", but ain't far from it. In each case 8 t-state alignment is satisfied. Yes, it can be done. I am pretty much convinced now. The only thing you lose is the possibility to have better than 4-bit resolution for your PWM (e.g. Alone Coder had 5- or 6-bit resolution in his demos, but his demos would not work well on 48K).

I guess my point is, 8t alignment is a pain, but not the worst kind of pain there is out there smile

38

(10 replies, posted in Sinclair)

I know for sure about "Heartland" and "Robin of the Wood". Yes, they will play differently on Issue 2 and Issue 3 spectrums. I do not think they ever considered clones smile

39

(10 replies, posted in Sinclair)

Almost no-one is using it. There are two reasons for this.
1. There are differences between 48K Spectrums implementations of the relevant analogue circuitry (see here). Hence, you would have to detect the kind of Spectrum first and them somehow adjust the synthesis. Similar differences between 128K models are not documented. God knows what will happen if you've got a clone.
2. It is actually not worth it. It would have been useful if you'd get a "0.5 voltage" step between 0 and 1. Instead, what you get is 0, 0.1, 0.96, 1.
I believe that some of the Odin titles attempt using this for mixing their channels. It is up to you to decide if this was worth it.

utz wrote:

What I mean is that with the kind of >3 channel PuInt and especially wavetable synthesis, it's pretty much impossible to pull off the correct 8t alignments.

I was a bit undecided, whether to write about this for a while... You see, I disagree. I think this can always be done. It is not always easy, yes, e.g. "Savage HD" nearly did my head in, very, very messy thing. But it can be done.

41

(22 replies, posted in Sinclair)

utz, what did you think about my hacks of this engine? I cannot decide if it is worth it, the sound becomes more muffled, but it is also louder. I believe Shiru was messing with the engine to include it into his tracker and this was at some point during the summer, so it may well be that he has some kind of support for it already.

I just popped into a debugger and, no, "Spectone-1" is a very different beast. It is a 4-channel engine which uses short pins, with the code that bears more than a passing resemblance of ZX10. Can you also hear characteristic "pops", just like in Special FX? This is because the sound loop is infinite and tempo is controlled via interrupts. This is the code:

l_fa3b: xor a

    dec c ; channel 1
    jr nz, l_fa67
    ld c, ixl
    or 0 ; volume for channel 1

l_fa43: dec b ; channel 2
    jr nz, l_fa6a
    ld b, ixh
    or 3 ; volume for channel 2

l_fa4a: dec e ; channel 3
    jr nz, l_fa6d
    ld e, iyl
    or 0 ; volume for channel 3

l_fa51: dec d ; channel 4
    jr nz, l_fa70
    ld d, iyh
    or 0 ; volume for channel 4

l_fa58: or l ; previous volume
    ld l, a ; save for next iteration
    jp z, l_fa73
    dec l     ; if non-zero, decrement it
    ld a, 16
l_fa60: xor 31
    out (254), a
    jp l_fa3b

l_fa67: jp l_fa43
l_fa6a: jp l_fa4a
l_fa6d: jp l_fa51
l_fa70: jp l_fa58
l_fa73: jp l_fa60

The mixing is a little bit similar to one of my early sketches for "Octode XL" (which is not very surprising, because I messed with "Octode" and "Octode" was clearly inspired by ZX10, just like this engine). Note how it tries to control the volume by using OR volume, but also note that it is not consistent in that channel volumes are not properly added. It also has a mechanism for carrying pins to next iteration, but once again, not fully consistently.

42

(22 replies, posted in Sinclair)

I keep forgetting to write about Squeeker engine by Zilogat0r. Many thanks to Shiru for pushing me to study it earlier this year. In case you have not heard of it before, I am attaching the track by Factor6 - see the attachment called "squeekf6.z80".

It has a very unusual sound loop, which suggests a nice solution to the common problem of overbearing mid- and high-tones, while the basses are low. This is what the sound loop looks like:

mxb    exx ; (1)
    xor a
    ld bc,#0400
    ld sp,#80c4
mxa    rla
    pop de
    pop hl
    add hl,de
    push hl
    pop hl
    djnz mxa

    ld c,a ; (2)
    ld a,20
    add a,h
    ld a,15
    adc a,c
    out (254),a
    exx

    dec hl ; (3)
    ld a,h
    or l
    jr nz,mxb

OK. Part (3) is the easiest: HL' stores the number of times the sound loop repeats, i.e. this is simply the tempo control. Easy. Part (1) is also not too bad. The SP is directed at the buffer at #80c4 that stores 8 words - the full data describing the state of 4 available channels. For each channel 2 words are stored: first, the word which is added to the channel current state counter (i.e., the period of the wave) and the second word is the actual state. Two words are read off the stack, added together and then the second word is re-saved back onto the stack (PUSH HL : POP HL). This is done for all 4 channels, i.e. we have four independent 16-bit channels.

However, part (2) looks very strange at first. Note how A is used to accumulate values of the overflow bit C during part (1), except that RLA is done BEFORE, not after the first addition happens, so the overflow produced by the fourth channel is IGNORED. What? Now, watch my hands:

    ld c,a ; save into C the number 0..7 with states of first three channels
    ld a,20 ; add 20 to H, so it overflows when H>255-20
    add a,h
    ld a,15 ; discard the result in A, put 15 into A instead
    adc a,c ; add the overflow we had after adding 20 to H and also the contents of C
    out (254),a

In the end, what we end up outputting into the port is the number 15+0..7(depending on overflow bits of the first 3 channels)+1(if H in the fourth channel is above 255-20). If all the additions are 0, we end up outputting something into the tape port and onto the border too. However, as long as at least one of the channels 1..3 produces a pin, or if the duty cycle of the channel 4 is sufficiently advanced, we end up setting bit 4 of the port 254, i.e. producing sound.

So, effectively, we have here a very rare beast: a mixed synthesis beeper engine. The first three channels work as the standard "pin-based" generators, whereas channel 4 produces much wider square pulses. This makes it possible to use channel 4 for bass, which sounds solid and strong. Cool idea!

Can one do better? I guess one can. One can align the engine to 8t, slightly speed it up, and also actually switch to the kind of mixing which I used in the "Octode XL", i.e. the form of accumulating PWM. After all, with "Octode XL" it was possible to choose "volumes" of individual channels, so it is pretty similar to what we have in Zilogat0r's engine.

This is what it would sound like if one would try to reproduce the original sound using "Octode XL" style of mixing.

This is what it would sound like if one would actually use the new possibilities given by the "Octode XL" style of mixing.

OK, got you, will try to do it when I have a bit more time.

utz wrote:

Aye, added this to the post. Going by my experiences with 7d7e I'd say this may be considered more as a general guideline for "optimal design", rather than something that needs to be strictly adhered to (like the "stable timing" rule). Nevertheless it's a viable piece of information, so thanks for pointing this out!

I have some plans to extend this tutorial a bit further, but at the moment I lack the time to do so. Think it'll have to wait till next year. Of course everybody else is welcome to add parts, too.

I think it depends on the type of mixing that you use. The engines with narrow spikes, e.g. Tim Follin engines or Shiru's "Octode" are less sensitive to it, so for them it maybe difficult to even notice the difference. However, for longer duty cycles, e.g. "Savage", the difference is clear and pronounced. Due to relatively low quality of the beeper sound the distortions produced by the contention may be considered insignificant, however, they are easy to hear and are very unmusical, because they result in unstable timing, as well as introduce a 50Hz component into the sound.

I never did everything I hoped to do with the "Savage" due to the lack of time. When I find the time, I will rebuild the classical "Savage" tunes with the new engine, so that everyone can see what's the big deal.

utz wrote:

What's important to know is that delay caused by IO contention affects our sound loop timing. Which is bad, as I've explained above. The solution however is rather trivial: You just need to make sure that the number of t-states your sound loop takes is a multiple of 8. That's all there is to it.

Just noticed that this needs a tiny correction. This advice is only correct when the sound loop contains only a single OUT command. In the case when there are several OUT commands, this won't be good enough. What you actually need to ensure is that the timings from any OUT command in your sound loop to any other OUT command in your sound loop is a multiple of 8. This automatically ensures the number of t-states in the sound loop is a multiple of 8, but this is, generally speaking, a stricter requirement.

46

(6 replies, posted in Sinclair)

I think it is not fully perfect, because some of the examples in the long list of examples appear to crash. And you are right, utz, the code is a bit messy, but what do you want smile  Anyway, the black line on top of the screen during the playback is the standard Vortex Tracker player. You are supposed to compile the binary @ #6200 (doing it from memory) and then the assembly emulator just picks up the register values from PT3 player memory. So, I am 100% it can be improved quite a bit by switching to a PSG player.

Anyway, it is more important at this stage to understand his code for PWM, because these files are frankly monstrous smile

47

(6 replies, posted in Sinclair)

Guys, I thought that you may enjoy finding out that NEO SPECTRUMAN over at zx-pk.ru has just released a Spectrum 48K-based emulator of AY/AY chip for a ZX Spectrum beeper. I have no time to read the code and analyse its features, but it seems pretty functional and it does sound very impressive indeed.

The original post (in Russian) is over here: http://zx-pk.ru/showthread.php?p=839299

A collection of working snapshots is available at: http://zx-pk.ru/attachment.php?attachme … 1446493866

All sources etc: https://yadi.sk/d/5EX7n_JZkC2NJ

48

(65 replies, posted in Sinclair)

You are on fire, mate smile

I missed a lot!

Lovely work, utz. Very, very impressive, esp. the improved quality due to the higher CPU clock. Once my crazy teaching load goes down a little, I will definitely read the player - it is interesting to see what style of mixing you went for here.

Do these TI calcs have a contention of any kind? Some of these calcs seem to come with a 15MHz Z80s; just think about the possibilities in terms of the beeper sound in that case! smile

50

(3 replies, posted in Sinclair)

1. You can avoid wasting the lowest bit of the pattern data by storing separately low and high bytes in two separate LUTs and going from one to the other via INC H (instead of your INC L).

2. Otherwise, there is not much you can do with this.