The difference is: counters counts 4x slower so you have to multiply frequency registers by 4 to get the same output. Filter coefficients have to be adjusted, too.
The summary: you have less precise frequency setting and you have more aliases.
At 250 kHz, where the Nyquist frequency is 125 kHz there should be very few aliases heard and the audio quality should be much better than P1 SIDCog. The output should be "near real thing"
The best option is to run SIDCog at the frequency which is original SID frequency divided by power of 2: 2,4,8 etc; the computation are simpler. There is of course possibility to run SIDcog at any frequency (I did 44.1 kHz version for my P1V retromachine)
Maybe some optimalization can enable SIDCog run at 480 kHz? Or... a full speed? 300 MHz P2 should be enough for this. I will try what I can as soon as I have the board. Maybe this week. The SIDcog is THE program which makes me to be interested in, and use, Propellers
I have a SIDCog inspired SID emulator written for RPi in ARM asm: it runs at near full SID speed (960 kHz) and uses about 30% of RPi3 core. I tried this also at 480 kHz: the sound quality was, maybe, slightly lower, maybe not...
Thanks for the love! AND the excellent answer to hinvs question. This version of SIDcog was a hack to learn how to code P2 pasm and to begin my journey to learn the unique features of the P2. (what a wonderful thing Chip has made... I love it!) Just like you, I am also very excited about emulating SID chips on the P2 and will push that in the Crescendo project. As stated some posts ago, SIDcog, AYcog and SNEcog will not be made as single emulators on the P2 like they were on the P1. Crescendo will have them all (plus more) in a single core object. If you configure Crescendo to only emulate a single SID chip, it will perform equally well compared to an optimized SIDcog implementation on the P2. I have it all figured out in my head and have started coding on it. I do have more important things to do for Parallax first and my time is a little bit limited, but in the end you will have something to play with that will beat the heck out of SIDcog on the P1; There were shortcuts made on the P1 to make it have features that was hard to emulate with the instruction set, MIPS in a single cog and the hard limit to never go below 30,78125 kHz for okayish sound quality. The P2 is a totally different animal and I have not even begun to really optimize the SID emulator hard on the P2 yet. You can play around with this SIDcog hack for the time being to have something at all, but now that Crescendo is in the works and will be were things really takes off.
Btw, I will not persue Retronitus on the P2 either, Wuerfel21 will probably continue the development when she gets her P2. And to be honest I couldn't be happier than to have her doing it. She has made some amazing things on the P1!
Moderators... please lock this thread and make a link to the Crescendo project for further discussions there.
I got the board! At last. Time to start tinkering. I have an idea of several objects... now the free time, or rather lack of. can ba a factor: I have a lot too much to do for my job now.
Edit: cannot get SIDCog 1.4 working at pins 6,7... either silence or a constant frequency... A headphone demo works.
Much to learn now....
Edit: It works when compiled using flexspin. It doesn't work while compiled by Propeller Tool
I spent some time last night and got SIDCog running under PropTool 2.9.2 on the P2. (Ver 1.4) I will post some code this evening. I was able to remove the card coded memory locations for the SID registers and the combinedWaveforms.
Will clean it up to be a standalone object and post it.
Sidcog can be optimized by putting combined waveforms into LUT as I did in my implementation. RDLUT+getbyte is faster than RDBYTE, however, the file has to be reorganized (interleaved).
@pik33 Interesting. The project I am using it in, called the CoCo Blender, it would be advantageous to use LUT rather than Hub ram. The project is a retro computing project for the Tandy Color Computer. I emulate a serial port connected to a modem layer that can connect to other systems using AT commands, a real time clock that is actually just the P2 seconds counter, that gets updated twice a day via NTP, and SID cog. Lot's of hub ram access going on there and anything I can do to pull that back, is good.
Here is a video of the project so far. The OS I am running on the CoCo is called NitrOS-9 and is a multi-tasking OS. (Based on Microware's OS-9)
This SIDCog version is intended for the player, so the register translator is removed, and then SID channels are separated and stereo panned. Also, the waveforms are saved in the buffer for the player to display as an oscilloscope view.
Comments
The difference is: counters counts 4x slower so you have to multiply frequency registers by 4 to get the same output. Filter coefficients have to be adjusted, too.
The summary: you have less precise frequency setting and you have more aliases.
At 250 kHz, where the Nyquist frequency is 125 kHz there should be very few aliases heard and the audio quality should be much better than P1 SIDCog. The output should be "near real thing"
The best option is to run SIDCog at the frequency which is original SID frequency divided by power of 2: 2,4,8 etc; the computation are simpler. There is of course possibility to run SIDcog at any frequency (I did 44.1 kHz version for my P1V retromachine)
Maybe some optimalization can enable SIDCog run at 480 kHz? Or... a full speed? 300 MHz P2 should be enough for this. I will try what I can as soon as I have the board. Maybe this week. The SIDcog is THE program which makes me to be interested in, and use, Propellers
I have a SIDCog inspired SID emulator written for RPi in ARM asm: it runs at near full SID speed (960 kHz) and uses about 30% of RPi3 core. I tried this also at 480 kHz: the sound quality was, maybe, slightly lower, maybe not...
@pik33,
Thanks for the love!
AND the excellent answer to hinvs question. This version of SIDcog was a hack to learn how to code P2 pasm and to begin my journey to learn the unique features of the P2. (what a wonderful thing Chip has made... I love it!) Just like you, I am also very excited about emulating SID chips on the P2 and will push that in the Crescendo project. As stated some posts ago, SIDcog, AYcog and SNEcog will not be made as single emulators on the P2 like they were on the P1. Crescendo will have them all (plus more) in a single core object. If you configure Crescendo to only emulate a single SID chip, it will perform equally well compared to an optimized SIDcog implementation on the P2. I have it all figured out in my head and have started coding on it. I do have more important things to do for Parallax first and my time is a little bit limited, but in the end you will have something to play with that will beat the heck out of SIDcog on the P1; There were shortcuts made on the P1 to make it have features that was hard to emulate with the instruction set, MIPS in a single cog and the hard limit to never go below 30,78125 kHz for okayish sound quality. The P2 is a totally different animal and I have not even begun to really optimize the SID emulator hard on the P2 yet. You can play around with this SIDcog hack for the time being to have something at all, but now that Crescendo is in the works and will be were things really takes off.
Btw, I will not persue Retronitus on the P2 either, Wuerfel21 will probably continue the development when she gets her P2. And to be honest I couldn't be happier than to have her doing it. She has made some amazing things on the P1!
Moderators... please lock this thread and make a link to the Crescendo project for further discussions there.
/Johannes
I got the board! At last. Time to start tinkering. I have an idea of several objects... now the free time, or rather lack of. can ba a factor: I have a lot too much to do for my job now.
Edit: cannot get SIDCog 1.4 working at pins 6,7... either silence or a constant frequency... A headphone demo works.
Much to learn now....
Edit: It works when compiled using flexspin. It doesn't work while compiled by Propeller Tool
I spent some time last night and got SIDCog running under PropTool 2.9.2 on the P2. (Ver 1.4) I will post some code this evening. I was able to remove the card coded memory locations for the SID registers and the combinedWaveforms.
Will clean it up to be a standalone object and post it.
--Terry
The attached allows you to run SIDCog in PropTool. Enjoy.
Sidcog can be optimized by putting combined waveforms into LUT as I did in my implementation. RDLUT+getbyte is faster than RDBYTE, however, the file has to be reorganized (interleaved).
@pik33 Interesting. The project I am using it in, called the CoCo Blender, it would be advantageous to use LUT rather than Hub ram. The project is a retro computing project for the Tandy Color Computer. I emulate a serial port connected to a modem layer that can connect to other systems using AT commands, a real time clock that is actually just the P2 seconds counter, that gets updated twice a day via NTP, and SID cog. Lot's of hub ram access going on there and anything I can do to pull that back, is good.
Here is a video of the project so far. The OS I am running on the CoCo is called NitrOS-9 and is a multi-tasking OS. (Based on Microware's OS-9)
CoCo is exotic where I live. The most popular 8-bit computer here was Atari 800XL/65XE, then ZX Spectrum and C64
My modified SIDCog is here: https://gitlab.com/pik33/P2-retromachine/-/blob/main/Propeller/P2P16/sidcog8.spin2
There is a 'cv2' file in the reposiotory and that is remixed combined waveform file.
The repository is my multiformat player - the topic is here: https://forums.parallax.com/discussion/174334/prop2play-audio-player-for-a-p2-ec32-0-33-1024x600
This SIDCog version is intended for the player, so the register translator is removed, and then SID channels are separated and stereo panned. Also, the waveforms are saved in the buffer for the player to display as an oscilloscope view.