1 (edited by Shiru 2021-02-07 01:25:28)

Topic: Faulty Robots - Commodore PET music album

Long story short, I made a 8-song album for Commodore PET. It works kinda like PC Speaker music, just a single channel, but with wave shaping capabilities (different bit patterns) instead of regular square wave. No multichannel synthesis there, although it is sure possible on this beast.

https://www.youtube.com/watch?v=JEhGa5avUKM

website - 1bit music - other music - youtube - bandcamp - patreon (latest news there)

Re: Faulty Robots - Commodore PET music album

Ahh yes! Fantastic work. Still blows my mind that monophonic stuff can sound so great.

So he didn't use your music in the game after all?

Re: Faulty Robots - Commodore PET music album

nice :-)

I don't know why but I like the 5th, even though it's the most conservative ...

Re: Faulty Robots - Commodore PET music album

I did finish code for PET, VIC, and C64, but integration failed on the last mile - something conflicted or glitched, and my code didn't work in PET and C64 versions inside actual game by reasons unknown. As the integration was done on binary level (not source level), and I don't have a real PET or C64, and available debuggers leave a lot to be desired, and the game was already released anyways (first copies were done without sound), we're ended up with only using VIC-20 part for sound effects. David opted to do his own sound code and even a native tracker for PET instead.

As for music, initially it was supposed that I'll compose it all, to the strengths of my sound code, but as its development was lagging behind a lot, it was decided that Noelle will do SID music in goattracker, and I'll have to convert it for PET/VIC, which didn't work well, of course. So none of my music was used, and that's why I decided to release it as a standalone album.

I covered up the story in my Patreon blog, there is a few posts, you can follow it up by the 'pet robots' tag. Planning to do two more, one on the music editing process (1tracker this time) and data format (pretty compact, the songs 1000-1500 bytes large each), and another one on making of the album itself.

website - 1bit music - other music - youtube - bandcamp - patreon (latest news there)

Re: Faulty Robots - Commodore PET music album

That's a pity. Well, at least we're getting this excellent music release. Anyway, thanks for the good read. Looking forward to the upcoming ones, especially the data format one. I'm also curious about your experiences with VIC. Writing a player with support for "viznut" waveforms has been on my bucket list for a long time. Sounds like I might be in for some nasty surprises, though.

6 (edited by Shiru 2021-02-07 20:27:10)

Re: Faulty Robots - Commodore PET music album

I did implement the viznut waveforms for the VIC-20. It was full of nasty surprises for sure, given the difficulty of making well timed 6502 code (added cycles here and there depending on code/vars locations), and really lacking debug tools. Even worse, VICE has some weird audio filtering going on, and MAME does not support expanded RAM for VIC (5K default model only), so I was not able to hear the sound properly, and my test code didn't fit to run in MAME.

It worked in the end, however, it wasn't much suitable for music. The thing is that these waveforms always contains 8 zeroes and 8 ones, just arranged in different ways. So it can't do the usual 50-25-12-7 duty cycle, or arbitrary bit patterns of PET, it just adds high pitched harmonics into square wave. So a special arrangement for music is a must, that would mostly rely of square wave and emphasize some parts using waveforms.

Here is the key part of the code (waveform_table there is to attempt to arrange waveforms in order from regular bold square to the thinest one):

set_pitch_and_wave:

    pha    
    tya
    bne :+
    
    sta <PV_WAVE_PREV,x
    lda #$7e
    sta VIC20_LOW,x
    pla
    rts
:
    
    asl a
    tay
        
    lda waveform_table,y
    iny
    
    cmp PV_WAVE_PREV,x
    beq @skip_wave
    
    sta PV_WAVE_PREV,x
    sta PV_WAVE_PTN
    
    lda #$7e
    sta VIC20_LOW,x
    
    lda waveform_table,y
    
    ldy #100/5                ;delay t-states/5
:
    dey
    bne :-

    tay

@loop:

    lda <PV_WAVE_PTN        ;3
    and #$80                ;2
    ora wavecnt_table,x        ;4+
    sta VIC20_LOW,x            ;4+
    asl <PV_WAVE_PTN        ;5
    lda <PV_WAVE_PTN        ;3
    nop                        ;2
    nop                        ;2
    nop                        ;2
    dey                        ;2
    bne @loop                ;2/3=32t

@skip_wave:

    pla
    tay
    lda (PV_NOTE_TABLE),y
    sta VIC20_LOW,x
    
    rts

wavecnt_table:

    .byte $7d,$7b,$79
    
waveform_table:

    .byte %11000000,3    ;00
    .byte %10010000,6    ;14
    .byte %10100000,5    ;09
    .byte %10100000,4    ;12
    .byte %10110000,6    ;11
    .byte %10110000,5    ;07
    .byte %10000000,2    ;01
    .byte %10000000,3    ;04
    .byte %11010000,5    ;08
    .byte %10101000,6    ;13
    .byte %10010000,5    ;06
    .byte %11100000,4    ;03
    .byte %10110000,4    ;02
    .byte %11000000,5    ;10
    .byte %10000000,4    ;05
    .byte %00000000,0    ;15

In fact, I think I'll release the whole sound code sometime later. Released album code contains most of it anyways, it only missing VIC-20, C64 and NES dependent parts.

website - 1bit music - other music - youtube - bandcamp - patreon (latest news there)