Okey guys here it is, an emulation of the famous sound chip used in the Commodore 64 !

Download the zip file and run "ExamplePlayroutine.spin" and "ExampleSidDumpPlay.spin".
"ExampleSidDumpPlay.spin" needs a SD card and the file "Russian.dmp" in the root of the card.

There are two different versions of SIDcog:
- If you want a more accurate emulation of the SID use "SIDcog". (playback of C64 SID dump files)
- If you want a small footprint use "SIDcog_Lite". (uses 63% of the space compared to SIDcog)

The only difference between the two versions at the moment are the combined waveform support in "SIDcog".

SIDcog version 0.80 features:
- Runs in one cog - totally self contained.
- 31kHz sample rate.
- >16bit resolution.
- Full filter support - any combination of Lowpass, Bandpass and Highpass filter.
- Full envelope support with a logarithmic release/decay curve. ( uses the same logarithmic approximation as a real SID)
- Supports all 4 waveform types
- Combined waveform support ( Not supported in SIDcog Lite )
- 16 steps main volume.
- Waveform reset bit works. (many Rob Hubbard tunes relies on this exact behaviour)
- Ring modulation.
- Oscillator synchronization.
- Can be "programmed" in the EXACT same way as a real SID. (Have a look at the official SID documentation for a better understanding)

BTW, if you have missed the initial SIDcog demo have a look at http://forums.parallax.com/showthread.php?p=855167
Here is a link to an archive containing the SID dumper (http://gadgetgangster.com/scripts/displayasset.php?id=361) tool.
Download SIDcog serial player (http://www.mongofiles.com/file/18079/SIDcog_SerialPlayer.7z) to play SID-tunes via a serial link to a propeller running SIDcog.

Post Edited (Ahle2) : 6/14/2010 6:35:43 PM GMT

Coley

12-12-2009, 12:44 AM

Thank you so much for this excellent piece of work.

This will be used many many times over http://forums.parallax.com/images/smilies/wink.gif

Coley

PS Do you have an app to dump the SID registers?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PropGFX (http://www.propgfx.co.uk) - The home of the Hybrid Development System and PropGFX Lite

Post Edited (Coley) : 12/11/2009 10:59:11 PM GMT

Baggers

12-12-2009, 12:52 AM

Excellent Ahle2 :D thanks, and like Coley says, this will be used many many times over!

Baggers.

PS, I think we should really think about making a ModTracker. in Spin.
Paul (Paulie) Hughes, who wrote the Ocean Loader, and driver for most of the early OCEAN SID tunes has 6502 source on his website, for the driver.
We just need to convert it to spin/pasm, then make a tracker :)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

·

Ahle2

12-12-2009, 01:22 AM

Coley said...
Thank you so much for this excellent piece of work.

This will be used many many times over http://forums.parallax.com/images/smilies/wink.gif

Coley

PS Do you have an app to dum the SID registers?

Yes, I do.... But it's buggy at the moment http://forums.parallax.com/images/smilies/blush.gif
I will make a bug free platform independant QT version as soon as I have got any time.

Baggers

12-12-2009, 04:01 AM

Ahle2, I just noticed the example play routine :) EXCELLENT.
Looks like I'm definitely going to have to make an on prop tracker now!

Cheers,
Jim.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

·

Ahle2

12-12-2009, 05:02 AM

Baggers said...
Ahle2, I just noticed the example play routine :) EXCELLENT.
Looks like I'm definitely going to have to make an on prop tracker now!

Cheers,
Jim.

Yes.... You just have to do that http://forums.parallax.com/images/smilies/jumpin.gif

I have been a tracker musician for 15 years and would LOVE to have a real tracker for the prop.
It will be soooo much easier than typing in all the music data as numbers in a dat block.
It took me forever just to type in all those numbers and the end result wasn't as good as I would have wanted it to be. (Its EXTREMELY hard to make anything decent by typing numbers in dat block)

In the early 90s I used Protracker on my Amiga 500 and was limited to just 4 channels.
In the mid 90s I used to do my music in Digibooster Professional on my Ultra Expanded Amiga 1200 and could have up to 128 channels.
Today i'm using Psycle with 100s of VST synths and unlimted amount of channels.
Tomorrow I will use SIDcog tracker on a Parallax Propeller with just 3 channels. http://forums.parallax.com/images/smilies/wink.gif

The circle is finally closed....

Ariba

12-14-2009, 06:16 AM

Ahle2

Thank you so much for releasing the source.
Nice and well commented code !

I have played a bit with the SID object, mainly to test the filter.
Why have you made the resonance parameter a constant, and do not use the according SID register to change it?
The resonance seems to work well.

Can you convert the attached .SID file, I would like to compare it with the MP3s of this site: sid.kubarth.com/ (http://sid.kubarth.com/)

Thanks again
Andy

Ahle2

12-14-2009, 09:09 AM

The reason for it being a constant is... it simply isn't enough cycles left for the additional multiplication that is needed for calculating the resonance level.
I could make it work by change the sample frequency to 15khz instead of 30Khz.... but is it worth it?

I will try to make a proper version of my SID dumping tool and release it here.

I have attached a RAR-file containing 141 dumps. Just rename the file to .rar

Post Edited (Ahle2) : 12/14/2009 1:20:09 AM GMT

Baggers

12-14-2009, 05:23 PM

Nice to see you have the waveform reset bit working :)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

You just can't help yourself can you?
I just knew you'd mention XMOS.......

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PropGFX (http://www.propgfx.co.uk) - The home of the Hybrid Development System and PropGFX Lite

Leon

12-14-2009, 10:43 PM

I thought that comparing the two techniques might be of interest.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM

Ahle2

12-15-2009, 01:29 AM

As far as I understand, he just took an already available SID emulator and compiled it for the XMOS.
That's cheating http://forums.parallax.com/images/smilies/nono.gif

Leon

12-15-2009, 02:11 AM

Yes. He used the SID Codec for Rockbox based on the TinySID engine.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM

Ahle2

12-15-2009, 03:22 AM

Leon said...
Yes. He used the SID Codec for Rockbox based on the TinySID engine.

Leon

TinySID is quite inaccurate actually. I did a lot of research for this project and I had a little look at the TinySID source code.
The envelope part is totally wrong.
And the combined waveforms is just a logical anding of the waveforms wich is incorrect.

Leon

12-15-2009, 04:01 AM

I might try them both and see if if they sound different.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM

Ahle2

12-16-2009, 11:15 PM

Here is a little cool demonstration of psuedo stereo sid playing using two SIDcogs at once.

Oldbitcollector (Jeff)

12-16-2009, 11:51 PM

I've lost track of the fsrw thread (it's been moving forward fast!) but can it now support
the opening of two different files? If so, you could open both the right and left sides of
stereo sid files and play them in six voices.

Here's a bunch of data from another Commodore die hard (Glenn wouldn't mind that title.) on stereo SIDs.
www.lyonlabs.org/commodore/stereo-sid/index.html (http://www.lyonlabs.org/commodore/stereo-sid/index.html)

I will have a look to see if there is an easy way of getting dumps of music made in Stereo sidplay.
They can't be dumped in my tool at the moment. :(

lonesock

12-17-2009, 07:19 AM

Oldbitcollector said...
I've lost track of the fsrw thread (it's been moving forward fast!) but can it now support
the opening of two different files?...

Yep. Just declare an array of FSRW objects, and make sure to mount one of them.

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.

Ariba

12-17-2009, 07:21 AM

Hello Ahle2

Here are some results of my experimenting.

1) A midi file player with the SID as target. Not very useful for GeneralMidi files, but theoretically one can compose SID music in a sequencer on the first 3 MIDI channels, save it as midi file, and ply it with this code from SD card.

2) A SID variation with resonance, that goes near to self oscillating. Has perhaps not much tot do with the real SID, but who cares ;)

Andy

Ahle2

12-17-2009, 08:43 AM

Very interesting Ariba!
Thanks!

Ariba said...

1) A midi file player with the SID as target. Not very useful for GeneralMidi files, but theoretically one can compose SID music in a sequencer on the first 3 MIDI channels, save it as midi file, and ply it with this code from SD card.

Theoretically we can have 6 SIDcogs running at once (1 cog for control and 1 for fswr), that's 6*3 = 18 channels and that's enough for good midi playback.
Now we just need to make presets for all the 128 GM sounds http://forums.parallax.com/images/smilies/wink.gif

Ariba said...

2) A SID variation with resonance, that goes near to self oscillating. Has perhaps not much tot do with the real SID, but who cares ;)

Well, SIDcog already had resonance but I understand what you mean.
"A SID variation with the abilility to adjust the resonance amount" would be more accurate to say http://forums.parallax.com/images/smilies/smilewinkgrin.gif

Anyway, it's a very fast and good solution using a table until I have optimized the code enough to be able to do it more accurately with linear multiplication as I initially intended.
I will keep that in my code for now, but I will calibrate it with a real SID as reference because the resonance is way to much at higher values http://forums.parallax.com/images/smilies/shocked.gif

JonnyMac

12-28-2009, 11:27 AM

Is there a way to detect when one of the channels is quiet, i.e., it has completed the release portion of the ADSR envelope?

Ahle2

12-28-2009, 09:25 PM

JonnyMac said...
Is there a way to detect when one of the channels is quiet, i.e., it has completed the release portion of the ADSR envelope?

No... that whould require some extra hubops and in the end I would have to half the sample rate to 15Khz to make it work (SIDcog already uses >96% of the COGtime at 31khz).

If you want to know how many milliseconds it is from noteOff until complete silence.
Example:

releaseValue := 15
timeToSilence := decayReleaseTable[releaseValue]

Post Edited (Ahle2) : 12/28/2009 1:46:28 PM GMT

mikediv

12-29-2009, 01:09 AM

Ahle2, very nice, Thank you for sharing your work with us I will use it a lot

JonnyMac

12-29-2009, 07:28 AM

@Ahle2: That was the path I started down. Thanks for the confirmation.

Ahle2

12-29-2009, 05:29 PM

@JonnyMac
It isn't an exact science though, because theoretically it never gets completely silenced thanks to the logarithmic decay/release curve.

SIDcog has got a 16bit envelope resolution instead of an 8bit as on the real C64.
This will cause the tone to stay audible longer when the envelope are "beyond the 8bit resolution".

The constant DTCF (Decay Table Correction Factor) can be adjusted to perfectly match the decay/release times of the SID.
I have calibrated this factor by ear while comparing dumped SID tunes to my real C64.
I'll do it more scientifically with the help of a clock when I've got the time.

Attack times doesn't need any correction thanks to the linear behavior.

@Everybody
I'll need your oppinion:
- What methods to add/change/delete/rename?
- Add support for an external voice input? (Like a real SID)
- Implement combined waveforms with the help of lookup tables on behalf of cog memory space? (It would require at least 4kb for decent quality)

And please share any experience, bug, thought or project that involves SIDcog http://forums.parallax.com/images/smilies/cool.gif

@Nick McClick
Luckily combined waveforms are seldom used, therefore it havn't been a priority to implement support for it.
Maybe 3% of all available C64 "material" makes use of it.
The reason is that the older version of the sid chip(6581), produced between 1982-1986, couldn't handle combined waveforms very well..
Even the later version(8580), produced between 1986-1993, made "unpredictable" sounds whith combined waveforms.
All SID emulators on the PC, except for TinySID, relies on lookup tables, because combined waveforms are almost impossible to emulate properly with known algorithms.
TinySID does combined waveforms by bitwise anding of the waveforms (exactly as the patent says) but in reality the result isn't even close to the real deal.
Combined waveforms tends to have an "analog" feature about them and can vary over time and between different SID chips.

SIDcog "converts" all combined waveforms to saw waves for now.

Here is a very good example of a "proper" usage of combined waveforms www.youtube.com/watch?v=-htbkZ72FgI&feature=related (http://www.youtube.com/watch?v=-htbkZ72FgI&feature=related)
Listen to the guitar/harp like sound at the beginning of the tune.

Nick McClick

12-30-2009, 12:07 PM

It might be interesting - not so much to play other tunes, but maybe as a synth. Sidcog could be the core of an awesome synth.

@Nick McClick
A lot of peope have built their own synths with real SID chips. Have a look at these.
www.youtube.com/watch?v=lnTh4e0b-ic&feature=related (http://www.youtube.com/watch?v=lnTh4e0b-ic&feature=related)
www.youtube.com/watch?v=lQlHboNGzMU (http://www.youtube.com/watch?v=lQlHboNGzMU)

And here is music making on the C64 with the help of the MSSIAH cartridge and a Commodore 1350 mouse.
www.youtube.com/watch?v=1r-yMTLVW1U (http://www.youtube.com/watch?v=1r-yMTLVW1U)

Theoretically we could have 6 SIDcogs running at once, one cog mixing it down to two stereo channels and the last cog controlling it all.
That's 18 channels and whould be enough for a decent synthesizer.

@Oldbitcollector
Personally I love the drum sounds generated on the C64.
But if you are talking about natural sounding drums, it's not going to be easy.
The SID isn't about creating natural sounding sounds at all.

The Paula chip in the Amiga was great for natural sounds thanks to being sample based.
Have a look at www.youtube.com/watch?v=nTz5iwmtkrs (http://www.youtube.com/watch?v=nTz5iwmtkrs)
Everything you hear is from that little sound chip created in 1985... (My PC/Console friends were SOOOOO jealous back then)

Ahle2

01-13-2010, 06:13 AM

Look at first post.
I've uploaded a beta version of my SID dumper, so you guys can dump your own *.sid tunes to *.dmp files.
It basically is a SID player with the ability to "dump" SID register data into "dump files".

It features:
- Code by me ;)
- SID emulation.
- 6502 emulation. The first ever seekable CPU emulation. (Yes, SEEKABLE. Try the slider in the player tab)
- Nice GUI
- Platform independent... but only a Windows version is available for now. (Is there any mac guy willing to compile a mac version?)

Instructions:
1. Add some sid files to the playlist (SID player tab)
2. Select some of the tunes
3. Go to the SID dumper tab.
4. Select a path to dump to.
4. Set "Dump end point" to something like 00:03:00 ( 3 minutes )
5. Press the button labeled "Start dumping"

BTW, Look at the "SID dump player" code at the top for an example on how to playback *.dmp files from a SD card using SIDcog.
You can also download Jeff Ledgers "SID player" to playback dumps.

That's odd. Second time today, someone was missing a qtgui.dll file,
and the other time was on a social forum not a technical one.

I always wondered why Windows can't compile only the pieces from dll files that they need into a single complete exe.
Even if dlls do something with global variables, there could be just an array of global variables for them.

Post Edited (VIRAND) : 1/12/2010 11:16:08 PM GMT

Ahle2

01-13-2010, 07:13 AM

It was too big to fit... :(
You can download it here (http://byuu.org/download.php?file=bsnes_v059.zip).... just copy the QtGui4.dll file.

Ahle2

01-23-2010, 05:58 AM

There are a lot of people in this forum that have not got a SD card connected to the prop or they simply are to lazy to bother testing SIDcog.
So here is a medley of 12 C64 tunes recorded directly from a propeller running SIDcog.
www.mongofiles.com/file/16540/SIDcogMedley.mp3 (http://www.mongofiles.com/file/16540/SIDcogMedley.mp3)

Cluso99

01-23-2010, 10:48 AM

Ahle2: Very nice medley http://forums.parallax.com/images/smilies/smile.gif Unfortunately I don't have enough time to play with all these great things.

I've just found SIDcog, and it looks to be a very useful platform for building music synthesizers. I hope you will pursue the ability to combine waveforms in each cog. This would be a powerful addition for those of us who want to use SIDcog for music synthesis rather than playing existing files.

Thanks again,
Michael

laserjones

01-25-2010, 05:07 AM

Very impressive work - thanks for sharing this!

Unfortunately, I don't have practical experience with Propeller programming yet (due to a terrible lack of time ...), so I cannot interpret your source code, but maybe you could briefly explain what method you used to implement the filters? I had thought that decent filtering is impossible on a processor that does not even have a hardware multiplier ... But it would be very useful for some synthesizer projects I have in mind for the future.

Also, can I find documentation on the logarithmic envelope function somewhere?

Oldbitcollector said...
Any chance that steel drums could be done with SIDcog?

If no samples are used, I think FM ist the best method for steel drums, so this would be a job for Ariba's phantastic 20-voice FM MIDI synth for the Propeller. I can't imagine a SID doing it realistically. (On the other hand, I could neither imagine a 20-voice FM synth nor a SID emulation for the Propeller, so don't count on my imagination here ...) http://forums.parallax.com/images/smilies/wink.gif

Michael OBannon said...
I've just found SIDcog, and it looks to be a very useful platform for building music synthesizers. I hope you will pursue the ability to combine waveforms in each cog. This would be a powerful addition for those of us who want to use SIDcog for music synthesis rather than playing existing files.

For a stand-alone synth, it could be an option to reduce the number of SID voices per cog - then you could improve the emulation and still have lots of voices when using several cogs.

Ahle2

01-28-2010, 03:09 AM

Michael OBannon said...
Johannes,
I've just found SIDcog, and it looks to be a very useful platform for building music synthesizers. I hope you will pursue the ability to combine waveforms in each cog. This would be a powerful addition for those of us who want to use SIDcog for music synthesis rather than playing existing files.
Thanks again,
Michael

Are you talking about the combined waveforms found in the real SID? Or are you talking combining waveforms by either "anding" or "adding" them together?
Real SID combining is almost impossible with known algorithms, but it can be done with a lookup table and a lot of hub ram.

laserjones said...
Very impressive work - thanks for sharing this!

No, thank YOU for being interested in my work ;)

laserjones said...
I had thought that decent filtering is impossible on a processor that does not even have a hardware multiplier

I use a subroutine for multiplication. It takes a lot of extra cycles but it works thanks to the relatively fast processor speed (20 mips per cog).
SIDcog uses 187.200 32 bit multiplications per second.
I can give you the "pseudo code" for the filter emulation if you want to.
It's probably the simplest way of doing a 6db/octave multi-mode filter, just 32 PASM instruction ( well a lot more if you count the multiplication subroutine calls )

Maybe by using two oscillators and ring modulate and/or synchronize one oscillators with the other. (the famous C64 musician Tim Follin did a lot of strange sounds this way)

laserjones said...
For a stand-alone synth, it could be an option to reduce the number of SID voices per cog - then you could improve the emulation and still have lots of voices when using several cogs.

Well, 31Khz is a little bit low for real hifi sound generation but it's still enough in most cases. Next step is 62Khz and would require more than one cog and it would also require to rename SIDcog :)

laserjones

01-28-2010, 04:19 AM

Ahle2 said...
I can give you the "pseudo code" for the filter emulation if you want to.

That would be great - also for the envelope decay function, if possible. A reference to some online description of the methods would also be sufficient.

When are you going to announce the board I just saw on Gadget Gangster?

Chris Micro

01-31-2010, 03:29 AM

Hi Ahle2,

very nice project. I like the way you wrote the code: very well structured.
I made a SID-Emulator too some time ago.
Here it is AtmegaSID (http://www.roboterclub-freiburg.de/atmega_sound/atmegaSID.html)

It's THAT easy??? I can't believe it ... How can a filter work if it processes each sample completely independently of the others? I would have thought that the function would need to include at least the previous sample as well, and probably even more, as with only one sample (or very few samples), the system does not gain any information about the frequency of the signal - and frequencies is what the filter affects. Or did I misunderstand the pseudo code somehow?

EDIT: Oops, wait ... Filter_B and Filter_L in the first line result from the previous iteration of the routine, right? Then I understand that it can indeed work this way.

@Forrest
It's really not up to me to make the announcement.
I've been suggesting to Jeff and Nick to make a Quiz here on the forum and the winner will win a SIDstick.

TonyWaite

01-31-2010, 07:50 PM

@Ahle2:
Thank you for this object: I have enjoyed the sound demo's.
The code is wonderfully annotated.
I too have been fascinated to see the simplicity of the bandpass filtering.
For a different application, I have been researching how to do a 50-5000Hz bandpass filter.
Is it really only a matter of experimenting with the setCutoff values below?

Changes:
- Combined waveform support.
- Fixed the annoying clicking sound that occured every now and then when playing triangle waveforms.
- Improved envelope handling.
- Partly implemented support for resonance value changes Thanks to Ariba :)
- A lot of small improvements and bugfixes

A new version of SID Dumper is also available.

Changes:
- Improved 6502 emulation
- Improved SID emulation

@TonyWaite

TonyWaite said...
Thank you for this object: I have enjoyed the sound demo's.
The code is wonderfully annotated.

Thanks :)

TonyWaite said...
Is it really only a matter of experimenting with the setCutoff values below?

Yes.

Post Edited (Ahle2) : 2/4/2010 3:36:46 PM GMT

Ahle2

02-12-2010, 09:11 PM

Here is a demonstration song that is played with the latest version of SIDcog (v0.80).
It was recorded directly from the SIDstick (gadgetgangster.com/find-a-project/56?projectnum=236 (http://gadgetgangster.com/find-a-project/56?projectnum=236))

(You will have to rename "SIDcog_v080_Demonstration.mp3_" to "SIDcog_v080_Demonstration.mp3")

Enjoy!

Ahle2

02-20-2010, 04:38 AM

www.youtube.com/watch?v=cZzfhQuW2eE (http://www.youtube.com/watch?v=cZzfhQuW2eE)
Just a nice little clip from the El Jugador from Gadgetgangster.com.

How is this SIDcog releated you might ask?
Well, SIDcog is the sound core used in the SID player at the beginning.

Cluso99

02-20-2010, 11:01 AM

Ahle2: The sounds are great.

What hardware is required on the prop for the audio output? Do you just use an RC network or is more required?
Can it input to a stereo/TV?
How many cogs does it use for the sound generation? (Obviously I haven't looked at the code).

>> Do you just use an RC network or is more required?
yes, pin 10 and 11 are the outputs

Hi Ahle,

your emulator is really great. I just tested it and the sound is fantastic, much better than the sound of my Atmega32 SID.

I tried to run the SID-Dumper, but it seems there is a Problem with the Qt4gui.dll. Is there a version conflict? Is it possible to get the source code of the SID-Dumper?

Ahle2

02-20-2010, 06:56 PM

@Cluso99
It uses one cog, that's why it's called SIDcog http://forums.parallax.com/images/smilies/tongue.gif (and not SIDcogs)
You can run it on any propeller based platform that has got at least one sound channel output through a RS network.
To play SID dumps you need a SD card connected and some dumps to play back.

@Chris Micro
Thanks for the great words.
I just love the look of the Atmega32 connected with a couple of wires, batteries, headphone and nothing else... that thing looks so cool.

Did you try to download the QT4gui.dll from the link provided?

Chris Micro

02-20-2010, 08:25 PM

>>Did you try to download the QT4gui.dll from the link provided?

Yes, but when I run the dumper, it reports some missing function inside the dll.
Could there be some version conflict because on my computer qt is installed? Or does the version of QT4gui.dll provided in you link does not longer fit to your program ?

Ahle2

02-20-2010, 10:16 PM

Yes, it seems to be some kind of conflict.
I know for a fact that the dll file in the archive works. If you put it in the same folder as the exe file, it should "override" any dll files in system32.

tenfold

03-01-2010, 09:04 AM

I dabble in chiptune music, and am also interested in synths of all kinds. After considering buying a hardsid, and realizing it was going to cost more than I wanted to spend I went searching for alternatives and found the sidstick, and then this thread.

First I want to say awesome work! I'm always impressed by projects like this because I have a brain that can't fathom how to even begin something like this.

I have a few questions, and please excuse the noobishness if they sound crazy. I'm not a programmer, and only marginally understand hardware stuff.

Would it be possible to add a midi clock signal to the sidcog, so that a midi port could be added to something like the sidstick. Then, that would send the clock signal out while a sid played so that sids could be synced with other gear. Or midi in, to play sids using an external clock signal?

My other question is a hardware one. Would it be possible to mod the sidstick so that a real sid chip could be added instead of the sidcog?

Thanks for your help, and again, awesome work!

Oldbitcollector (Jeff)

03-01-2010, 09:12 AM

From the hardware side, yes you could add a simple Midi interface, but because of
the design you might need to add a extra chip socket with some I/O pins bent out so that
you can easily access them.

There is a midi object for the Propeller that is available. All that is lacking is some
software glue between it and the sidCOG software which really shouldn't be that
big a deal.

PC:
Run SIDcog_SerialPlayer on your Windows machine.
In the Settings tab, enter the right COM-port number.
In the SID player tab, add some SID tunes from the SID folder in the archive.
Click on a tune and press the play button.
If everything is okey, you should hear some SWEEEET music coming from your Propeller.

@JonnyMac
Have a look at the "Direct control tab" :)

@Cluso99
No, I didn't enter SIDcog in the Prop contest. :(

@tenfold
It should be possible to make a dedicated PCB the size of the propstick that could hold a real SID-chip.
The SID-chip is VERY, VERY hungry though and the battery wouldn't last more than a couple of minutes.

Post Edited (Ahle2) : 3/1/2010 10:52:17 PM GMT

Oldbitcollector (Jeff)

03-02-2010, 08:33 AM

OBC crosses serial SIDcog off his todo list.. AWESOME!

You know this would make a neat add-on board using that new Propeller Backpack board.
How many voices could we generate with something like this?

Looks like the guy behind the Hive retro Computer has made a very cool SID player ( using SIDcog of course :P ) with some leds and a butchered harddrive.
Nice to see some interest in the SIDcog emulator besides from me and Oldbit.
www.youtube.com/watch?v=6CX2E9Xh1hM&feature=player_embedded# (http://www.youtube.com/watch?v=6CX2E9Xh1hM&feature=player_embedded#)

Here are some pictures of the project as well.
hive-project.de/content/1665 (http://hive-project.de/content/1665)

Post Edited (Ahle2) : 3/23/2010 9:14:40 PM GMT

Oldbitcollector (Jeff)

03-24-2010, 05:08 AM

Good deal!

I demand a completed tracker/player for SIDcog.. :) :) <SMIRK>
(referring to your comment in the HERO thread.)

Actually, I just want some easy ways to put sound and music in my games.

@OBC
LOL... Yes it would have been nice to have an easy to use game audio object.
At the moment I'm quite busy with other things :(

tenfold

03-30-2010, 12:29 PM

Hey guys I'm back.

I finally ordered my sidstick and I'm planning on putting it together a little differently so I have a few questions. I know this isn't really a sidstick thread, but I'm sure you can help me.

Is there a reason the sidstick has a stereo out? The original sid was not capable of stereo sound, but is the sidcog capable of that? Does the sidcog by chance have separate outs for each channel (good god please say yes).

Can I use a 9v battery instead of the battery pack that comes with the sidstick?

I would really love for someone to work a midi clock into sidcog, since I have no programming ability whatsoever. Basically what I'm doing is casing the sidstick in a guitar pedal stomp box so I can easily trigger sid tracks to back me up while I play guitar. It should be pretty boss.

Thanks d00ds.

Ahle2

03-31-2010, 12:20 AM

tenfold said...
Hey guys I'm back.

Welcome back. :)

tenfold said...
Is there a reason the sidstick has a stereo out?
The original sid was not capable of stereo sound, but is the sidcog capable of that?
Does the sidcog by chance have separate outs for each channel (good god please say yes).

I don't know exactly what you mean by separate outs.. Do you mean 3 independant outputs, one for each SID channel?
Then the answare is NO.

The SIDstick is capable of stereo output, but the firmware only supports mono output at the moment.
Theoretically there are many different ways to achieve stereo sound with the SIDstick.

- Play the 3 SID channels in each (L and R) audio channel, with slightly different frequency between L/R. This will make the sound appear to come from all around you.
You are still limited to 3 SID channels tough.

- Play 3 SID channels to the left and 3 different SID channels to the right.
This way you can have twice as many SID channels as a real SID while having stereo sound.

- Mxing up to 18 SID channels at once with the help of a mixer-cog. This way you could pan each SID(3 channels) independently and even apply some sound FX.

tenfold said...
Can I use a 9v battery instead of the battery pack that comes with the sidstick?

It depends on wich voltage regulator that is used in the SIDstick, you will have to ask Nick (I can't remember).

tenfold said...
I would really love for someone to work a midi clock into sidcog, since I have no programming ability whatsoever. Basically what I'm doing is casing the sidstick in a guitar pedal stomp box so I can easily trigger sid tracks to back me up while I play guitar. It should be pretty boss.

That's a cool project.
I have some midi equipment, synthesiezers and the knowhow to do something like that, but at the moment I have got NOO time whatsoever. :(
Maybe someone else in the forum are interested in helping you out?
/Johannes

tenfold

04-01-2010, 12:16 PM

Ahle2 said...

- Play the 3 SID channels in each (L and R) audio channel, with slightly different frequency between L/R. This will make the sound appear to come from all around you.
You are still limited to 3 SID channels tough.

- Play 3 SID channels to the left and 3 different SID channels to the right.
This way you can have twice as many SID channels as a real SID while having stereo sound.

- Mxing up to 18 SID channels at once with the help of a mixer-cog. This way you could pan each SID(3 channels) independently and even apply some sound FX.

These are all interesting ideas, but how would you write sid tunes with more than three channels in the first place?

Nick McClick

04-01-2010, 01:26 PM

tenfold said...
Is there a reason the sidstick has a stereo out?
The original sid was not capable of stereo sound, but is the sidcog capable of that?
Does the sidcog by chance have separate outs for each channel (good god please say yes).

The SIDstick hardware supports stereo output, although the current firmware puts the same audio out on both channels. See the schematic (http://www.gadgetgangster.com/scripts/displayasset.php?id=337) on the project page.

The regulator tops out at 6V input. See the datasheet (http://ww1.microchip.com/downloads/en/DeviceDoc/21826a.pdf).

I just tried your multimode filter, and it's really great!
Though the SID filters are 12dB/octave for low and high pass. For band pass it's 6dB/octave on either side of the cutoff.
I think running the filter code twice will be equivalent to a 12dB filter.
Another thing: the resonance seems to be inverted. Correct me if I'm wrong! But in my implementation, I get no resonance
when the param is 1, then full resonance at about 0.3 (I bet the limit is 1-sqrt(2)/2). Lower than that and it gets unstable.
Anyway, thanks for this simple piece of code, it's very useful!

/Daniel

Oldbitcollector (Jeff)

06-01-2010, 09:06 PM

I've been playing with SIDCog over the weekend. I was able to make some serious headway with SIDCog Monday afternoon,
learning some new techniques which weren't that obvious to me. (Probably to everyone else, but I thought I'd share anyway.)

I'd been trying to work the SIDCog player loop into my main program loop creating all kinds of timing havoc.
Finally it dawned on me to handle it this way...

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

playRate = 50'Hz
SD_PIN = 16

VAR

long stack[30]
byte buffer[25]

PUB start

sd.mount(SD_PIN) ' Mount SD card
SID.start ' Start the emulated SID in one cog
sd.popen(string("music.dmp"),"r") ' Open the tune
cognew(Songplayer,@stack[30]) ' Start a simple player in it's own cog.

cognew(Songplayer, @stack[0]) ' Start a simple player in it's own cog.

???

BradC

06-01-2010, 09:38 PM

kuroneko said...
Shouldn't that read

cognew(Songplayer, @stack[0]) ' Start a simple player in it's own cog.

???

I guess it depends if you want to trample buffer[] ;)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Are you suggesting coconuts migrate?"

kf4ixm

06-01-2010, 09:56 PM

@OBC
Thanks for sharing!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm just 7*1027 atoms floating through time and space in close formation. -KF4IXM

Ahle2

06-02-2010, 07:11 PM

Oldbitcollector said...
I'd been trying to work the SIDCog player loop into my main program loop creating all kinds of timing havoc.
Finally it dawned on me to handle it this way...

Nice to see that your are doing stuff with SIDcog. :)
On the C64 music and graphics were synced with the help of timer and vbl interrupts.
Since the propeller "lacks" interrupt "features" you will have to handle things differently.

There are two approaches:
1. Start a dedicated cog to handle music/sound fx. (Like you have done in the example)
2. Have some kind of frame/main counter to sync things to certain intervals or/and circumstances.

Approach 2 can be quite tricky to handle and is prone to "lag" when much is happening at the same time.
As soon as the graphics starts to go slow the audio will be affected as well.

SIDcog is meant to be like a real SID and it's up to you to fill the SID-registers with data to produce sound/music.
However, I'm working on a new "retro like" sound engine named Retronitus ( retro=behind, sonitus=noise or "noise from the past" )
It will pretty much be a mix of the AY38910 and the SID with 6 channels and possible with built in music capabilities.

danielx said...
Though the SID filters are 12dB/octave for low and high pass. For band pass it's 6dB/octave on either side of the cutoff.
I think running the filter code twice will be equivalent to a 12dB filter.

Yes you are right, but it wouldn't be possible at a sample rate of 31kHz. :(

danielx said...

Another thing: the resonance seems to be inverted. Correct me if I'm wrong! But in my implementation, I get no resonance
when the param is 1, then full resonance at about 0.3 (I bet the limit is 1-sqrt(2)/2). Lower than that and it gets unstable.
Anyway, thanks for this simple piece of code, it's very useful!

You are right in the above assumptions as well. ;)

/Daniel

iemand

06-14-2010, 02:13 AM

The link for the qt4gui.dll file doesn't work anymore. Could someone please provide a new link?

I've searched the internet for the file, but the files I found seem to be incompitable for some reason.

Ahle2

06-15-2010, 02:13 AM

I've updated the first post with a link to an external archive containing everything needed in one file.

/Ahle2

Linus Akesson

07-27-2010, 01:32 PM

This is great! Seal of approval granted. =)

Ahle2

07-27-2010, 04:54 PM

Thanks Linus !
When will we see another great propeller project from you?
I know PICs are more challenging to make things with, but i'm sure you could achieve some ground breaking stuff with the propeller.
To this day Turbulence is the most outstanding demo ever made on the Propeller. :)

You may be interested in my upcoming project (almost done now), a graphical chiptune player for the propeller.
It currently supports SID 8580 and AY 3891X emulation.

Okay, here's a short introduction to what I have done with the SIDCog:
- Attached MCP3208 8-Channel 12-Bit ADC to the Propeller with 8
potentiometers in order to control Cutoff, Resonance, Attack, Decay,
Sustain, Release and Volume with analog potentiometers. This gives some
kind of feeling as controling an analog modular synthesizer as the DAC
with 100ksps is fast enough for a "near-realtime" control - you don't hear
any delay.
- Made a 100% midi controllable synthesizer using the SIDcog - the code
is still all "hacked" together, but it works. Will publish some stuff if I
clean it up.
- MIDI seems to work without any problems (there is some little problem -
it seems that a byte gets discarded sometimes when playing some tunes
at >240BPM + live Cutoff & Resonance control. This might be an issue
with the MIDI bandwidth capabilities (31.250 Baud). I'll check out what's
going on with my logic analyzer soon.
- Combined mode (MIDI data + Analog control) is also working. I'm using
an additional Cog for processing the ADC data and modifying the
corresponding variables.
- I've succesfully written a VGA debugger for the SID serial player which
shows the SID registers live on a VGA output. This is quite useful for
debugging purposes, as this is working in it's own COG and the drawing
routine is a lot faster than the QT display function.
- I've made various experiments with the SIDCog - e.g. adding a RNG
which can be seeded with a predefined value
- I've simulated some kind of retro drum sounds - e.g. setting the
Waveform to Noise and adjusting the ADSR as following: 0 1 1 9
so that a "Hall-like" effect appears - this is great for snare sounds for
experimental music and electronic music. Striking the MIDI note
100 makes it sound pretty nice. If you're decreasing the frequency
by 1Hz each 10ms down to MIDI note 80, it sounds like some low-drop
snare (some kind of the early Depeche Mode sound).

6581

10-25-2010, 02:01 PM

You may be interested in my upcoming project (almost done now), a graphical chiptune player for the propeller.
It currently supports SID 8580 and AY 3891X emulation.

Hey, do you have any spin code or video? Sounds great!

Cluso99

10-26-2010, 02:25 AM

6581: Your project sounds great. Congraulations.

jazzed

10-26-2010, 06:06 AM

I'm enjoying these demos. Thanks.

Ahle2

10-27-2010, 06:08 PM

@6581
I am REALLY interested in seeing some videos of this in action. :)

"- Attached MCP3208 8-Channel 12-Bit DAC..."
Didn't you mean ADC ?

"Hey, do you have any spin code or video? Sounds great!"
I don't have any video, but you can have the source code if you want to.
I didn't finish it due to an irritating bug and because of too little spare time. :(

/Ahle2

base2design

10-27-2010, 06:35 PM

I'm definitely interested in the source code. I'm learning lots from the great work of you and others here!

6581

10-28-2010, 12:03 PM

@6581
I am REALLY interested in seeing some videos of this in action. :)

"- Attached MCP3208 8-Channel 12-Bit DAC..."
Didn't you mean ADC ?

"Hey, do you have any spin code or video? Sounds great!"
I don't have any video, but you can have the source code if you want to.
I didn't finish it due to an irritating bug and because of too little spare time. :(

/Ahle2

Yep, I mean the MCP3208 ADC. I was thinking of a DAC because
I was doing a wav player using a MCP4922 DAC.

Sure! I'd like (and probably others too) to see your source code!

6581

10-30-2010, 08:36 PM

I'm just working on "something" SIDcog based.. Guess what it is.. :lol:

http://forums.parallax.com/showthread.php?p=950024#post950024

JLS

10-31-2010, 02:40 PM

Hi all

SidCog is very great project - many thanks this

Please is possible help me make example SidCog and StereoSpatializer spin code ?

Many thanks

Ahle2

04-20-2011, 06:08 PM

SIDcog version 1.0 is in the OBEX. :)

Oldbitcollector (Jeff)

04-20-2011, 06:44 PM

Hey Ahle2, I know you are swamped with various projects, but how about creating an AppNote for this?

OBC

Ahle2

04-21-2011, 03:22 PM

I have been pondering that for a while.
Does it need to be torough??
What should be included?

JonnyMac

04-21-2011, 04:56 PM

I would love to see programming examples to create interesting sounds -- like the train you did last Christmas. Most of the SIDcog demos are playing music but there is no methodology demonstrated for the creation of that music. Still, I think most of us would be happy to add interesting beeps and boops to our programs, so the creation of music is not a big deal.

Yes, he's right, bleeps and bloops are what most will want..
Still being able to generate some easy tunes for games might appeal to a few as well.

OBC

Are you talking about algorithmic composition of original tunes or just playing MIDI encoded files or something like that?

Ahle2

04-22-2011, 09:19 PM

To make an appnote about how to make basic bleeps and bloops shouldn't be too hard.
It will however be a lot harder to make a pedagocially written appnote for how to make a music player routine that takes advantage of all the features of the SID.
It took almost 10 years for music routines to take advantage of ring modulation, oscillator syncronization, full envelope support and full filter support.
When people began to take advantage of these features, it became obvious how much more advanced the SID actually was compared to its competitors.
If you listen to most C64 tunes prior to 1988, they sound almost more like AY38910, NES or Pokey.

RobotWorkshop

04-22-2011, 11:21 PM

Thank you for posting SIDCog and the AYcog objects! I'm using the SIDcog object on one of my robots and want to experiment with some of the sounds it can make. Any examples of making odd sound effects would be helpful. I've learned a bit from the example programs but still have a lot to learn. For me using SIDcog to make authentic sound effects from old games, etc is one of the reasons I was drawn to it. Since it is emulating the chip I suppose the next step is to find some good Commodore links that had program examples showing what codes and data was fed into the SID chip to make all the fancy sound effects. With that we should be able to use the Prop to send the same codes to SIDcog.

Robert

Does anyone happen to have some links to some Commodore sites with SID chip programming examples?

RobotWorkshop

04-25-2011, 02:32 PM

I did a bit of research on the web and found some good links about the SID chip used in the Commodore 64.....

I suppose the main Wiki entry about the SID chip should be updated to include SIDcog as the Propeller emulation of the SID chip.

Has anyone used SIDcog just to generate sound effects on the Propeller? If so I'd love to see some more examples.

Robert

Ahle2

04-25-2011, 02:57 PM

The game H.E.R.O by Baggers uses SIDcog for some really basic sound FX.
http://forums.parallax.com/showthread.php?117935-HERO-using-my-2600-driver&highlight=2600+driver

Have a look at my contribution in this thread
http://forums.parallax.com/showthread.php?130038-looking-for-spacy-sounds-for-the-propeller-chip&highlight=SIDcog+robot

davidsaunders

04-25-2011, 03:58 PM

Ahle2:
You are truly a miracle worker. Any one can play with VGA, it takes a true master to create this level of sound quality. There is a good reason that the SID was so far ahead of its time, truly the work of an engineering deity, producing good sound synthesis is not easy.

Ahle2

04-25-2011, 04:40 PM

Thanks David.. :)

The SID is actually quite much more advanced than the Paula in the Amiga for an example.
To play a sample at an arbitrary frequency with an arbitrary volume is quite simple in comparision.
However the end result when playing back samples impress more people (me too), because it can sound like whatever the sample sounds like.
So when people are saying that the Amiga had a better sound chip, I actually disagree from a pure technical standpoint. From a pure listening standpoint i totally agree. I love all those oldschool protracker tunes.
I used to have them playing in the background while doing "serious computing" in Workbench.

Cheers

davidsaunders

04-25-2011, 04:57 PM

I love all those oldschool protracker tunes.
I used to have them playing in the background while doing "serious computing" in Workbench.
I still have them playing in the background while doing serious computing in Workbench, ScalOS, or Wanderer :) . No wonder Amiga refuses to die.
With out question though the SID is technically the superior sound chip.

Oldbitcollector (Jeff)

04-25-2011, 07:53 PM

Here are some of the books I used for reference for the Synth project.

Do you realise it is all done in software on the prop? The only thing required is the sound output circuitry (unless that is actually what you meant)

83305

IIRC Ahle also said 100 ohm & 0.1uF works fine too.

megaionstorm

07-23-2011, 01:05 PM

Yes, i only need the sound output circuit.

I work with a p8x32a on a breadboard.

On what p8x32a pin must i conned this sound output circuit ?

Cluso99

07-23-2011, 02:19 PM

I am not sure. It is probably documented in the source file.

AntoineDoinel

07-23-2011, 09:21 PM

Yes, i only need the sound output circuit.

I work with a p8x32a on a breadboard.

On what p8x32a pin must i conned this sound output circuit ?

Hi megaionstorm, welcome to the forum.

When you start the SIDcog object you can indicate two pins for output, like this:

sid.start(leftpin, rightpin)

You can also use -1 to indicate that you want no output for left or right side (SIDcog, like the original SID is monophonic anyway).

Since you're using a breadboard I guess you can choose any pin, so it's best to use the lowest possible (you can search the forums for a full explanation, doing this should result in slightly better quality output).

Attach the circuit that Cluso99 posted to P0 (pin #1 in a DIP propeller) and change the code that starts the object to:

sid.start(0, -1)

Regads
Alessandro

Ahle2

08-15-2011, 09:29 PM

I saw the winning C64 demo from the "LCP 2011" demo party that was held between 5-7 august here in Sweden.
One of the tunes from that demo stood out from the rest. It probably is the coolest SID tune that I have ever heard. I just had to test how well SIDcog could reproduce it.

Here is the result: 84076

Here is a video of the demo recorded with an emulator but with live audio from the actual party. (The tune starts playing at 8:00 in this video)

(Remember that the reverb from the big party hall affects the sound in the video)

Ahle2

08-23-2011, 07:57 PM

SIDcog version 1.2 is out.
Download it from the OBEX!

Changes in version 1.2

- Increased ADSR accuracy (Almost perfect now; The famous ADSR bug isn't implemented though)
- Increased Noise accuracy (As close as we will get without decreasing the sample rate of SIDcog)
- Fixed a bug when no waveform was selected
- Decreased the "max cutoff frequency" a bit to fix aliasing issues
- Made some small optimizations

As far accuracy goes, this is a major release!

/Johannes

Cluso99

08-24-2011, 01:37 AM

Thanks Johannes :)

Oldbitcollector (Jeff)

08-24-2011, 04:06 AM

Thanks!!!! -OBC

SIDcog version 1.2 is out.
Download it from the OBEX!

Changes in version 1.2

- Increased ADSR accuracy (Almost perfect now; The famous ADSR bug isn't implemented though)
- Increased Noise accuracy (As close as we will get without decreasing the sample rate of SIDcog)
- Fixed a bug when no waveform was selected
- Decreased the "max cutoff frequency" a bit to fix aliasing issues
- Made some small optimizations

As far accuracy goes, this is a major release!

/Johannes

megaionstorm

08-27-2011, 05:51 PM

How is it possible to create the dmp-files?

AntoineDoinel

08-27-2011, 06:15 PM

How is it possible to create the dmp-files?

hi megaionstorm

try the link to the "SID dumper" app linkws in the very first post of this thread:
http://forums.parallax.com/showthread.php?118285-SIDcog-The-sound-of-the-Commodore-64-!-(Now-in-the-OBEX)&p=863861&viewfull=1#post863861

troxxan

04-05-2012, 01:28 AM

serial sid player download link is dead. your work is awesome btw..

kuroneko

04-05-2012, 02:09 AM

serial sid player download link is dead. your work is awesome btw..
Try this link http://forums.parallax.com/showthread.php?130658-SIDcog-serial-player.

average joe

04-05-2012, 10:20 AM

Wow, this is amazing. Thanks for such an incredible emulator!
I FINALLY have had a chance to play with this a bit, and still have some questions. I have not finished fine tuning my hardware, so sd card is still not working. I can't wait to get that going.
But first, and most important, does anyone have experience with the Midi in object in OBEX. I opened it up, but couldn't find DOC on how the midi stream is output. I see to call event check, but not sure what to do after. It sounds like you other guys have this figured out so any help, hints?

Also something others have figured out, so I wanted to ask. Running multiple instances of sidcog should be easy. Declare multiple instances of sidcog in OBJ, then access each one just like normal. What I'm wondering is, do I need a pin for EACH INSTANCE?

Antoine has a great start on what I'd like to get running, but still trying to understand his code. I'm also trying to figure out what I need to change from "SidSynth_02_110718"
Thank you again Johannes,

*EDIT*
I figured out the midi in object... Had to read the htm. *Once again the noob in me strikes!*

average joe

04-05-2012, 02:14 PM

So I have been trying to get midi working properly and it seems as if the OSC is not fully turning off on note off? I hacked in midi note on and off, just in attempts to get this working.

*edit*
After a bit more playing around, I found disabling the filter made this go away. Now the note "glitches" on release. Not sure if this is just the patch or what. My midi interface is giving me slight clicks on notes so I'm going to revise grounding to try to fix this. Not sure if this is part of the problem but I read something about keeping audio pins low numbers? Could someone elaborate on this? I'm currently using P24 and 27 for output. Also I just realized I never set the cutoff for the filter. Could this be it? What would a LPF with a cutoff set to 0 and resonance set to 15 do? Self oscillate and give the current problem? I'll have to play with this a bit later.

average joe

04-05-2012, 10:44 PM

I updated the midi handler a bit, still no CC implementation. I've been having a blast jamming with sidcog, I'll record a demo in a bit. I'm still having problems with the LPF. I have not tested the rest of the filers. I tried setting different cuttoffs and resonances and it still seems to be self-oscillating. Can someone tell me why? What to look for? I'm totally confused and although it's cool without the filters, I really want to get things working.

Rayman

04-06-2012, 12:15 AM

Hey, I didn't realize this was in OBEX now... That's great! I'll definitely be checking it out now.

Ahle2

04-06-2012, 09:21 AM

@average joe
"do I need a pin for EACH INSTANCE?"
Yes, unless you mix the samples from each instance and output them using an extra cog.

After a bit more playing around, I found disabling the filter made this go away. Now the note "glitches" on release. Not sure if this is just the patch or what. My midi interface is giving me slight clicks on notes so I'm going to revise grounding to try to fix this.
I'm not following you at all, what exactly are the symptoms...

Not sure if this is part of the problem but I read something about keeping audio pins low numbers?
Could someone elaborate on this? I'm currently using P24 and 27 for output.
Even more important is to use a low cog number. Launching SIDcog in cog 7 while all other cores are running sounds very noisy.

Also I just realized I never set the cutoff for the filter. Could this be it? What would a LPF with a cutoff set to 0 and resonance set to 15 do? Self oscillate and give the current problem? I'll have to play with this a bit later.
Just like the real SID, SIDcog can't self oscillate. Setting the cutoff freq to 0 and using a LPF will make everything routed through the filter "inaudible" *; Even if resonance is set to 15!
* Well, just like any LPF it doesn't completely damp all frequencies above the cutoff. But most frequencies components will be "inaudible" two octaves above cutoff.

I've been having a blast jamming with sidcog, I'll record a demo in a bit.
Pleas do that! :)

I'm still having problems with the LPF. I have not tested the rest of the filers. I tried setting different cuttoffs and resonances and it still seems to be self-oscillating.
Are getting a pure sinus tone? At what frequency?
As stated above, SIDcog can't self-oscillate so it must be something else. Can you give me a minimalistic code example where you have got this problem.

Can someone tell me why? What to look for? I'm totally confused and although it's cool without the filters, I really want to get things working.
Without debugging this myself it's very hard to see the reason for your problems.

@Rayman
All my PSG emulators are in the OBEX, so most retro nerds will be able to get their need for square waves satisfied.
Bute I havn't done any emulators for the Pokey or the 2A03 yet. (Nintendo and Atari nerds... please forgive me)

The first example is followed by a pause, then the second example. Please don't mind my crappy playing. The click heard at the beginning is sidcog starting. This is present with or without filter.Not a biggie, getting the filter working is #1 priority right now!

I re-read your post again, and have a few more questions.
Re- sample mixing, I see that others have used sterio spatializer, is this the best way to mix samples, and how do I "pipe" them in? I'll dig a bit more on this myself, I was hoping for some tips from the masters though.

Re- self oscillation, I didn't think the sid was capable of this. I though I'd check though.

Thanks for your time and help. You have some very amazing releases! Keep up the good work!

Ahle2

04-06-2012, 10:48 AM

Are you using the latest version of SIDcog from the OBEX?

average joe

04-06-2012, 10:58 AM

SIDcog - SID/MOS8580 emulator v1.2 (C) 2011 Johannes Ahlebrand
From the header. I'm not sure if it's related to my software. I will strip everything down to bare minimum and try again. Hopefully I can figure out what's causing that ringing on note off. You did hear what I was referring to as far as filter ring. I'm also curious if you heard the glitch on NoteOff without the filter?

average joe

04-06-2012, 05:09 PM

I've been playing around a bit more and just made this demo for SidCog. The song is Skrillex - Scary Monsters and Nice Sprites
http://soundcloud.com/joe-heinz/skrillex-scary-monsters-and-1

I really like the melody in "Scary Monsters and Nice Sprites"... a little bit of drums and some smooth pads and it will be a hit. :)

About the self-oscillation heard in the clip you have provided. It sounds like a square wave so it can't be from the filter itself.
But as you say it is only heard when the filter is activated... strange.
I don't have the time to investigate this right now. I'm sorry! :(

/Johannes

average joe

04-08-2012, 09:21 AM

That is perfectly fine. I tried isolating the object from all other code, including midi and control. Played with cog#. Did not try different pins yet since my hardware is hard wired. I'll see what I can figure out later as I have a 2 - part work around for now. #`1, keep filter values below limit. #2, turn filter OFF if note off and filter > limit. No code on this yet but should keep the gremlin at bay for now.
I totally understand you're inability to work on this right now. It's not a big deal at all since I have the work around. I was just hoping I was doing something wrong, or it was a known bug or whatnot. Thanks for ALL of you're work, help, time and wonderful objects.
BTW in case you were unaware, scary monsters is a huge hit in the USA. *at least among all the Electronic Dance Music people I know* Real song here http://youtu.be/cvvboQlGqb0 I only reference this because you've got great sound emulation running, and I was wondering how you would think the best way to do the bleeps and bloops. I can describe the method elsewhere so as not to hi-jack your thread BUT. This style is VERY popular now among people I know. My favorite song is this http://youtu.be/Z3_gyFD2Ndk the video fits the song. Song starts @ 1:00... I will post tomorrow more on this.

Ahle2

04-08-2012, 11:02 AM

Okey, I see.. didn't know that "scary monster" is a real song.

Here are some tunes I recorded from a QuickStart board running a "filter tweaked" SIDcog object.
The filter cutoff matches a real 8580 much better than before.(this version will be uploaded to OBEX in the near future)
"Sid register writes" are streamed from "SIDcog serial player" running on my PC to an instance of "SIDcogSlave.spin" running on the Propeller.

http://soundcloud.com/ahle2/sets/sid-emulation-running-on-a

/Johannes

average joe

04-08-2012, 11:17 AM

OOOOO I can't WAIT! It does sound WAY closer from the demos. Major development has come to a screeching halt for the next few days. How much work would it take to get access to the filter section? Sid's had the audio in but if I remember right there was just a summing in. You should update this page http://en.wikipedia.org/wiki/MOS_Technology_SID to reflect your work.
*edit*
My buddy asked JUST about Paula emulation. Not something I'm interested in, but he's a retro-gaming enthusiast. He also mentioned an arcade cab running on the prop. We have a 2 player cab with usb - keyboard mapped controls. I told him it was possible, but I don't have the time. He just laughed...

Ahle2

04-24-2012, 10:32 PM

SIDcog version 1.3 is out.
Download it from the OBEX!

Changes in version 1.3

- Fixed a bug when noise + any other waveform was selected at the same time
- Calibrated the cutoff frequency to better match a real 8580
- Cycle optimized code to "make room" for the point below
- Increased resonance accuracy (replaced "4 step logaritmic lookup table" with "16 step bit linear multiplication")
- Increased ADSR accuracy a little bit more (the ADSR bug is still not implemented)

/Johannes

Oldbitcollector (Jeff)

06-10-2012, 07:08 AM

@Ahle2:

Is there any chance you can help me some with some code like this that works with the new version of SIDcog?

Grabbed the chunk of code as well as the "float" object which it calls on.. The code tends to lock up on that command now.

Just had a duh moment thanks to Marko. I may have forgotten that "float" requires a start call. DUH!
(I'm so used to the concept of floating point being automatic. Where's prop2?)

OBC

Tumbler

06-11-2012, 03:13 PM

This is wunderful Ahle!
SidCog playing 'Enola gay' at youtube :http://www.youtube.com/watch?v=O5Szv-8oej8&list=UUWYbKz2Sm27cdXqD5b6HEUA&feature=plcp

Oldbitcollector (Jeff)

06-11-2012, 03:37 PM

@Tumbler, yes!! That board looks great too! Did you do your PCB for that Propeller Platform?

OBC

Tumbler

06-11-2012, 04:45 PM

Jeff, It's a Gadget Gangster Prop Platform. Since it's not available anymore, i had to order it via expess pcb :)
It's a nice one

Oldbitcollector (Jeff)

06-11-2012, 05:29 PM

Jeff, It's a Gadget Gangster Prop Platform. Since it's not available anymore, i had to order it via expess pcb :)
It's a nice one You know, there is no reason for that board to be out of stock. Time to bug Nick about it!

Oldbitcollector (Jeff)

06-13-2012, 05:20 PM

@IDEA

Is there a way to "grep" the attack, decay, sustain, filter, etc, etc. settings from a DMP file so that you could "lift" an interesting sounding instrument from an existing DMP file? This would make an interesting addition to my SIDSynth project.

OBC

Ahle2

06-13-2012, 09:16 PM

That will only work for very early SID tunes. Most pre 1985 SIDs used fixed register values and only triggered note on and note off; The result was very static and didn't sound very "natural" or "lively".

Here's an example from 1984

http://www.youtube.com/watch?v=kAe_IvnEpnk

Then in 1985 the man the myth the legend, Rob Hubbard, began updating register values 50 times per second (between note on and note offs) and effects such as pulse width modulation and vibrato could be achieved.

http://www.youtube.com/watch?v=zbQoQFLM_1s

Listen to the fat bass in the beginning of the tune. The pulse width is updated 50 times per second and is "animated" from 0% to 100% and then from 100% back to 0%. (WOW what a difference in livelyness)
Then listen to the triangle lead; The frequency is also updated 50 times a second, it sweeps up and down many times per second to achieve vibrato.

Later SID tunes uses even more "tricks", such as changing between different waveforms on the fly, like.. triangle... wait some ms...then square... wait some more ms... then noise... etc.
Here's an example of drums sounds using that technique.

http://www.youtube.com/watch?v=9Vmoj8xzqkk

(Btw, another technique is heard in this tunes, called arpeggio. By changing between three notes many times per second, a choord could be played with a single channel)

Then SID musicians began sweeping the filter cutoff like "real" synthesizers and the result was even more interesting.

http://www.youtube.com/watch?v=dv0rXip1WNU

Have a listen to the bass, the filter is set to max resonance and the cutoff sweeps up and down. Just WOW, the SID was so far ahead of anything found in a computer back then.
It took almost a decade before musicians began using the SID chip as Bob Yannes intended. That's the reason why old SID tunes almost sounds as "bad" as they would on an Atari 800 or Amstrad CPC.

So to take a snapshot of the register settings from a single "frame" will not yield a correct result... SID music is ALL about updating register values many times per second.

Ahle2

06-13-2012, 09:52 PM

New SID tunes uses "all the tricks in the book" and the results is soooo insanely amazing that even Bob Yannes would be surprised that it comes out of his chip from 1981.

http://www.youtube.com/watch?v=yT2c-eE1CtU

Ahle2

06-14-2012, 06:59 PM

Some people have asked me to share all my dmp-files, so here they are!

There is "bilinski" tune in this archive... headerless, 400 Hz... 400 Hz!!!

Ahle2

06-15-2012, 09:33 AM

@pik33
Yes, there are a lot of headerless multispeed tunes in the archive. They were created with the first version of the "SID dumper" in 2009.
And there are also some duplicates and other junk like for example game FX. I just searched for ".dmp" on all my devices and zipped it to this archive!

onewheeltom

06-16-2012, 03:00 AM

The best inventions often get used in ways that the inventor never imagined.

--tom

New SID tunes uses "all the tricks in the book" and the results is soooo insanely amazing that even Bob Yannes would be surprised that it comes out of his chip from 1981.

Btw, I read a discussion on AtariAge about SID-emulation on Atari 8bit, that's very interesting. It has been done on the Vic20 and C16 before, with similar results.
I can't help but LOLing very hard when I read reply from xxx, I didn't know that fanboyism + wishful thinking + ignorance = tone deafness. The more you learn about PSGs from the 80s, the more the SID stands out.
Pokey is a very good chip for sound FX, maybe even the best from that era. But I'm more into music so it's not on my todo emulator list.

Next chip is probably the 2A03/2A07... well the sound part of it. ;)

pik33

06-17-2012, 09:18 AM

Pokey should be emulated. I was an Atari 8-bit owner with all this nostalgia... and there is a big collection of Pokey music called ASMA; several thousands of files.

This chip cannot be compared to SID, but look at the program called Atari Softsynth. I remember a day when my friend brought a floppy disk with it and said "Listen - now Atari can play better than c64"
It of course was not such "better" but it was a big "wow" effect in 1988..

Pokey was used simply as 4-bit DAC @ 11 kHz in this program.

To listen these music samples in better quality I made a Atari Softsynth compatible program on PC. It gets Atari Softsynth files as input and then plays it @44kHz/16 bit

What Pokey can do, you can hear here:

http://www.youtube.com/watch?v=Xm5vQm9-JQ4

(and this is PC interpretation of this tune... http://eksperymenty.webh.pl/images/opswiata1.mp3 )

http://www.youtube.com/watch?v=lTlKOxmGtSE

potatohead

06-17-2012, 09:22 AM

Indeed! It is thick there. Good and bad comes with that. The good is, those guys are pushing Atari 8 bit computers hard. Fun stuff going on. The bad is that same drive tends to induce heavy blinders.

I was intrigued by the SID emulation too.

POKEY... Yeah. I absolutely love the effects. Iconic. Agreed on music, and that's honestly one reason why I'm exploring chip tunes now. I've got some musical skill, but never explored it with the computer much, because my primary two were the Apple and Atari machines. If one wanted some precise beeps, no problem. Anything else was kind of crappy. My pitch perception is good, meaning POKEY music is generally bad. (sigh) By the time I got machines that could do music, I was off onto other things.

Your stuff is so much fun now. Thanks for it.

Regarding emulation, I can totally understand that and I don't blame you. Besides, the thing is complex. There are some timing cases and glitches not well understood yet. Even the best existing emulation isn't true to the device. Lots of work, little reward, IMHO.

Deffo goosebumps. Dang! I love the retro efforts that really resonate around the strengths of the devices.

Ahle2

06-17-2012, 09:59 AM

@pik33

What Pokey can do, you can hear here:
http://www.youtube.com/watch?v=Xm5vQm9-JQ4
Well, it really isn't the Pokey that does the synthesis, but the 6502. The Pokey is merely used as a DAC. I'm very impressed with the "high" sample rate. The 6502 must be glowing!
Too bad that technique is too cycle hungry to be used in games and demos while something else is going on.
Still extremely cool and good sounding!

Btw, It reminds me of the PSG in the PC engine, it uses wavetable synthesis as well, but in hardware. Have a listen.

http://www.youtube.com/watch?v=EZXBClhlqeM

@potatohead

...the thing is complex. There are some timing cases and glitches not well understood yet. Even the best existing emulation isn't true to the device. Lots of work, little reward... IMHO
I wouldn't say it's complex, at least not compared to the SID.. But as you say the glitches and strange behaviour makes it hard to emulate.

Ahle2

06-17-2012, 10:37 AM

http://www.youtube.com/watch?v=O73eOA-cPzY
I didn't know that it's legal to make obvious lies in American commercials! In Sweden they would have been suid!

Both have the same amount of memory: True
Both have typewriter styled keyboards: True
The XE has better graphics: 80% a lie according to my definition of good graphics
Better sound: LOL
More colors: True (not more colors on the screen at reasonable resolution and without DL tricks though)
And it's faster: True for number crunching and 3D graphics (not 2D graphics)

pik33

06-17-2012, 11:02 AM

I was an Atari user, not Commodore, but now, in 2012, all these machines, Atari 8-bit, ST, C64, Amiga, Spectrum, Amstrad... even early PC DOS box, all of these are nostalgic for me. So I want to have it all. I collected all emulators and software I could find. But all of these emulators... are simply not as good as I want, and they never will be.

For example there is no way of set 50 Hz monitor refresh frequency and all these "true color" Atari demos using timings "black magic", interlacing etc - looks awful. There are awful input and output delays. Joystick, keyboard, picture, sound, all of this is out of phase, because of PC/Windows architecture, which don't allow direct interface to hardware.

And now there is the Propeller

I can program it as I want it. I only have to know how to program, and I can have real inputs and real outputs in real time.

So one of my dream, as old Atari 8-bit user is to emulate it on the Propeller.

I am still a learner; writing these programs I am writing now, I still learn how to program a Propeller well, and what can I get from it. This is unusual chip, you have to feel it to program it well. I think I am now starting to feel a Propeller.

Ahle2

06-17-2012, 11:40 AM

@pik33
I know exactly what you mean when you say that emulators on Windows machines doesn't give you the same experience.
That's the reason why I own around 15 retro systems from Atari, Commodore, Nintendo, Sega.... etc
Sadly I don't own a PC engine yet. I have coded an unreleased PCe emulator for Windows, but ironically never used the real machine.

potatohead

06-17-2012, 08:05 PM

Totally. I/O latency is a big one. Frankly, it's one of the reasons I don't modern game too much. That and somebody put keyboard + mouse off the table for nearly all FPS games. (I think it's because the kiddies running dual analog would get spanked regularly by the old farts running keyboard mouse) That spoils a lot of it for me. Some devices are 100ms! (Yeah, here's looking at you Android) HDTV sets can have serious latency too, and then there are triple buffered games... I would totally trade some graphics eye candy for more dynamically drawn displays with low latency and frame locked visuals. That's just not the trend though. Maybe it will come full circle some day.

Re: The two... Well, that battle has been waged over and over. I really like the C64 higher color resolution and sound. Always have. The palette is smart too. I love seeing what great pixel artists can get done. And of course, color density is good on the C64.

Older Ataris had 4 game I/O ports, which I used to do some basic control projects back in the day. I favored Atari, Apple and CoCo due to better system engineering. Atari has sophisticated device independent I/O, and in 8K no less, Apple has expansion and some great engineering in it's ROM too. CoCo has the 6809, though somebody did stuff one into Atari machines, which can now run Nitros9. Amazing.

I don't really consider DL tricks as special. The machine was designed for that purpose. What I do consider tricks are display kernel type schemes with complex horizontal display changes.

One thing I noted was 4 colors / scan line isn't quite enough. The Apple managed 6, due to how it's high res artifact color worked. One can do anything with 6 colors. This was the big advantage of sprites on a lot of machines. They could be colored differently and stand out.

My enthusiasm stops at 8 bits though. The 16 bit machines never really caught on as I was off into manufacturing, DOS, UNIX, etc... during that time, running 8 bitters at home, then jumping right to a rather crappy PC, but one that could run CAD, which ended up launching a long and fruitful career. Still love CAD. It's just fun, and the programs today are so capable, it's insane! An exception would be APOGEE and early ID titles on DOS, but those emulate just fine, no need for old hardware. I'll leave the 16 bit era behind, always feeling like I missed out. Going back doesn't seem worth it, particularly...

...when there is the Propeller. Totally. It's a great little playground. Has the same kinds of limits retro machines do, which makes it a lot of fun. I envy you guys with workbench type setups. I think I might get one soon. That's why I've not done too much with VGA. I'm rarely where I can just jack into a monitor, and I really like TV anyway.

@Pik33: Nice Pokey work! I like your visualizations, and the sampled sounds work great.

@Ahle2: Yeah, that is the complex axis I was referring to. We agree.

pik33

06-18-2012, 05:47 AM

@Pik33: Nice Pokey work! I like your visualizations, and the sampled sounds work great.

I only found these visualisation on Youtube, this is not my production.
It is not my music, too, and I didn't wrote Atari Softsynth, too.

The program, Atari Softsynth, was written by German programmer. In Basic... (with some machine code to output sampled sound @ 11 kHz)
The music was written by Polish chiptune composer Jakub Husak. He wrote some beautiful pieces of music with Atari Softsynth

What I did, is PC softsynth program, which can get Atari Softsynth music files as input, and play them @44kHz/16 bit instead of 11kHz/4bit. I did it because I wanted to listen to these Atari Softsynth tunes without noise and aliasing. The program is available os SourceForge (GPL license, working alpha stage) You can edit these files or make your music from scratch with this program, too, This mp3 I linked to is an output from this PC program (to compare with 8-bit Atari version). And now I want to have it on Propeller. This needs some (a lot of...) work...

@pik33
Have you seen this C64 emulator?
It takes C64 emulation two steps closer to the real deal!
It is much closer to the real experience than anything else I have tried. It actually emulates the whole "signal path".... Luminance + Color difference signals -> Chrominance + Luminance + Sync -> CVBS -> RF -> and the whole procedure back again -> RGB

A lot of work to emulate real crt/pal thing.. but - can it deal with this awful 60 Hz problem? (when watching any demo with scroll, it jumps every 6 frames, and these interlaced multicolor pictures looks awful)

(downloaded it - will try later...)

I spent some hours to make my Windows XP output @ 50 Hz... and it seems to be impossible with Windows 7 without heavy hacking.

ToeToast

07-27-2012, 01:33 AM

Wow, this work is amazing. After a 6 year break from the microcontroller world I've started to catch up with developments on the Propeller. This SID chip emulation stood out for me as an astounding piece of engineering. Having been in my teens when playing C64 games the memories came flooding back when I downloaded the 42,000+ SID songs onto the PC and started to listen to my favourites !

In particular I love Commando, Rambo II, Parallax and the Ocean Loader. Such great pieces of chip music.

I've started some proof of concept work around physical implementations of SIDcog and I'll you all in on these are they reach maturity. Just about to order a Prop BOE so I can use the SD card to play the dump files. I'm really excited to hear the Propeller cranking out those tunes !

A couple of questions please:-

1) since PropBadic is my preferred language, how easy is it to launch/control SIDcog from there ? Especially since reading the SD card via the usual SPIN Object for SD card access.

2) how difficult is it to emulate the 6502 on the Propeller so that the SID files can be played instead of the DUMP files ? Those DUMP files are large but the SID files can easily fit on the EEPROM and therefore reduces component count in the real world.

Thanks
Tony

pik33

07-27-2012, 08:19 AM

We still haven't 6502. It should not be very difficult, but someone has to write it.

Sidcog is easy to launch and use. A few lines of spin can do it.

There is at least 3, (maybe more) ready players. I wrote one of them, http://forums.parallax.com/showthread.php?140767-A-new-topic-for-vga-%28not-only%29-sid-player - it needs a demoboard and vga and plays .wav files, too; another player: http://forums.parallax.com/showthread.php?140628-SIDPLAYER-for-VGA and if you want tv instead of vga, get a tv player here: http://forums.parallax.com/showthread.php?131393-Do-want-to-play-music-on-your-propeller-%28Propeller-chiptune-player%29

pik33

07-27-2012, 10:33 AM

Bug detected in SidCog (when compile with BST).

I tried to use my nco oversampling driver to output sound from sidcog using SidSample variable and.. there was always zero in it.... I had to change this:

mov tempValue, par
add tempValue, #28
wrlong r1, tempValue

to this:

mov tempValue, par
sub tempValue, #8
wrlong r1, tempValue

to get it working

The reason was BST relocating variables: long firsts, then bytes. I don't know if PropTool do this relocation too; when compiled with BST, SidCog's variables starts with sidsample, then cog, then sid registers. Par points to first sid register, SidSample variable is at 8 bytes lower address.

I'd like to play with SIGcog and am mostly interested in making sound effects like 'battle sounds'. I'm experienced with the Pokey and a little with the AY. Is there a good/standard old book on using the SID that might have good examples and insights?

Ahle2

04-05-2013, 05:57 PM

Pick one of the "sound books" from the link below.
(http://www.bombjack.org/commodore/books.htm#GRAPHICS_AND_SOUND)http://www.bombjack.org/commodore/books.htm#GRAPHICS_AND_SOUND

You may be surprised by how competent the SID chip is compared to both the Pokey and the AY38910.
It really was way ahead of anything found in any other computer in 1982.

Here's some inspiration from 2013

http://www.youtube.com/watch?v=eoHTtKmUWBY

/Johannes

Invent-O-Doc

04-05-2013, 06:43 PM

Thanks - those books were just what I was looking for (I just already ordered the compute! book on amazon - oh well. This should be enough to get me context. I'm mostly doing sound effects which pokey was good for. I know the SID has that cool envelope stuff and different types of waves. Very advanced for the time.

Oldbitcollector (Jeff)

10-27-2014, 05:15 AM

@Ahle2

Question: In your "ExamplePlayRoutine", you've got a nice number to frequency converter for converting bytes to notes.
Do these notes (numbers) correspond to a standard note scale? I'm using this little chunk of code in a project using SIDcog and would like to convert some other music to it.

@OBC
I can not remember... I will have to take a look at it again after all these years!

@potatohead
Yes, a real SID player for the Propeller is just a little glue away... (and 64k of external memory, because many SID tunes uses absolute addressing and are not relocatable... or implement a "MMU" to handle it)

6581

10-28-2014, 12:54 AM

@Ahle2: I am actually working a bit on some system based on the P1V + 6502 Soft Core on FPGA, so maybe this could be used.
By the way: How is it going with the Retronitus?

Ahle2

10-28-2014, 10:15 AM

@6581
That is great.. keep up the good work then!

Retronitus has awaken from its sleep, I am working on a LameStation game that will use it. Retronitus may actually end up as part of the standard library for this cool console.
And I am about to finish the tools for Retronitus as we speak, then it will be possible to easily make music and sfx for it.

/Johannes

Baggers

10-28-2014, 11:11 AM

That's great news Johannes :D

pik33

10-28-2014, 12:24 PM

We have mul instruction and some additional MHz in p1v - the sidcog may be rewritten to get 64 kHz instead of 32... I have now a working retromachine for p1v - it is now ready to add sidcog to it. Or Retronitus. Or something which makes sound.

Oldbitcollector (Jeff)

10-28-2014, 03:51 PM

That is good news! I'm pleased that work continues on Retronitus, If SIDcog is any indication, it'll be awesome. :)

Oldbitcollector (Jeff)

11-03-2014, 12:49 AM

@ Ahle2

I was able to determine that your note2freq routine appears to be using a midi note scale. (Or at least it sounds that way here) 60 sounds about like middle C (C4)

Do you recall what you used to create the music byte DATA itself? I'm getting ready to start working on a midi-2-note perl converter, but would rather not recreate the wheel.

Ahle2

11-03-2014, 07:59 AM

"Do you recall what you used to create the music byte DATA itself?"
Propeller Tool + patience!

"I was able to determine that your note2freq routine appears to be using a midi note scale"
That is what I recall as well, but I was not sure!

I am developing "Midi to .rmu" support in the Retrontius editor. The hard part is not to convert notes, the hard part is to quantize, multiplex and prioritize notes... :)

I tested these filters because (1) I am patching sidcog for my de2-115 retromachine (2) I need a filters for the other purpose.

Low pass and high pass filter made with this algorithm are 12 dB/octave, and not 6!
The band pass filter is 6 dB/octave.

This is exactly what the SID has, so there is no need to add second filter bank.

If the SID's filter is as in the Commodore 64 instructions - 30 Hz+5.8*amount - then @ 44100 Hz the amount should be divided by 1223 and then be no more than 1200 - the filter characteristic is non linear.

But as I saw some SID filter characteristics, they are nonlinear, too :) and no two sids are the same.

At 44100Hz sampling, the band pass frq is 355 Hz for 0.05, 720 Hz for 0.1, 1485 for 0.2, 3220 for 0.4, 5430 for 0.6, 9010 for 0.8 and 13050 Hz for 0.9 (then 22050 Hz for 1.0)

Ahle2

11-10-2014, 07:14 PM

The filter implementation was made in 2009, and I don't remember all the details (because I haven't done any changes to the code since then, just parameter changes). What I do remember is that A LOT of short cuts had to be made because the Propeller lacks a multiplication instruction. I was extremely satisfied that I was able to squeeeze the filter in at all. (without sacrificing too many cycles) Shifts are used instead of multiplications in some cases and there are other short cuts as well. (5 years are too long ago to remember all the short cuts) The pseudo code was what I was aiming for.

I own 5 C64's and I can confirm that the filter differs A LOT and not one of them is even close to the official documentation. Just forget about using the documentation as a reference... ;) My breadbin C64's and C128's with 6581 in them are WAAAAAAY of the chart and has all that wonderful distortion that real purist loves; Even the amount of distortion differs between them. Rob Hubbard, Martin Galway and other musicians refused to use the filter in early titles because they couldn't make their tunes sound good on all C64's. This changed in 1986 when the C64c with 8580 SID became more common. The 8580 is much closer to the official documentation and (sadly?!) doesn't have any distortion.

SIDcog was calibrated by ear using my 8580 equipped C64's as references. Of course, the cutoff linearity and the cutoff slope couldn't be made perfect thanks to all short cuts listed above, but the most important thing is that the offset is as close as possible to the real SID. Otherwise all modern tunes that uses a sweeping resonant lowpass filter in combination with a sweeping triangle wave to emulate kicks would sound AWFUL!! Have a listen to "Harden your horns" for the perfect example of this.

I have DC patched one of my 8580 equipped C64's to be able to play 4 bits samples using the main volume "trick". This should theoretically work with SIDcog as well, if the DC offset value is set to something other than 0x8000000. Someday I will connect SIDcog to a real C64... then I will be able to test if this works.

/Johannes

pik33

11-10-2014, 07:59 PM

I was surprised with these 12db/oct characteristics - "they" say everywhere Sidcog has 6 dB/oct filter... then this is simply not true. It has the same filters as real thing.

I don't have a C64 :( so I haven't any possibility to tune my implementation of filters. There is possibility to check the original filters: program the sid to make a (as close as possible) white noise; then pass it by the filter with several settings, then make a spectral analysis of the output.

Oldbitcollector (Jeff)

11-16-2014, 05:11 PM

@6581
Retronitus has awaken from its sleep, I am working on a LameStation game that will use it. Retronitus may actually end up as part of the standard library for this cool console.
And I am about to finish the tools for Retronitus as we speak, then it will be possible to easily make music and sfx for it.

/Johannes

I was wondering if we could get an update on this? I'd love to implement a version of this in the Micromite Companion project.
The youtube videos of this are simply amazing.

potatohead

11-22-2014, 06:44 PM

YES!!!

I really want to compose on Retronitus. Just make some chip music. No pressure of course. Anything is done when it's done, but I sure like reading things are moving along in some fashion!

Of course, I will test anything. :)

Gadgetoid

11-24-2014, 07:35 PM

This has to be the most beautiful thing I've ever played with on a Microcontroller, the sheer, grungy, ear-bleeding sound you can coax out of this thing by abusing it with analogue control values is staggering.

I put together a quick and dirty logic level shifter to translate the control voltage and gate values of the Sparkfun Sparkpunk Sequencer, hooked the two together, and hacked up the Play Routine example to poll the ADC on my ASC+ and pass the values, with a little scaling, straight into the noteOn and setCutoff methods of SIDcog.

The result is interesting, to say the least: https://vine.co/v/O1viO6KIiP2

I plan to assemble a slightly less hacky version of my setup and add a handful of pots to let me tweak some other values on the fly. Who needs trackers when you can twist and distort the SID sound live!

Ahle2

11-24-2014, 09:49 PM

@OBC and potatohead
Patience is a virtue! ;) I will make an update as soon as I have anything interesting to show... Of that you can be sure!

@Gadgetoid
Welcome to the forum!
Cool project... It would be nice to see a YouTube clip of that "thing" in action.

/Johannes

Gadgetoid

11-25-2014, 01:36 PM

It would be nice to see a YouTube clip of that "thing" in action.

Your wish is my command!

We got some 3.5mm jack sockets in today, so I tidied up my still-breadboarded SparkPunk adapter, tweaked the code to separate drums/melody onto different portions of the sliders, and had a 5-minute jam session and tour. It's now uploading!

And here we go:

http://www.youtube.com/watch?v=3736LKHNexg

potatohead

11-25-2014, 10:52 PM

That is all kinds of cool fun! Thanks for sharing it.

@Ahle: Indeed. Looking forward to fun times. :)

pik33

11-26-2014, 08:04 AM

This reminds me the bitbuf:

http://linusakesson.net/bitbuf/index.php

Maybe making something like this using the propeller instead of atmega can give interesting results...

Gadgetoid

11-26-2014, 10:21 AM

@pik33 that's a pretty nifty setup, I like the concept. I don't know why I didn't think of something like this in the first place.

I've decoupled my ADC sampling from the main logic using another COG, if I slow this down to a reasonable frequency then I can store a sequence of 8 notes, including the intermediate values that give the sound such a unique timbre, and run these back through SIDcog while I feed in the melody.

The sequencer has signals for Run/Stop and Clock, which I could level shift and use to keep everything in sync.