| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
How to mute the voices of the SID?
Hi!
I want to remix my favorite SID tunes. A lot of them have nice rhythm, ideas and melody, but if I hear them more then 10 times in a loop, I get dizzy.
I want to bring more stillness and a different temper in them - making a remix.
My idea is to mute one or two of the voices of the SID and additionally fiddle around with some registers.
I did that with emulators like the C64debugger("24Hours Demo Remix" on YT) and the result is quite nice. Now I want to do it on the C64 itself.
As I am no SID programmer or musician, I have no clue how to do it on the real machine.
I understand fundamental assembly coding, but I am far from doing fancy stuff.
So I need your help! |
|
| |
Mixer
Registered: Apr 2008 Posts: 454 |
Well, there is no channel mute directly on SID, but you can do a buffered write to SID. F.ex turn the IO memory off, so that the register writes to SID go "under" the IO into RAM. Then you can copy the stuff you want to hear from "under" the IO on and write to SID only the stuff you wish to hear. You need to do this per each player call.
You can also alter the play routines to do SID register writes to some alternate location as a buffer and then to SID yourself. Using the RAM "under" is a more general solution. |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
You could run the player in an emulator or even create your own instrumented 6502 emulation layer so capture the SID writes and then play back the SID writes later on.
Or you could try the rip SID functionality in my MusicStudio which allows instruments and drum sounds to be ripped from SID files. https://www.youtube.com/watch?v=HKkapWwicA4 |
| |
deetsay
Registered: Aug 2005 Posts: 43 |
I wrote this DJ software specifically because someone asked if muting channels would be possible :-).
DS/DJ-2000 mk1 Alpha
Song compatibility is not incredible, but most modern stuff works -- as long as there are no samples and the address doesn't collide with the player or the buffer. This works basically as Mixer wrote.
Hit 1/2/3 to mute channels. F to adjust filter (or was it shift-F) and use paddle 1 in port 1, or something. No register fiddling available beyond that I'm afraid. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Wow, I will look in the tipps and the mixer software!
So it is like I guessed from looking at the SID registers: There is no muting implemented. Just everything on or off or in between.
As i am lazy and do want to have a general solution for all musicplay routines with just little adaptation:
What happens if I let the original music routine writes to the registers and after the RTS I call my muting/mixing routine to set e.g. the frequency of chanel 1 to something mute (0 ?) ? |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
For completeness sake – in addition to what Mixer said – to just mute a voice it's usually enough to set the according control register to $00:
$D404 voice 1
$D40B voice 2
$D412 voice 3
EDIT: Oh, and no it doesn't work to let the music routine write to the SID registers and the modify them again. This will be audible.
proper way is:
set $01 to ie. $34
jsr music
copy $D400-$D418 elsewhere ("virtual" regs)
set $01 to ie. $35
modify the "virtual" regs
copy the "virtual" regs to SID registers |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Yeah - the audible clicks or what ever comes out may be a nice special effect ;-)
I go for the $01-deflector and a buffer for the clean mutness.
I am very excited to do the routine. This sounds like the right amount of coding and doable for me with your hints!
Thanks!!! |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Quote: For completeness sake – in addition to what Mixer said – to just mute a voice it's usually enough to set the according control register to $00:
$D404 voice 1
$D40B voice 2
$D412 voice 3
EDIT: Oh, and no it doesn't work to let the music routine write to the SID registers and the modify them again. This will be audible.
proper way is:
set $01 to ie. $34
jsr music
copy $D400-$D418 elsewhere ("virtual" regs)
set $01 to ie. $35
modify the "virtual" regs
copy the "virtual" regs to SID registers
Yeah, just did the dirty overwrite with 0 without shadow copy - sounds like getting grilled by a robot in Impossible Mission.
Nice effect.
With the 6581 it is really loud and eratic somehow; with the 8580 it is more gentle.
I use VICE, but the result should be quite the same on the real machine I guess.
Okay, now do it the full way. |
| |
Bansai
Registered: Feb 2023 Posts: 49 |
There is muting, but only for voice 3. See $D418 bit 7.
https://www.oxyron.de/html/registers_sid.html |
| |
aeeben
Registered: May 2002 Posts: 44 |
If you don't need the filter, you can mute voices 1-2 by routing them to filter (poke54295,1 / poke54295,2) and turning off all filter types (poke54296,15).
But Deetsay's DJ SID mixer is probably the way to go! :) |
| |
Stone
Registered: Oct 2006 Posts: 172 |
Some players have a lookup table for the voice offsets. Look for the byte sequence $00,$07,$0e. Then you can change whatever voice you want to mute by setting it to $19. This will redirect writes to read-only/unused registers. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
The sound result with the buffered routine is not the same. :-(
Percussion instruments sound dull and powerless.
Hearable especially on "Beat to a pulp" from NE7 (voice 3).
Any ideas?
I still look for a bug in my code, but I think it is related to the different technique/timing of writing to the IOs. |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
As "Beat to a Pulp" uses a quite "new" routine (GT1) it's verly likely there's something wrong with your code.
I just threw the SID through my "sidanalyzer" script / code which uses the above mentioned approach and everything sounds fine to me, when (un)muting voices:
https://trans.jansalleine.com/csdb/sidanalyzer-bttp.prg |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Quote: As "Beat to a Pulp" uses a quite "new" routine (GT1) it's verly likely there's something wrong with your code.
I just threw the SID through my "sidanalyzer" script / code which uses the above mentioned approach and everything sounds fine to me, when (un)muting voices:
https://trans.jansalleine.com/csdb/sidanalyzer-bttp.prg
Thanks Spider-j!!
With your routine "Beat to a pulp" sounds like it should be . Now I hear the exact difference with muted voices 1 und 2!!
I'l do some bug hunting.... |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Well...I think there is a problem in my code and in the general aproach.
I recorded voice 3 of "Beat to a pulp" with:
1) C64jukebox with SIDPlay2 recorded with Chrome Audio extension
2) spider-j routine recorded within VICE 3.8
3) my routine recorded within VICE 3.8
#2 is better than #3, but #1 is far better than the latter.
The SID model and resampling, buffer, filter, etc. did not change this behavior in VICE.
Here are the files:
https://www.dropbox.com/scl/fo/gcjp4k8qmc9uf6vn1cg99/AEP9FGA1Yy.. |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
@Rub_0201:
Could it be that that sidplay2 is configured to emulate 6581 SID and your VICE to emulate 8580?
Your recordings from VICE could be 8580 "filter holes" because on 6581 cutoff values from $00 are audible and on 8580 only values from $01. Although even listening to it with proper 6581 emulation the SID voice 3 does sound a bit weird. So I'm not really sure about that. Maybe not the best test case.
To get your routines right I'd start with
1.) a SID tune that doesn't use filters at all - so the even most crappy emulation shouldn't have much problems to playback
2.) and then a SID tune that uses "mild" filters AND only compare results with a somewhat current SID emulation
Another problem with the tune you're referring to is, that is was done in GT1 and nobody other than the author knows if it was ever tested on real hardware. So it may be that it sounds "better" on old / outdated emulation, because it was composed on old / outdated emulation :-) |
| |
Burglar
Registered: Dec 2004 Posts: 1105 |
you can mute channels with JSIDPlay2 V4.10, and u can also export to wav. personally, I only use the cli interface, but I guess same features are in the gui too. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
I hope, the emulator is acurate and the test results are similar on the real hardware.
I've set the SID to 6581 imho for the tests.
--------------------------
This song is a challenge :-) And I love this song since 35 years. Well, the Amiga version - Met Romeo Knight on X2023.
Challenge accepted - I used C64 Debugger to see the timing of the IO Writes and the new version of my play routine is good enough now!
Voice 3 only:
https://www.dropbox.com/scl/fi/adcy922bq5j06hmsqofxc/Rub_V2_vic.. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Testing some more songs, stumbled into klicking noise in NE7 "Cargo".
This time it is Voice 1:
https://www.dropbox.com/scl/fi/6nm77bidyfcccu0dc54fc/Rub_NE7-Ca..
Is it the same playroutine? Yes, SIDPlay says Goattracker V1.x as on "Beat to the pulp". |
| |
Mixer
Registered: Apr 2008 Posts: 454 |
Clicks and snaps are part of SID music :) You may also notice differences due to the ring and sync modulated sounds. They need the other sid voice oscillator active, using correct waveform and frequency. In that case you may have to use some other method to mute the channel. Perhaps ADSR to 0 or the filter as aeeben mentioned. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Ahh, now it makes klick ;-)
Good to know, @Mixer, the klicks in that instrument are not intended and they apear also with all voices playing. |
| |
Hoogo
Registered: Jun 2002 Posts: 105 |
Is it common that players access SID registers only once each call? If there were more, then the first access would be lost. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11390 |
Most "modern" players do. However, lots of old players write them more than once - or even read them |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
Quoting MixerClicks and snaps are part of SID music :)
After looking at the actual filter programs I'm pretty sure that the author just had either a completely special 6581 or no real 6581 at all and the old emulation at the time of GT1 was misleading.
Turning on / off filters on one voice in such a manner is something you can only do safely on a 8580.
I know, 6581 fans don't like to hear it, but the 6581 was just "broken" (volume/filter switch clicking, mixed waveforms not working, unpredictable filter curves, etc.) and the 8580 is the way the engineers wanted the SID chip to be. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11390 |
Quote:mixed waveforms not working
They don't work (as intended, or even as documented) on the 8580 either - that they produce a "better" audible result on 8580 is purely a side effect of the different manufacturing process (there is no "fix" for this in the 8580) :) |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
Quoting chatGPZof the different manufacturing process (there is no "fix" for this in the 8580) :)
Well at least the manufactoring process seems to have been optimized (?) in a way that you get comparable results between chips – I'd also let this count as kind of a "fix" :-) |
| |
Bansai
Registered: Feb 2023 Posts: 49 |
Quote: Clicks and snaps are part of SID music :) You may also notice differences due to the ring and sync modulated sounds. They need the other sid voice oscillator active, using correct waveform and frequency. In that case you may have to use some other method to mute the channel. Perhaps ADSR to 0 or the filter as aeeben mentioned.
Sometimes it's helpful bringing up the scope display on DeepSID to see what's going on, or record to a wav file and bring it up in Audacity.
ADSR=0 in isolation should still cause some undesired noise on gate 0->1 because there will be that 2ms attack to 15 even though the sustain volume is zero. This is part of what makes using sustain as a per-voice volume control a bit of a tricky proposition because if you ever store, for example, pulse $40 then $41 back-to-back in order to get a new sustain in the envelope generator, you'll see that momentary spike in the waveform as a quick, little triangular hat. It's very obvious for noise waveform. If you just do it once when muted and AND the target waveform with #$FE, sustain=0 should work fine unless there is some kind of oscillator leakage. Doesn't that exist where some oscillators can be heard quite faintly on some chips even when they're completely gated off?
Perhaps the only reliable way one could mute a voice because of cross-voice features like ring modulation and hard sync is at a point downstream past all the digital calculations.
If you're running this in an emulator for your own personal use such as during song development, it doesn't matter. You could just throw a register decode out there at $d41d-$d41f that does what you want.
But yeah, those clicks and snaps. :-) |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Banzai,
DeepSID is amazing. Did not know about it.
Checked a lot of buttons - did not find a scope view though.
The unwanted clicks are gone now! Went to more SIDs and Rob Hubbard plays great - project is going well :-) |
| |
Bansai
Registered: Feb 2023 Posts: 49 |
Quote: Banzai,
DeepSID is amazing. Did not know about it.
Checked a lot of buttons - did not find a scope view though.
The unwanted clicks are gone now! Went to more SIDs and Rob Hubbard plays great - project is going well :-)
JCH and others did a great job with that site.
There should be a tab for the scope
News / Tags / Scope / Filter / Stereo
It's not available for all players, but it should work for the regular WebSid one (not legacy).
Volume is also shown if you scroll down once waves are up, so for the usual $D418 digis, you can see them as well. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Thanks bansai. Found the buttons. They're on the left. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
After a lot of coding, testing and debugging, it is time to go live!
I released the first demo using muting and manipulation of two sid chips.
All actions are recorded during a live session.
The recording is played back and gives the demo.
LIVE |
| |
Mixer
Registered: Apr 2008 Posts: 454 |
Do mashups of sid tunes. |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
This first one just takes one Sid tune. So I call this a remix.
SID Mashup needs at least two of them. The next step!
I can do this by extracting „samples“ from one song and play them vs another song.
Would be nice to have BPM in HVSC to find matching songs. |
| |
Mixer
Registered: Apr 2008 Posts: 454 |
I'd just make the player run on timers so that you can change the call rate for each sidtune. This way you can choose your speed for each tune. Many will sound wrong, but hey, it'll be interesting and different. :) |
| |
Rub_0201
Registered: Apr 2019 Posts: 19 |
Uuuh, never used timer.
From the CIAs, right?
Can I set a timer and let this trigger an interrupt?
I think this is a great feature to add! |