Merry christmas defMON users!

Some haphazard ranting below (note that this doesn't mean that I'm going to start answering questions here on a regular basis):

Amelenium is probably right that martin_demskys problems are related to the ADSR bug in the SID chip. Learning how ADSR behaves in the SID is not straightforward, as things like doing very fast notes is something that doesn't really work well on the SID chip, unless you force it to stabilize using tricks like hard restart. Many other music editors on the C64 does hard restart for the user, which is good for beginners, but it comes at the cost of not giving the user full control. defMON is rather designed to allow the user to do things the way he/she prefers (you can do hard restart in several different ways), and therefore you are responsible for dealing with the SID beast yourself. This makes the learning curve steeper, because you have to understand a bit more of how the SID actually works. It is not quite as easy as knowing what ADSR is on a general level.

Anarkiwi is right about slight differences in the note frequency tables that defMON uses, compared to what just about every other music player on the C64 uses. This is deliberate. The reason is that in defMON frequencies are not rounded to the nearest integer value (below or above, depending on which value that is closest). Instead the values are floored down to the closest integer below. When you floor the values the table actually loops in a curious way, so you can reuse part of the same table data both for the high byte and for the low byte of the 16-bit frequency register. It also enables the possibility of some nice kinds of calculations that exploit this "looping" character of the table data. Rounding or flooring of the frequency data doesn't really make an audible difference anyway.

The two WG columns behave identically, and they are combined using the bitwise OR instruction in the CPU of the C64, before being written to the SID chip. The instruction is called ORA when you write it in assembler and it works like this: Any bit (of the 8 bits that make up a byte) that is set to 1 in either of the bytes will be 1 when the bytes are combined. Some examples of this:

00001111 OR 11110000 = 11111111 (corresponding to $0F OR $F0 = $FF in hexadecimal)
00100000 OR 00000001 = 00100001 (corresponding to $20 OR $01 = $21 in hexadecimal)  
00000001 OR 00100000 = 00100001 (corresponding to $01 OR $20 = $21 in hexadecimal)  
00000001 OR 00000001 = 00000001 (corresponding to $01 OR $01 = $01 in hexadecimal)  
00010010 OR 00000001 = 00010011 (corresponding to $12 OR $01 = $13 in hexadecimal)  

This allows users to do things like controlling the gatebit (using one WG column) separately from controlling the waveform that is currently enabled (using the other WG column). It doesn't matter which of the two WG columns you use for what though.

Last edited by frantic (Dec 24, 2018 2:46 pm)

Bratislava, Slovakia
frantic wrote:

The two WG columns behave identically

Merry christmas also from me smile so this is interesting, finally i understand why it is 2x. I have read that ADSR bug (btw chrome is warning me about this codebase64 as unsafe page) -- the classical hard-restart stops the oscillator so that no sound is heard, then sets ADSR to some value and gate off in preparation to next note, so i can use in these quicker notes with short envelope rather hard restart which include also gate off flag?

$08       = Test bit (kind of "hard restart"): reset tone + Release set
$09       = Also some kind of "hard restart": reset tone + ADS cycle set

So if i want to be exact, i just can use 08 instead of 00?


Yeah, $08 on the first frame before you set the gate will give you a solid start.  Have the gate set for two frames to give it a really solid start before switching it off. (eg: $08,$41,$41,$40)


I'd say that full hard-restart (including oscillator reset via test-bit) feels obligatory only with drums and snares as you really need that sharp "click" in the beginning of the sound/instrument. The rest (lead melody, bass, arpeggios etc.) should be fine with soft-restarting.

Now it's time to make things more complicated.

First of all, emulated environment works differently than real C64. Long story short, Vice 2.xx (reSID-fp engine) will usually not cut the sound when real C64 sometimes will, but (surprisingly!) Vice 3.xx will provide way more hiccups to your ears than real C64. Therefore, some hard-restart delays should be tested via trial-and-error, but usually 2 frames total are enough to do the job with short sounds.

Second, you need to set proper delay (DL) values to both gate closed (e.g. $00) and oscillator hard-restart ($09) frames/lines in order to make it work. Please note that using multi-speed tunes (x2/x4/x8) will require you to adjust those delay values accordingly (but not necessarily by multiplying them).

If you take a closer look at Amelinium's YT video, you'll notice that she restarts ADSR by setting 0000 value in WGWG ($00=no waveform and gate closed), and ADSR value set as 0F00. Then she'll open the gate by setting WG (gate) to $09 along with proper ADSR values that will later apply to the instrument ($41, $55... whatever). This is very similar to what I do and what I've also seen in Goto80's tracks (also a good reference).

Works like a charm and I'm very thankful we actually have manual hard-restart in defMON. The freedom of editing with this tool is simply mindfucking and gives tons of possibilities.

Last edited by F7sus4 (Dec 29, 2018 9:20 pm)

Bratislava, Slovakia

I have real C64G with 1541-Ultimate II+, Cynthcart, FC III and great cable with grounded audio out and s-video, but i am lazy to turn it on so now is my Demobit song maybe in the middle and in the new year i turn on C64 instead of Vice C64 emulator smile, i have looked again now at Amelinium's video, that tremolo strings are great, i see that gate zeros and 09s are on beginning of the patch, sometimes is used pulse width and speed on sawtooth, but i use it also because i change waveforms on the fly smile

Other things are pretty crazy, but i see smart things like combining waveform type and gate type in first WG column, so second WG column can be used for that 00 which acts as tremolo smile So i finally also understood why in Sid Duzz It i always used in waveform column 41 instead of 40 because here was also gate on at first tick.

Last edited by martin_demsky (Dec 30, 2018 10:26 am)


All defMON stuffs made available via YouTube, huh? Can do:

Bratislava, Slovakia

Thanks, tomorrow i will study your sid programming, btw if you search on YT some defMON tutorials you will find only one that from Goto80 without live commenting what he does, also that your video is not visible on your channel, so maybe it is working only as a direct link like you posted. I see that you also use 00 00 0F00, i created in my current Demobit tune this as "zero" patch so i can use it where i want between other patches, also for that quick tones with variation of hard reset.

This your piece sounds almost like in Goto80 style smile great, i see you use also two sid configuration like Goto80 used in latest Demobit performance, so sound is very massive, i have only one sid but i am afraid to buy sidfx for second, because my C64 is in great condition and i dont want to damage anything, maybe i rather buy another C64 a sync them via cable wink i noticed that you sometimes use sidTAB call one line before note starts, maybe this guarantee that note is properly triggered.

But as you can see, you must bring to live performance a lot of work because it is live programming of sid chip which is not that easy, basically on average synth you can do these filter/ringmod things easily with some knobs, so C64 is really hard platform to work with even for me, and back in time i mastered even VAST synthesis in Kurzweil synths, but took me one year to create 100 programs/setups. smile

Good luck.

Last edited by martin_demsky (Dec 30, 2018 11:20 am)


I'm not really up much for live sound programming, even though defMON seem to have great potential on the field.

Regarding that hard-restart thingy again, a sample tune here with a few instrument puzzles to think about.

Also, if you take a look at line 06, you'll notice 09 06 values ($09 for gate-bit and 06 for ADSR). You can change 06 from 01 to 0F to affect volume of the drum sound. Small "out of manual" trick if you struggled with optimizing volumes of your sounds/instruments.

Last edited by F7sus4 (Dec 30, 2018 11:51 am)

Bratislava, Slovakia

Thanks, i looked at your file, you always manage to create something unusual than classic chiptune smile and yes i hear difference when changing that 06, i also changed some other waveforms to noises and muted other channels to hear what is going on. Today i loaded my tune and also this your example to my C64G and it sounds almost same, except of course more analogue, but these fundamental things like filters and gates works almost exactly so i am glad that current Vice C64 version 3.2 is pretty trusty. At third channel 020A is interesting how you set gate on with filter at first sidtab call and on second instrument, which is followed by 00 sidtab call with 00 gate, so tones are slowly falling at SR 6C.

Last edited by martin_demsky (Dec 31, 2018 3:04 pm)