how to DUMP the music .SID?

Talk freely about the scene, the world of remixing, or anything off-topic unsuitable for the "Fun Forum".
Post Reply
fabioc64
Commodore Fan
Commodore Fan
Posts: 10
Joined: 20/11/2021 - 20:18

how to DUMP the music .SID?

Post by fabioc64 »

HI,
could someone tell me how to make dump of .SID files?
could anyone tell me how to create .SID file dump?
how to create the dump and find values from a .sid file of a song, and above all how to read / interpret the values?
LaLa
Forum Admin
Forum Admin
Posts: 172
Joined: 21/09/2003 - 0:36
Location: Eden Prairie, MN, USA (born and raised in Hungary)
Contact:

Re: how to DUMP the music .SID?

Post by LaLa »

You need to be a bit more specific than that.

If you are looking to convert the .SID file to audio data, the only way to do that is to use a SID emulator and redirect its output to a WAV file. On Windows the old Sidplay2 could do this ( https://csdb.dk/release/?id=9775 ) or JSIDPlay2 can do this, too ( https://haendel.ddns.net/~ken/ ). I'm sure there are other SID emulators that can do this, too - I'll let others chime in with their suggestions.

If you would like to extract the note data from a SID music, AFAIK, SID2MIDI is still the best way to do that ( https://csdb.dk/release/?id=136776 ). However, this tool is old, and not all of the newer SID files may be compatible with it any more. SID2MIDI is basically a SID emulator that converts the pitch frequency data to MIDI notes as it plays back a tune. (It does more than that, but at a very high level, that's how it works.)

You have to remember that the .SID file format is really just a metadata wrapper plus C64 code. What's inside it is actually a standalone Commodore-64 assembly code program (or rarely, a BASIC program), which also has binary data in it that comprises of the sequences, patterns and notes that make up the tune (but even this may not be true for all SID tunes). Bottom line is that all of that is highly custom code and data, and these "music programs" were created with custom music editors (or sometimes coded entirely by hand). So, there's no "standard" music editor or tool you can use to extract the raw data from them.

We can dig into that deeper if you wish, but really, the primary question remains: exactly what kind of information are you hoping to get out of .SID files?

PS: Sorry if you knew all this already, but I don't know how familiar you are with the .SID file format already and with C64 SID music in general.
|......|......
|_/\_|_/\_
./~~\/~~\
fabioc64
Commodore Fan
Commodore Fan
Posts: 10
Joined: 20/11/2021 - 20:18

Re: how to DUMP the music .SID?

Post by fabioc64 »

thanks for the answer, but I thought the question was well phrased.
On youtube I have seen videos generated by 8-bit programs such
as goattracker 2 familytracker and others similar, they report the same values ​​in the modern sequencer.
I want to capture information from the original .sid file such as:
first of all,
all movements of the pulse witdh modulation
of voice 1 voice 2 voice 3
extract the notes of each single of the three channels,
see and understand an arpeggio,
see arpeggio of the rhythm part
and all the movements of the waves chosen in the oscillators,
on and off buttons,
the volumes used in the A D S R
the vibrato
and the filters used
that is to have all the information to be able to report the values ​​on an old sequencer made on a c64 machine,
or on a modern software with which I am familiar such as fl studio cubase and report the values ​​as faithful as possible,
without going to my imagination but reporting everything respecting as much as possible the sound of the original sid.

now that the question is well formulated what do I need to have and understand all the information of the original sid?
LaLa
Forum Admin
Forum Admin
Posts: 172
Joined: 21/09/2003 - 0:36
Location: Eden Prairie, MN, USA (born and raised in Hungary)
Contact:

Re: how to DUMP the music .SID?

Post by LaLa »

I'll cut to the chase: I think the tool you want is SIDDump:

https://csdb.dk/release/?id=192079

This will give you the exact state of each register of the SID chip on every single frame, resulting in a quasi tracker-like output. Great for analyzing SID tunes. Disclaimer: I have not used this tool myself a whole lot, so I have no idea how accurate it is. But seems to be very close to what you're looking for.

Do note that this is still basically using (a very compact) C64 emulation to "play through" a SID tune, but instead of turning the SID register values to waveforms and audio output, it just dumps them as text. It won't tell you what chord an arpeggio is playing, for example - rather, it will show you the frequency register being changed rapidly over time.
Last edited by LaLa on 26/09/2022 - 0:30, edited 1 time in total.
|......|......
|_/\_|_/\_
./~~\/~~\
LaLa
Forum Admin
Forum Admin
Posts: 172
Joined: 21/09/2003 - 0:36
Location: Eden Prairie, MN, USA (born and raised in Hungary)
Contact:

Re: how to DUMP the music .SID?

Post by LaLa »

If you are looking for a more visual, real-time representation of what's going on inside the SID chip registers during a tune, go to https://deepsid.chordian.net/ , play a SID tune and click the "Visuals" tab.
|......|......
|_/\_|_/\_
./~~\/~~\
fabioc64
Commodore Fan
Commodore Fan
Posts: 10
Joined: 20/11/2021 - 20:18

Re: how to DUMP the music .SID?

Post by fabioc64 »

thanks for the reply but we are still far from what I want to get,
I opened deepsid, but how do I find the C64Debugger better.
the movements of the pwm even if I see them are difficult to carry over manually,
because the movements are very fast and the position of the pwm
if you do not export with programs it is not humanly feasible
to redo them because a minimum movement is enough to obtain a completely different sound.
same thing regarding the arpeggios and the rhythm part and the filter used,
they are not parameters that can be done by ear or go to fantasy.
for midi exports I have already tried sid2midi but I don't like the result.
you mentioned the jsidplay2 programs I couldn't get it to work.
I publish Fabio Marinelli's videos,

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

Fabio manages to make the track sound very faithful to the original and the movements are very accurate.

I believe that Fabio uses the program the siddump.exe for dos,
that I don't know the commands to use it and another program called Xsid
by Daniel England that months ago I asked for information on this forum,
but without having more detailed information that I need now.
with xsid I was able to get only the midi, but from the information I read that it is possible to export the information of the movement of the pwm
and of the filter, pitch bend, and other information that I mentioned in the previous answer.
before opening a dedicated conversation on the use and reading of the siddump,
do you think you can help me to have something better and make me understand how to use and understand the register with siddump
and to use the other Xsid tools developed by Daniel England
and get a result like Fabio Marinelli and report all values ​​on the new sequencers?
thank you
LaLa
Forum Admin
Forum Admin
Posts: 172
Joined: 21/09/2003 - 0:36
Location: Eden Prairie, MN, USA (born and raised in Hungary)
Contact:

Re: how to DUMP the music .SID?

Post by LaLa »

I have no idea what process Fabio is following to do his faithful recreation of SID tnunes with InSIDious and a DAW, but I suspect it involves a ton of hard work. You would be better off asking him directly about that.

I have never used XSID before, but I just gave it a quick whirl and I looked at the output it produced - for analysis I find its output unusable. I think you would be much better off using SIDDump.

As for interpreting the output of SIDDump, first you need to understand the registers of the SID chip itself (it's not that complicated if you are familiar with basic sound synthesis, e.g.: http://www.oxyron.de/html/registers_sid.html or https://www.c64-wiki.com/wiki/SID ). The problem is that SID files are not like MIDI files or even MOD files, in that they cannot easily be "reverse engineered". If you are lucky, you may be able to load the raw SID data into the SID tracker that a given musician used to create that particular SID file, but even that is not guaranteed to work (because the music engine+data may have got compressed on export). And of course, there are many different SID trackers, and many SID files were created either with proprietary SID trackers, or some with no tracker at all - some of those are just pure C64 assembly programs.

I really do not know what else to recommend you right now. Maybe others can chime in here, but at this point there's really no substitute for rolling your sleeves up and digging deep with hard work to analyze a SID tune.
|......|......
|_/\_|_/\_
./~~\/~~\
I_R_on
Newbie
Newbie
Posts: 8
Joined: 09/07/2022 - 22:52

Re: how to DUMP the music .SID?

Post by I_R_on »

This question inspires a great idea. How about going back from sid to the original composition?
For those sids that,
- not compressed
or
- compressed but could be uncompressed
and created with a tracker and already identified in deepsid (better, it seems to be using an id utility for that function)

With a driver for each music tracker a decent amount of sids could be converted into source form. Just a guess though, I've only used a few trackers and didn't do any fancy stuff with them.

What would be the benefit you might ask? The tune in question could be remixed / changed directly in the source form, it may be enhanced with second sid and so on...
fabio marinelli
Commodore Fan
Commodore Fan
Posts: 14
Joined: 04/02/2021 - 20:55

Re: how to DUMP the music .SID?

Post by fabio marinelli »

fabioc64 wrote: <span class="hotdate" style="color:#888;">26/09/2022 - 12:18</span> I believe that Fabio uses the program the siddump.exe for dos,
that I don't know the commands to use it and another program called Xsid
by Daniel England that months ago I asked for information on this forum,
but without having more detailed information that I need now.
with xsid I was able to get only the midi, but from the information I read that it is possible to export the information of the movement of the pwm
and of the filter, pitch bend, and other information that I mentioned in the previous answer.
before opening a dedicated conversation on the use and reading of the siddump,
do you think you can help me to have something better and make me understand how to use and understand the register with siddump
and to use the other Xsid tools developed by Daniel England
and get a result like Fabio Marinelli and report all values ​​on the new sequencers?
thank you
for my remakes I use only and exclusively the dump ... I don't even know if there are programs that perform the functions you ask for. I don't even use sid2midi, because (in my experience) it reports all the songs in 4/4 and does not detect tempo and time signature changes ... totally unusable for me. What I do is study the dump very thoroughly trying to extract all the information I need, but I don't always succeed ... for example I still can't decode Fred Gray's songs
fabioc64
Commodore Fan
Commodore Fan
Posts: 10
Joined: 20/11/2021 - 20:18

Re: how to DUMP the music .SID?

Post by fabioc64 »

I apologize for the delay in answering I did not think I would receive answers,
especially by the master of sid Fabio Marinelli,
I am happy with your presence and response to my post!
I did not know that you were also part of this great forum!
Fabio could you create a guide on conversions already made,
and to be able to teach us that we so much want to learn and understand the cumbersome process you do to bring values ​​back to insidious?
I confirm that sid2midi is not reliable,
but xsid manages to make a pretty clean midi,
and has the interesting tools to create the dump and get the information directly midi.
I still can't find out how to use the generated files and how to read and interpret them,
to open a file generated in addition to the xs2m that can be opened with the xsidlist.exe tool
for the dump and conversion of the files generated by the wav I still can't understand, you should also get a midi from the wav for the parameters that cannot be created manually, such as
the pulse width
the filter
in the export midi xsid the arpeggios are obviously a note in the midi!
from deepsid instead you see better, as also on c64debbuger,
what drives me mad most of all are the arpeggios,
which I repeat, you cannot go fancy.
and they include the rhythm part, such as drum, snare, and also support the bass and are present in all the chiptune songs and have given character to the chiptune songs.

On the notes written on a post on this forum opened by M3wP who is Daniel England developer of the Xsid program there is a post
that I report on the PWM (pulse width modulation)

"The Pulse Width data can be output in one of two ways, single controller or double controller (or just not at all ...). For single controller, the Pulse Width is scaled down to the range 0..127 and output on controller 16. For double controller, the scaled range is 0..16383 and is output on controller 16 for coarse (high bits) and 17 for fine (low bits). "

the midi values ​​range from 0 to 127 which are present on all midi keyboards and also in sequencers they are from 0 to 127, on this I am familiar, I did not understand that he is talking about an output 16,
where the pwm values ​​should pass.

having said that we are waiting for the SID master Fabio Marinelli,
that makes us understand with simple written guides but preferably video how to interpret the values ​​from the dump and which tools to use and then report the most faithful values ​​possible on the sequencers and if there is a need for external equipment such as particular hardware analyzers or arduino-type boards where you Play Commodore's original 6581 mos chip.
I leave an interesting video that of a person speaking in Italian where he uses a 90s pc plus an old pc motherboard with a program that runs under ms dos

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

this weird youtuber instead made a conversion from a c64 melody to nes,
and the values are identical to those of the c64, certainly values reported on the goattracker or familytracker programs,
obviously it is a process that I would like to understand how to report the values of the generated dump and if it is useful to have the values of the dentici with a copy and paste of the dump listing.

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

let's wait what says Fabio Marinelli
fabio marinelli
Commodore Fan
Commodore Fan
Posts: 14
Joined: 04/02/2021 - 20:55

Re: how to DUMP the music .SID?

Post by fabio marinelli »

hello @fabioc64 ( why this nick, your name is Fabio?)
as he said in my previous post I only use the dump to get all the information I need ... I really don't know the other programs you mentioned.
with the dump I can find the minimum frame amount (MFA), which I need to find the time in bpm of the song and then do the subdivision of the beats, also I can see changes in tempo and meter ... all things that no program does ( that I know); moreover, very importantly, from the dump I can find and eliminate all the stuttering notes (which are notes generated by bugs of the old editors). Unfortunately, no sid / midi conversion program eliminates these notes ... the result is that you find the metric of the song all busted.
Dump also provides all the values ​​for both the PWM and the filter cutoff. These values ​​are obviously expressed in hexadecimal and I do the conversion by myself. But it is not as difficult as it seems ... first of all I check if the PWM trend is regular, that is, it always increases ( or decreases) by the same value ... in this case I convert only the initial value of the note and the final one. otherwise I do different conversions depending on the pulse trend. I always use the audio automations for both PWM and filter cutoff because I find myself better with the range of values ​​0-100 rather than 1-127 of the midi
the formula is this:
PWM: value (converted to decimal) / 40.96
Filter cutoff: Value (converted to decimal) / 655.05.
Obviously the values ​​are not perfectly exact, it is always an approximation but very very close to the true value
the pitchbend should be logarithmic in the sid so I set the logsarithmic form to cubase to draw the curves in the dedicated bus. Here too it is always an approximation
fabioc64
Commodore Fan
Commodore Fan
Posts: 10
Joined: 20/11/2021 - 20:18

Re: how to DUMP the music .SID?

Post by fabioc64 »

fabio marinelli wrote: <span class="hotdate" style="color:#888;">19/10/2022 - 17:48</span> hello @fabioc64 ( why this nick, your name is Fabio?)
as he said in my previous post I only use the dump to get all the information I need ... I really don't know the other programs you mentioned.
with the dump I can find the minimum frame amount (MFA), which I need to find the time in bpm of the song and then do the subdivision of the beats, also I can see changes in tempo and meter ... all things that no program does ( that I know); moreover, very importantly, from the dump I can find and eliminate all the stuttering notes (which are notes generated by bugs of the old editors). Unfortunately, no sid / midi conversion program eliminates these notes ... the result is that you find the metric of the song all busted.
Dump also provides all the values ​​for both the PWM and the filter cutoff. These values ​​are obviously expressed in hexadecimal and I do the conversion by myself. But it is not as difficult as it seems ... first of all I check if the PWM trend is regular, that is, it always increases ( or decreases) by the same value ... in this case I convert only the initial value of the note and the final one. otherwise I do different conversions depending on the pulse trend. I always use the audio automations for both PWM and filter cutoff because I find myself better with the range of values ​​0-100 rather than 1-127 of the midi
the formula is this:
PWM: value (converted to decimal) / 40.96
Filter cutoff: Value (converted to decimal) / 655.05.
Obviously the values ​​are not perfectly exact, it is always an approximation but very very close to the true value
the pitchbend should be logarithmic in the sid so I set the logsarithmic form to cubase to draw the curves in the dedicated bus. Here too it is always an approximation
thank you for the information you provided me and for your humility in answering me,
I think the subject is not very interested here,
except me.
so maybe I write to you on youtube for more detailed information.
if you could make some video on your channel where you explain how to create and read the dump it would be very helpful,
so I could try my hand at this too,
even with English subtitles, since you are Italian,
or you can kindly answer me on the other topic dedicated to siddump.exe, which I asked for the basic commands and how to start reading.

anyway you gave me a great idea of ​​how to calculate the pwm,
in a nutshell take the initial and final frame of each note and then and insert the colon in the automation for the duration of the note,
this could work if I could interpret the dump values :(
but in some cases the pwm is free it does not have the retrig / keysync or it starts from one pole and ends up on the opposite pole,
or it starts from a central point,
therefore it seems more difficult to calculate the initial frame and final frame because each note is completely different than the pwm.
you have to go crazy finding the pwm value of each note in these cases.
for the arpeggios and the rhythmic parts instead you didn't tell me anything anyway you will read them also from siddump for sure.
you say you don't use other programs,
but I noticed initially it seems to me that in the first remakes the pwm is missing,
and the cubase notes seem to me an export from sid to midi.
in any case undoubtedly yours is a process that takes time,
and I believe that you are the only one to do this job,
your work is at the pinnacle of accuracy, even the developer of insidious,
knows almost or as much as you do about the sid dump.
however there will be programs and hardware that through the ports send the variation of the PWM or cutoff, variation of time,
I am researching about it and I have seen something very interesting developed in C ++,
but i am not able to assemble everything and connect the wires on an arduino hardware.
Post Reply