PDA

View Full Version : SIDcog - The sound of the Commodore 64 ! (Now in the OBEX)



Ahle2
12-11-2009, 08:27 PM
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)

SIDcog lacks:
- Possibillity to smoothly schange the filter resonance amount value (partly implemented thanks to Ariba)

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-11-2009, 11:44 PM
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-11-2009, 11:52 PM
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, 12: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, 03: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, 04: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, 05: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, 08: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, 04:23 PM
Nice to see you have the waveform reset bit working :)

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

·

Leon
12-14-2009, 08:56 PM
Coincidentally, there is something similar for the XMOS chip:

www.xcore.com/projects/xc-1-sid-emulator-demo (http://www.xcore.com/projects/xc-1-sid-emulator-demo)

Leon

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

Coley
12-14-2009, 09:29 PM
Leon,

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, 09:43 PM
I thought that comparing the two techniques might be of interest.

Leon

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

Ahle2
12-15-2009, 12: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, 01:11 AM
Yes. He used the SID Codec for Rockbox based on the TinySID engine.

Leon

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

Ahle2
12-15-2009, 02: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, 03:01 AM
I might try them both and see if if they sound different.

Leon

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

Ahle2
12-16-2009, 10:15 PM
Here is a little cool demonstration of psuedo stereo sid playing using two SIDcogs at once.

Oldbitcollector (Jeff)
12-16-2009, 10: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)

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Ahle2
12-17-2009, 05:52 AM
Very interesting OBC.

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, 06: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, 06: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, 07: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, 10: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, 08: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).

It's quite easy to "calculate" it through a lookup table.





attackTable word 2,8,16,24,38,56,68,80,100,250,500,800,1000,3000,50 00,8000
decayReleaseTable word 6,24,48,72,114,168,204,240,300,750,1500,2400,3000, 9000,15000,24000




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, 12:09 AM
Ahle2, very nice, Thank you for sharing your work with us I will use it a lot

JonnyMac
12-29-2009, 06:28 AM
@Ahle2: That was the path I started down. Thanks for the confirmation.

Ahle2
12-29-2009, 04: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

/ Johannes Ahlebrand.

Nick McClick
12-29-2009, 05:09 PM
What are some songs that use combined waveforms?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed! (http://www.nicholasm.com/proprss/)

Gadget Gangster - Share your Electronic Projects (http://www.gadgetgangster.com)

Ahle2
12-29-2009, 06:24 PM
@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, 11:07 AM
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.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed! (http://www.nicholasm.com/proprss/)

Gadget Gangster - Share your Electronic Projects (http://www.gadgetgangster.com)

Oldbitcollector (Jeff)
12-30-2009, 11:17 AM
Any chance that steel drums could be done with SIDcog?

Drum sounds weren't exactly the real SID's strong point,
but I have a midi project in the works that could use drum sounds.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Ahle2
12-30-2009, 10:50 PM
@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, 05: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.

Post Edited (Ahle2) : 1/13/2010 12:42:56 AM GMT

Oldbitcollector (Jeff)
01-13-2010, 05:55 AM
Missing file from SidDumper: qtgui4.dll

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

VIRAND
01-13-2010, 06:11 AM
Oldbitcollector said...
Missing file from SidDumper: qtgui4.dll

OBC

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, 06: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, 04: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, 09: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.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBlade (http://forums.parallax.com/showthread.php?p=786418),·RamBlade (http://forums.parallax.com/showthread.php?p=849265),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) (http://forums.parallax.com/showthread.php?p=778427) ZiCog (Z80) (http://forums.parallax.com/showthread.php?p=788511) , MoCog (6809) (http://forums.parallax.com/showthread.php?p=811043)
· Search the Propeller forums (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBladeProp is: www.bluemagic.biz/cluso.htm (http://www.bluemagic.biz/cluso.htm)

Michael OBannon
01-25-2010, 01:30 AM
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

laserjones
01-25-2010, 04: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, 02: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 )


laserjones said...
I can't imagine a SID doing a steel drum realistically

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, 03: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.

Thanks again,
Joerg

Ahle2
01-30-2010, 10:29 PM
The pseudo code for the multi mode 6db/octave filter looks like this!


Each sample:
filter_H = input_sample - filter_B * filter_resonance - filter_L
filter_B += filter_freq * filter_H
filter_L += filter_freq * filter_B




filter_H = Highpass filtered sample
filter_B = Bandpass filtered sample
filter_L = Lowpass filtered sample
filter_freq = Cutoff frequency ( a value between 0 - 1, max freq = sample_rate/2 )
filter_resonance = Resonance amount ( a value between 0 - 1 )
input_sample = The incoming sample

If you for an instance want a bandpass filtered sample use: output_sample = filter_B
If you for an instance want a bandpass reject filter use: output_sample = filter_L + filter_H

The logarithmic envelope decay function works like this


Each frame:
amplitude_level-= decay_rate
if amplitude_level < reference_level
decay_rate /= 2
reference_level /= 2


Post Edited (Ahle2) : 1/30/2010 3:39:36 PM GMT

Forrest
01-31-2010, 01:55 AM
Ahle2, Oldbitcollector, Nick,

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

Chris Micro
01-31-2010, 02: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)

laserjones
01-31-2010, 05:52 AM
Ahle2 said...
The pseudo code for the multi mode 6db/octave filter looks like this!

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.

Post Edited (laserjones) : 1/30/2010 10:57:53 PM GMT

Ahle2
01-31-2010, 04:43 PM
@laserjones
Yes, it's that simple :)

@Chris Micro
Wow, that's a really cool looking project I must admit.
http://www.roboterclub-freiburg.de/atmega_sound/chMinimalSid.jpg

@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, 06: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?




PUB setCutoff(freq)
byte[@Filter1] := freq&$07
byte[@Filter2] := (freq&$07F8)>>3



Regards,
T o n y

Ahle2
02-04-2010, 10:31 PM
A new version of SIDcog is available. Have a look at the top.

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, 08: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, 03: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, 10: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).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBlade (http://forums.parallax.com/showthread.php?p=786418),·RamBlade (http://forums.parallax.com/showthread.php?p=849265),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) (http://forums.parallax.com/showthread.php?p=778427) ZiCog (Z80) (http://forums.parallax.com/showthread.php?p=788511) , MoCog (6809) (http://forums.parallax.com/showthread.php?p=811043)·
· Prop OS: SphinxOS (http://forums.parallax.com/showthread.php?p=819353)·, PropDos (http://www.orrtech.us/propdos/) , PropCmd (http://obex.parallax.com/objects/440/)··· Search the Propeller forums (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBlade Props: www.cluso.bluemagic.biz (http://www.cluso.bluemagic.biz)

Chris Micro
02-20-2010, 04:38 PM
>> 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, 05: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, 07: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, 09: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, 08: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, 08: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.

So yes, doable...

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Cluso99
03-01-2010, 11:52 AM
Ahle2: Did you enter SidCog in the Prop contest? Hope you did.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBlade (http://forums.parallax.com/showthread.php?p=786418),·RamBlade (http://forums.parallax.com/showthread.php?p=849265),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) (http://forums.parallax.com/showthread.php?p=778427) ZiCog (Z80) (http://forums.parallax.com/showthread.php?p=788511) , MoCog (6809) (http://forums.parallax.com/showthread.php?p=811043)·
· Prop OS: SphinxOS (http://forums.parallax.com/showthread.php?p=819353)·, PropDos (http://www.orrtech.us/propdos/) , PropCmd (http://obex.parallax.com/objects/440/)··· Search the Propeller forums (http://www.google.com/advanced_search?q=+site:forums.parallax.com&num=20&hl=en&lr=)·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBlade Props: www.cluso.bluemagic.biz (http://www.cluso.bluemagic.biz)

Ahle2
03-02-2010, 05:44 AM
Here is a serial driven SID player for everyone that havn't got a SD-card connected.
www.mongofiles.com/file/18079/SIDcog_SerialPlayer.7z (http://www.mongofiles.com/file/18079/SIDcog_SerialPlayer.7z)

Everyone with a propeller connected to a speaker and a PC running Windows should be able to run this. http://forums.parallax.com/images/smilies/smilewinkgrin.gif

Propeller:
Run SIDcog_SerialSlave on the propeller.
(If necessary, change RX pin, TX pin and sound pins )

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, 07: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?

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Cluso99
03-02-2010, 09:21 AM
Nice work Ahle2. Shame you didn't enter it :(

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBlade (http://forums.parallax.com/showthread.php?p=786418),·RamBlade (http://forums.parallax.com/showthread.php?p=849265),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) (http://forums.parallax.com/showthread.php?p=778427) ZiCog (Z80) (http://forums.parallax.com/showthread.php?p=788511) , MoCog (6809) (http://forums.parallax.com/showthread.php?p=811043)·
· Prop OS: SphinxOS (http://forums.parallax.com/showthread.php?p=819353)·, PropDos (http://www.orrtech.us/propdos/) , PropCmd (http://obex.parallax.com/objects/440/)··· Search the Propeller forums (http://www.google.com/advanced_search?q=+site:forums.parallax.com&num=20&hl=en&lr=)·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBlade Props: www.cluso.bluemagic.biz (http://www.cluso.bluemagic.biz)

Ahle2
03-02-2010, 05:11 PM
@OBC
I think we could have 6 SIDcogs running at once. 6*3=18 sound channels.
One cog for mixing them togheter and one for communciation.

@Cluso99
Did you finally managed to test SIDcog out with my serial player?

Btw, I found this on YouTube www.youtube.com/watch?v=1RR_qbREDQs (http://www.youtube.com/watch?v=1RR_qbREDQs)

Baggers
03-02-2010, 05:35 PM
excellent app Ahle2, nice addition to SIDcog, I can now play stuff on my demoboard :D thanks!

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

·

mikediv
03-02-2010, 09:24 PM
Ahle2,, pure genius my friend ,, Again thank you for sharing your code I love it...

Cluso99
03-03-2010, 02:18 PM
Ahle2: No not yet I am afraid. But I did listen to the youtube sounds - thankyou for posting. They sound great http://forums.parallax.com/images/smilies/smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBlade (http://forums.parallax.com/showthread.php?p=786418),·RamBlade (http://forums.parallax.com/showthread.php?p=849265),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) (http://forums.parallax.com/showthread.php?p=778427) ZiCog (Z80) (http://forums.parallax.com/showthread.php?p=788511) , MoCog (6809) (http://forums.parallax.com/showthread.php?p=811043)·
· Prop OS: SphinxOS (http://forums.parallax.com/showthread.php?p=819353)·, PropDos (http://www.orrtech.us/propdos/) , PropCmd (http://obex.parallax.com/objects/440/)··· Search the Propeller forums (http://www.google.com/advanced_search?q=+site:forums.parallax.com&num=20&hl=en&lr=)·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBlade Props: www.cluso.bluemagic.biz (http://www.cluso.bluemagic.biz)

Ahle2
03-24-2010, 04:01 AM
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, 04: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

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Are you Propeller Powered? PropellerPowered.com (http://www.propellerpowered.com)
Visit the: PROPELLERPOWERED SIG forum (http://www.savagecircuits.com/forums/forumdisplay.php?29-Propeller-Powered) kindly hosted by Savage Circuits (http://www.savagecircuits.com).

Ahle2
03-24-2010, 05:23 PM
@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, 11:29 AM
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-30-2010, 11:20 PM
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, 11:16 AM
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, 12: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).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed! (http://www.nicholasm.com/proprss/)

Gadget Gangster - Share your Electronic Projects (http://www.gadgetgangster.com)

tenfold
04-02-2010, 07:14 AM
Nick McClick said...

The SIDstick hardware supports stereo output, although the current firmware puts the same audio out on both channels.


That's good to know. I can add separate outs for each, and possibly run one through effects or add a switcher for them...hmmm.


Nick McClick said...
The regulator tops out at 6V input.


Excuse my n00bishness, but I could just get a regulator that tops out at 9v then right?

Nick McClick
04-02-2010, 10:55 AM
Sure, you'll probably not want to use a linear regulator though - it will waste a lot of energy converting the 9v to 3v.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed! (http://www.nicholasm.com/proprss/)

Gadget Gangster - Share your Electronic Projects (http://www.gadgetgangster.com)

Ahle2
05-23-2010, 09:05 AM
I've found this awesome one hour mix of many great C64 tunes recorded from a real C64 equipt with a 6581 SID chip (the old version of the chip).
g00nzor.free.fr/ (http://g00nzor.free.fr/)

danielx
05-28-2010, 04:29 AM
Ahle2 said...
The pseudo code for the multi mode 6db/octave filter looks like this!


Each sample:
filter_H = input_sample - filter_B * filter_resonance - filter_L
filter_B += filter_freq * filter_H
filter_L += filter_freq * filter_B




filter_H = Highpass filtered sample
filter_B = Bandpass filtered sample
filter_L = Lowpass filtered sample
filter_freq = Cutoff frequency ( a value between 0 - 1, max freq = sample_rate/2 )
filter_resonance = Resonance amount ( a value between 0 - 1 )
input_sample = The incoming sample

If you for an instance want a bandpass filtered sample use: output_sample = filter_B
If you for an instance want a bandpass reject filter use: output_sample = filter_L + filter_H

The logarithmic envelope decay function works like this


Each frame:
amplitude_level-= decay_rate
if amplitude_level < reference_level
decay_rate /= 2
reference_level /= 2





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, 08: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.

'' main program continues while music plays....


PUB Songplayer

repeat
waitcnt(cnt+(clkfreq/playRate)) ' Wait one VBL
if( sd.pread(@buffer,25)) < 0 ' Read 25 bytes from SD card
SID.updateRegisters(@buffer) ' Write 25 byte to SIDcogs 25 registers




Perhaps it will be helpful to someone else.. :)

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Feature Projects: PropellerPowered.com (http://www.propellerpowered.com)
Visit the: PROPELLERPOWERED SIG forum (http://www.savagecircuits.com/forums/forumdisplay.php?29-Propeller-Powered) kindly hosted by Savage Circuits (http://www.savagecircuits.com).

kuroneko
06-01-2010, 08:32 PM
Shouldn't that read



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


???

BradC
06-01-2010, 08: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, 08: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, 06: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.

/Ahle2

Ahle2
06-03-2010, 11:25 PM
danielx said...
I just tried your multimode filter, and it's really great!

Thanks!

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, 01: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, 01: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, 12:32 PM
This is great! Seal of approval granted. =)

Ahle2
07-27-2010, 03: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.

Btw, I LOVE your Chipophone (http://www.youtube.com/watch?v=m1pchpDD5EU). :)

6581
10-25-2010, 12:59 PM
Thanks Ahle2 for your great contribution!

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, 01: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, 01:25 AM
6581: Your project sounds great. Congraulations.

jazzed
10-26-2010, 05:06 AM
I'm enjoying these demos. Thanks.

Ahle2
10-27-2010, 05: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, 05: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, 11:03 AM
@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, 07: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, 01: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, 05:08 PM
SIDcog version 1.0 is in the OBEX. :)

Oldbitcollector (Jeff)
04-20-2011, 05: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, 02:22 PM
I have been pondering that for a while.
Does it need to be torough??
What should be included?

JonnyMac
04-21-2011, 03: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.

Oldbitcollector (Jeff)
04-21-2011, 04:19 PM
Speak for (http://propellerpowered.com/?s=synth&searchsubmit=) yourself (http://propellerpowered.com/?s=sidplayer&searchsubmit=) there JonnyMac! <SMIRK> :)

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

David Betz
04-21-2011, 04:21 PM
Speak for (http://propellerpowered.com/?s=synth&searchsubmit=) yourself (http://propellerpowered.com/?s=sidplayer&searchsubmit=) there JonnyMac! <SMIRK> :)

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, 08: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, 10: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, 01: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.....

http://en.wikipedia.org/wiki/MOS_Technology_SID

http://www.atarimagazines.com/compute/issue70/101_1_Experimenting_With_SID_Sound.php

http://www.atarimagazines.com/compute/issue57/advanced_sound_effects.html

http://www.youtube.com/watch?v=hEk-eKxgRyU

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, 01: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, 02: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, 03: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, 03: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, 06:53 PM
Here are some of the books I used for reference for the Synth project.

Compute's Beginners Guide to the C64 Sound
http://www.bombjack.org/commodore/books/pdf/Compute's_Beginners_Guide_to_C64_Sound.zip

Commodore 64 Sound and Graphics
http://www.bombjack.org/commodore/books/pdf/Compute's_First_Book_of_64_Sound_and_Graphics.zip

Heck, I shouldn't post it, but the whole resource is excellent:
http://www.bombjack.org/commodore/books.htm

OBC

Ahle2
04-25-2011, 07:29 PM
Wow, you knew about this site and didn't say anything until now?
Shame on you OBC!!!! :depressed: :surprise: :confused: O_o -_-

;)

Ahle2
07-12-2011, 09:38 PM
I have uploaded a new video of SIDcog. (This was done mostly to test my new compact camera with 1080p video capture)
Tomorrow I will upload a clip of Retronitus as well. :)


http://www.youtube.com/watch?v=bawJFT3hSLw&feature=channel_video_title

megaionstorm
07-23-2011, 11:32 AM
Nice, this sidcog !

Who can i find a schematic for the sidcog circuit ?

Cluso99
07-23-2011, 12:00 PM
megaionstorm: Welcome the the prop forum.

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, 12: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, 01:19 PM
I am not sure. It is probably documented in the source file.

AntoineDoinel
07-23-2011, 08: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, 08: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)

http://www.youtube.com/watch?v=DuHaqBOsoZk&feature=player_detailpage#t=481s


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

Ahle2
08-23-2011, 06: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, 12:37 AM
Thanks Johannes :)

Oldbitcollector (Jeff)
08-24-2011, 03: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, 04:51 PM
How is it possible to create the dmp-files?

AntoineDoinel
08-27-2011, 05: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, 12:28 AM
serial sid player download link is dead. your work is awesome btw..

kuroneko
04-05-2012, 01: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, 09: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, 01: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.



pfw.clearscreen(0)
pfw.setChar(0, 0, 0, 0, $0, $FFFF)
pfw.size(1)
pfw.str(string("Starting Sid Midi"))

Midi.Start(26,MidiInMode)

SID.start(rightPin, leftPin) 'Start the emulated SID chip in one cog
SID.resetRegisters 'Reset all SID registers
SID.setVolume(15) 'Set volume to max
wait.pause1s(1)

SID.setWaveform(0, SID#SQUARE) 'Set waveform type on channel1 to square wave
SID.setPulseWidth(0, 1928) 'Set the pulse width on channel1 to 47:53
SID.setADSR(0, 2, 5, 9, 6) 'Set Envelope on channel1
SID.setWaveform(1, SID#NOISE) 'Set waveform type on channel2 to noise (drum sound)
SID.setADSR(1, 0, 8, 4, 7) 'Set Envelope on channel2
SID.setWaveform(2, SID#SAW) 'Set waveform type on channel3 to saw wave
SID.setADSR(2, 7, 4, 8, 9) 'Set Envelope on channel3
'Lp Bp Hp
SID.setFilterType(true, false, false) 'Enable lowpass filter

'Ch1 Ch2 Ch3
SID.setFilterMask(true, false, false) 'Enable filter on the "bass channel" (channel1)

SID.setResonance(0) 'Set the resonance value to max

repeat b from 0 to 2
SID.noteOff(b)

b := cognew(SidMidi, @stack)

pfw.setChar(120, 80, 0, 0, $0, $FFFF)
pfw.str(string("Push to stop"))

tswait
cogstop(b)
Midi.Stop
Sid.Stop




PUB SidMidi | Sco,Mco, channel, note, velocity, event

REPEAT
event := Midi.evt
note := event
channel := note
'Velocity := note

event := (event & $FF00_0000) >> 24
channel := (channel & $00FF_0000) >> 16
note := (note & $0000_FF00) >> 8
' Velocity &= $0000_00FF

if event == 0 ' Note on if note > 0
SID.noteOn(channel, note2freq(note))
elseif event == 1
SID.noteOff(channel) ' Note off if note = 0


*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, 09: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-05-2012, 11:15 PM
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, 08: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)

/Johannes

average joe
04-06-2012, 08:34 AM
Here's the basic method.


PUB SidMidi | sco, channel, note, velocity, event, NotesPlayed[3]
Midi.Start(26,MidiInMode)

SID.start(rightPin, leftPin) 'Start the emulated SID chip in one cog

SID.resetRegisters 'Reset all SID registers

SID.setVolume(15) 'Set volume to max
'wait.pause1s(1)


SID.setWaveform(0, SID#SQUARE) 'Set waveform type on channel1 to square wave

SID.setPulseWidth(0, 1928) 'Set the pulse width on channel1 to 47:53
SID.setADSR(0, 2, 9, 5, 4) 'Set Envelope on channel1

SID.setWaveform(1, SID#NOISE) 'Set waveform type on channel2 to noise (drum sound)
SID.setADSR(1, 0, 8, 4, 7) 'Set Envelope on channel2
SID.setWaveform(2, SID#SAW) 'Set waveform type on channel3 to saw wave
SID.setADSR(2, 7, 4, 8, 9) 'Set Envelope on channel3
'Lp Bp Hp
'SID.setFilterType(true, false, false) 'Enable lowpass filter

'Ch1 Ch2 Ch3
'SID.setFilterMask(true, false, false) 'Enable filter on the "bass channel" (channel1)

'SID.setResonance(15) 'Set the resonance value to max
'xSID.setCutoff(548)
'deadend
repeat sco from 0 to 2
SID.noteOff(sco)


REPEAT
event := Midi.evt
note := event
channel := note
'Velocity := note

event := (event & $FF00_0000) >> 24
channel := (channel & $00FF_0000) >> 16
note := (note & $0000_FF00) >> 8
' Velocity &= $0000_00FF

if event == 1
if notesPlayed[channel] < 2
SID.noteOff(channel)
notesPlayed[channel]--

elseif event == 0 ' Note on if note > 0
SID.noteOn(channel, note2freq(note))
notesPlayed[channel]++

It is started when a press on the touchscreen is detected in the right hitbox like so.


elseif tmpx > 550
if tmpy > 2800

pfw.clearscreen(0)
pfw.setChar(0, 0, 0, 0, $0, $FFFF)
pfw.size(1)
pfw.str(string("Starting Sid Midi"))


b := cognew(SidMidi, @stack)

pfw.setChar(120, 80, 0, 0, $0, $FFFF)
pfw.str(string("Push to stop"))

tswait
cogstop(b)
Midi.Stop
Sid.Stop

I'm recording examples now.
*edit*
The first example is with code above, then with code below.


PUB SidMidi | sco, channel, note, velocity, event, NotesPlayed[3]
Midi.Start(26,MidiInMode)

SID.start(rightPin, leftPin) 'Start the emulated SID chip in one cog

SID.resetRegisters 'Reset all SID registers

SID.setVolume(15) 'Set volume to max
'wait.pause1s(1)


SID.setWaveform(0, SID#SQUARE) 'Set waveform type on channel1 to square wave

SID.setPulseWidth(0, 1928) 'Set the pulse width on channel1 to 47:53
SID.setADSR(0, 2, 9, 5, 4) 'Set Envelope on channel1

SID.setWaveform(1, SID#NOISE) 'Set waveform type on channel2 to noise (drum sound)
SID.setADSR(1, 0, 8, 4, 7) 'Set Envelope on channel2
SID.setWaveform(2, SID#SAW) 'Set waveform type on channel3 to saw wave
SID.setADSR(2, 7, 4, 8, 9) 'Set Envelope on channel3
'Lp Bp Hp
SID.setFilterType(true, false, false) 'Enable lowpass filter

'Ch1 Ch2 Ch3
SID.setFilterMask(true, false, false) 'Enable filter on the "bass channel" (channel1)

SID.setResonance(7) 'Set the resonance value to max
SID.setCutoff(548)
'deadend
repeat sco from 0 to 2
SID.noteOff(sco)


REPEAT
event := Midi.evt
note := event
channel := note
'Velocity := note

event := (event & $FF00_0000) >> 24
channel := (channel & $00FF_0000) >> 16
note := (note & $0000_FF00) >> 8
' Velocity &= $0000_00FF

if event == 1
if notesPlayed[channel] < 2
SID.noteOff(channel)
notesPlayed[channel]--

elseif event == 0 ' Note on if note > 0
SID.noteOn(channel, note2freq(note))
notesPlayed[channel]++

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, 09:48 AM
Are you using the latest version of SIDcog from the OBEX?

average joe
04-06-2012, 09: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, 04: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


CON
_clkmode = xtal1 + pll16x ' use crystal x 16
_xinfreq = 5_000_000 'with 5mhz crystal

doNoteOn = $00000001
doNoteOff = $00000002
doAftertouch = $00000004
doController = $00000008
doProgramChange = $00000010
doChannelPressure = $00000020
doPitchWheel = $00000040
doSysex = $00000100
doMTC = $00000200
doSongPosPtr = $00000400
doSongSelect = $00000800
doTuneRequest = $00001000
doMidiClock = $00002000
doMidiTick = $00004000
doMidiStart = $00008000
doMidiContinue = $00010000
doMidiStop = $00020000
doActiveSense = $00040000
doReset = $00080000


MidiInMode = doNoteOn+doNoteOff

LeftPin = 24 '<-- Audio Out pins
RightPin = 27

OBJ
midi: "MidiIn"
sid : "SidCog"
PUB BOOT | 'bootstrap, initalizes pins, then starts pst, init display, start asm, clear screen and display hello world

SidMidi




PUB SidMidi | sco, channel, note, velocity, event, NotesPlayed[3]
Midi.Start(26,MidiInMode)

SID.start(rightPin, leftPin) 'Start the emulated SID chip in one cog

SID.resetRegisters 'Reset all SID registers

SID.setVolume(15) 'Set volume to max
'wait.pause1s(1)


SID.setWaveform(0, SID#SQUARE) 'Set waveform type on channel1 to square wave

SID.setPulseWidth(0, 1928) 'Set the pulse width on channel1 to 47:53
SID.setADSR(0, 2, 9, 5, 4) 'Set Envelope on channel1

SID.setWaveform(1, SID#NOISE) 'Set waveform type on channel2 to noise (drum sound)
SID.setADSR(1, 0, 8, 4, 7) 'Set Envelope on channel2
SID.setWaveform(2, SID#SAW) 'Set waveform type on channel3 to saw wave
SID.setADSR(2, 7, 4, 8, 9) 'Set Envelope on channel3
'Lp Bp Hp
SID.setFilterType(true, false, false) 'Enable lowpass filter

'Ch1 Ch2 Ch3
SID.setFilterMask(true, false, false) 'Enable filter on the "bass channel" (channel1)

SID.setResonance(15) 'Set the resonance value to max

SID.setCutoff(287)
'deadend
repeat sco from 0 to 2
SID.noteOff(sco)


REPEAT
event := Midi.evt
note := event
channel := note
'Velocity := note

event := (event & $FF00_0000) >> 24
channel := (channel & $00FF_0000) >> 16
note := (note & $0000_FF00) >> 8
' Velocity &= $0000_00FF

if event == 1
'if notesPlayed[channel] < 2
SID.noteOff(channel)
'notesPlayed[channel]--

elseif event == 0 ' Note on if note > 0
SID.noteOn(channel, note2freq(note))
' notesPlayed[channel]++

PUB note2freq(note) | octave
octave := note/12
note -= octave*12
return (noteTable[note]>>(8-octave))



DAT
noteTable word 16350, 17320, 18350, 19450, 20600, 21830, 23120, 24500, 25960, 27500, 29140, 30870

Ahle2
04-08-2012, 08:08 AM
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, 08: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, 10: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, 10: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, 09: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, 06: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?




PUB getNoteChannel( channelNumber ) | freq, tmp
freq := byte[@ch1_frequencyLo + (channelNumber*8)] | (byte[@ch1_frequencyLo + (channelNumber*8) + 1]<<8)
freq := f.FDiv( 16777216.0, f.FFloat(freq) )
freq := f.FDiv( C64_Clock_Freq, freq )
tmp := f.FDiv ( freq, 8.1757989156 ) ' 8.1757989156Hz = Frequency of Midi note 0 ( C )
tmp := f.FMul ( tmp, 1.041 )
tmp := f.Log10( tmp )
tmp := f.FMul ( tmp, 39.8631348 ) ' 3.3219279( convert to Log2 ) * 12( 12 notes / octave )
return f.FTrunc( tmp )


Thanks!
OBC

Ahle2
06-11-2012, 09:27 AM
It should work the same as before, Just copy-paste the method. :)

Oldbitcollector (Jeff)
06-11-2012, 12:29 PM
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, 02: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, 02:37 PM
@Tumbler, yes!! That board looks great too! Did you do your PCB for that Propeller Platform?

OBC

Tumbler
06-11-2012, 03: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, 04: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, 04: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, 08: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, 08: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, 05:59 PM
Some people have asked me to share all my dmp-files, so here they are!


SidDumpsMegaArchive_zip
(http://www.filefactory.com/file/5u31ih9ssrtb/n/SidDumpsMegaArchive_zip)OriginalSIDcogDemoTunes_zi p (http://www.filefactory.com/file/3k7x6qik9unl/n/OriginalSIDcogDemoTunes_zip)

pik33
06-15-2012, 07:47 AM
There is "bilinski" tune in this archive... headerless, 400 Hz... 400 Hz!!!

Ahle2
06-15-2012, 08: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, 02: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.

potatohead
06-17-2012, 02:17 AM
That SID tune is nuts good! Thanks for linking it.

Ahle2
06-17-2012, 07:59 AM
@potatohead
Yes, that's really something special. Goose bumps at 1:31. :)

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, 08: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, 08: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, 08: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, 09: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, 10: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, 10: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, 07: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, 04: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...

potatohead
06-18-2012, 04:52 AM
Oh, got it. Well, thanks for linking it. Sorry I got it confused. Nice productions. Good luck moving your program to Propeller.

Ahle2
06-25-2012, 08:06 PM
@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

http://www.youtube.com/watch?v=d1qEP2vMe-I&amp;feature=player_embedded

pik33
06-26-2012, 10:17 AM
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, 12: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, 07: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, 09: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.

Edit: Done. Propplay v.0.16 (http://forums.parallax.com/showthread.php?140767-A-new-topic-for-vga-(not-only)-sid-player&p=1113690&viewfull=1#post1113690) uses 10x oversampling nco instead of duty dac to sid sound output.

Invent-O-Doc
04-05-2013, 02:37 PM
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, 04: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, 05: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.