BeebSID

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
MartinB
Posts: 5213
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: BeebSID

Post by MartinB » Sun Aug 05, 2012 1:44 pm

PJ wrote:Relive the amazing Olympic starting ceremony in glorious SID 8-bit sound with the official BBC Micro Olympic SID disk!
Nice work as ever PJ :D =D>

Bearing in mind the opening ceremony was supposed to capture greatness in British society, BeebSID was a glaring omission :wink:

User avatar
1024MAK
Posts: 8904
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: BeebSID

Post by 1024MAK » Sun Aug 05, 2012 3:30 pm

:lol: :lol: :lol:

poink
Posts: 963
Joined: Tue Mar 01, 2011 10:27 am
Contact:

Re: BeebSID

Post by poink » Sun Aug 12, 2012 10:31 am

PitfallJones wrote:

Code: Select all

static void *itab[256] = {
 &&_00, &&_01, &&_02, &&_03, &&_04, &&_05, &&_06, &&_07, &&_08, &&_09, &&_0a, &&_0b, &&_0c, &&_0d, &&_0e, &&_0f,
&&_00 etc., are all defined elsewhere. IIRC, they're macros, but it's been a little while since I looked at the code.
PitfallJones wrote:Could somebody translate it into normal 'c' ?
It doesn't have to be fast - just compile....
It is 'normal c', some of the cleanest I've seen for a while.

Unfortunately, Visual C has somewhat of a reputation for not speaking normal C (For that matter, Visual C++ has a simiiar reputation for C++). The reputation isn't helped by their refusal to support C99; which is quite possibly at the base of your issue. Perhaps using a GCC port or the Intel compiler would give you more success?
PitfallJones wrote:But then the problem arises of data that contains code addresses - to do that it's easiest to simulate the code - I use a modified version of Sidplayer to do that.
Pretty much what sidreloc automates. My patched version (to also relocate the SID address) certainly seems to have a decent success rate converting tunes to play under a patched sidplay2, however, I'm fairly obviously missing something important about getting a SID to play on BeebSID. For that reason, I'd be very interested in someone taking a look at the SID conversion attempts I posted earlier.
PitfallJones wrote:So his quoted 'success' rate is very generous I think.
It's based on relocating the code to another location, and then it doing the same thing to the SID at the same times under emulation. As written, the output's intended for a C64. You lose a few more when you also relocate the SID to BeebSID addresses, of course.
PitfallJones wrote:If someone can post me the win32 exe for sidreloc I can probably add 'Can't get no Satisfaction'
I don't have any of the stuff to build it on Windows, but I could throw it through sidreloc here, if you let me know where to relocate it to.
PitfallJones wrote:I have worked out how to convert the notes in a MIDI file over to a SID but the result is rather bland - what we need is someone to give us a tutorial on making good SID envelopes and instrument timbre - maybe Tom? his ST conversions sound pretty good. If anyone wants to step-up it would be much appreciated!
Perhaps the C64 community have something else we can pillage and/or loot in that respect. :D

Hmm, there's some references to mid2mod and mid2sng, but people don't seem to think they do a decent job. (Of course, for MIDI, we could just hang a box containing a Yamaha XG synth off the 1MHz bus...)

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: BeebSID

Post by PitfallJones » Tue Aug 21, 2012 1:42 pm

It is 'normal c', some of the cleanest I've seen for a while.
By normal 'c' I mean straight plain long handed 'c' without all the ## define stuff - you know like how 6502 cores are normally written in Beebem and B-em for instance.

I can sort of figure out that he's defining all the commands for each opcode and then listing the addresses of each opcode routine in a table.

Code: Select all

static void *itab[256] = {
 &&_00, &&_01, &&_02, &&_03, &&_04, &&_05, &&_06, &&_07, &&_08, &&_09, &&_0a, &&_0b, &&_0c, &&_0d, &&_0e, &&_0f,
But I'm not surprised that I can't compile this - it looks like a table of addresses but && is a 'c' keyword so what does &&_00 mean?
Unfortunately, Visual C has somewhat of a reputation for not speaking normal C (For that matter, Visual C++ has a similar reputation for C++). The reputation isn't helped by their refusal to support C99; which is quite possibly at the base of your issue. Perhaps using a GCC port or the Intel compiler would give you more success?
I quite agree about the evils of Visual C - unfortunately it's the defacto standard so the world is stuck with it (and it's what I use at work).
GNU on the other hand seems to be a mass of variations like mingw, cygwin, djgcpp. - I used to have about 4 different 'c' compilers installed on my PC - now I just have one.... life's too short to maintain it all! Luckily most of the code websites (codeproject etc.) are all Visual C based and the majority of emulators writers support Visual C these days.

Maybe you could help me out and compile the file with gnu and get it to output the preprocessor stage:
http://gcc.gnu.org/onlinedocs/cpp/Prepr ... utput.html

With any luck that should replace all the defines so the 'c' will become understandable (to me), then I could get it to compile under Visual C.

- PJ

User avatar
Elminster
Posts: 3556
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: BeebSID

Post by Elminster » Tue Aug 21, 2012 7:58 pm

PitfallJones wrote: I quite agree about the evils of Visual C - unfortunately it's the defacto standard so the world is stuck with it (and it's what I use at work).
GNU on the other hand seems to be a mass of variations like mingw, cygwin, djgcpp. - I used to have about 4 different 'c' compilers installed on my PC - now I just have one.... life's too short to maintain it all! Luckily most of the code websites (codeproject etc.) are all Visual C based and the majority of emulators writers support Visual C these days.
Visual C the defacto Standard? A Subjective Statement if ever I head one. [I always try to avoid putting in a window server where I can put int proprietary Unix or Linux).

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: BeebSID

Post by Samwise » Tue Aug 21, 2012 9:13 pm

To throw in what little I know, for correction by those who's C skills are not as abysmal as mine ...

There's only one official standard for the language, which is the published specification ratified by ISO - the latest version being generally known as C11, which replaced C99.

The two main alternative Windows implementations mentioned so far are Microsoft's version and gcc. Neither of them yet cover the entire published specification, afaik.

Cygwin and MinGW are alternative ports of gcc to Windows with slightly different goals. My rudimentary understanding is that Cygwin uses a DLL (maybe more than one), primarily cygwin.dll, to provide a POSIX-like runtime which runs on top of Windows.

MinGW, on the other hand, compiles directly to a native Win32 application.

The upshot of which is that if you build something with Cygwin, any system you install it to will also need the Cygwin DLL(s). A MinGW application does not need any special runtimes as it links directly into the OS.

djgcpp isn't really comparable to Visual C or gcc, AIUI - it's a 16-bit port from way back in the 90s i.e. it's a port to DOS, not modern versions of Windows.

Sam.

Prime
Posts: 2723
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: BeebSID

Post by Prime » Tue Aug 21, 2012 11:35 pm

Samwise wrote: djgcpp isn't really comparable to Visual C or gcc, AIUI - it's a 16-bit port from way back in the 90s i.e. it's a port to DOS, not modern versions of Windows.
That's not strictly true, whilst DJGPP is for DOS, it uses a DOS extender, and so is 32bit, and will only run on a 386 or above. It is as far as I remember from when I was using it, however a port of gcc.

Cheers.

Phill.

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: BeebSID

Post by Samwise » Wed Aug 22, 2012 12:07 am

Fair point - the main thing is the last release was over a decade ago. :)

Sam.

simes
Posts: 48
Joined: Sun Apr 15, 2012 7:44 pm
Contact:

Re: BeebSID

Post by simes » Wed Aug 22, 2012 10:07 am

PitfallJones wrote: I can sort of figure out that he's defining all the commands for each opcode and then listing the addresses of each opcode routine in a table.

Code: Select all

static void *itab[256] = {
 &&_00, &&_01, &&_02, &&_03, &&_04, &&_05, &&_06, &&_07, &&_08, &&_09, &&_0a, &&_0b, &&_0c, &&_0d, &&_0e, &&_0f,
But I'm not surprised that I can't compile this - it looks like a table of addresses but && is a 'c' keyword so what does &&_00 mean?
As someone who earns a living from using C I read this with some interest. There is not a lot I don't know about how to use it, mostly the more obscure little used stuff. I had never heard of &&.
It turns out that it is a GCC specific extension
http://stackoverflow.com/questions/6106 ... void-p-abc

It really looks like a horrible hack and any one who uses it should be ashamed of themselves.

So while it might be nice to knock Microsoft for not being standard GCC is not whiter than white either. Its just in this case its a feature you are NOT forced to use.

User avatar
Elminster
Posts: 3556
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: BeebSID

Post by Elminster » Wed Aug 22, 2012 10:29 am

I think the point was that ANSI C is the standard, not sure any one said any product was perfect.

Very few products are 100% ANSI standards compatible. And products that are are often several versions behind. But generally if you picked up K&R C book from the 70's (I have an original in pride of place on my book shelf) you should be able to pickup any compiler and do it.

Also Standards often borrow things from products, so what might be illegal in one version of the standard isnt in the next etc. It just takes a lot of people to find it useful to get things changed. And they are often several ways of doing the same thing as they have been lifted from several popular products. Or there might be fudges in products to make them compliant.

Clearly MS C is good for MS (but you can use GCC if you prefer, and I do, having been a GCC user for 20 years on and off), Objective-C is good for Apple and GCC good for most other things.

TopBanana
Posts: 1064
Joined: Wed Jun 09, 2010 2:16 pm
Contact:

Re: BeebSID

Post by TopBanana » Thu Aug 23, 2012 4:24 pm

simes wrote: It turns out that it is a GCC specific extension
You can use && in Visual C++ 2010 to define and initialise an rvalue reference.

Alledgedly :lol: :lol:

I've not looked at the code in SidReloc so I'm not sure how it's used in reference to the above.

User avatar
Garrettimus
Posts: 1004
Joined: Tue Feb 13, 2007 9:50 am
Location: Sao Paulo, Brazil
Contact:

Re: BeebSID

Post by Garrettimus » Thu Aug 23, 2012 4:37 pm

I want one too! =D>

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: BeebSID - SidReloc

Post by PitfallJones » Sat Aug 25, 2012 12:40 pm

Re: Sidreloc.

I managed to rewrite the source so I could compile the exe for Windows, and here it is:
Cpu.zip
(7.62 KiB) Downloaded 75 times
I've now been able to run it on a few SIDs I've had trouble with in the past with much success!!

!! Great stuff !! I can see I'm going to have some fun with this tool - it should certainly speed up future conversions a bit.

Thanks for posting it!

-PJ

User avatar
oss003
Posts: 3004
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: BeebSID

Post by oss003 » Sat Aug 25, 2012 5:37 pm

Hi guys,

I found another tool which can be usefull to examine the SID data. You can convert a SID file to a MIDI- or TEXT file. The text file must be viewed with wordpad or another viewer which executes $0A as a CRLF instead of LF.

The output looks like this:

Code: Select all

Monty On The Run - SID2MIDI Text/SID Dump

PW = pulse width (0-4095)
WF = waveform (xy : 1?=triangle, 2?=sawtooth, 4?=pulse, 8?=noise)
	 (?2=synchronization, ?4=ring modulation, ?6=sync+ringmod)
VL = volume level (0-FF)

Filter type: L = low-pass, B = band-pass, H = high-pass
Filter voices: 1__ = filter on voice 1, _2_ = voice 2, __3 = voice 3, and so on
Filter cut-off frequency (SID value, 0-7F0)
Filter resonance (SID value, 0-F)

Time format: minute:second.hundredth

          Voice 1                     Voice 2                     Voice 3
Time      Note  Freq  PW  WF ADSR VL  Note  Freq  PW  WF ADSR VL  Note  Freq  PW  WF ADSR VL  Filter
============================================================================================================
00:00.00  >D-7< ---- 2048 40 0000 ff  >H-5< ---- 3136 40 0000 ff  >G-1< ---- 2944 40 0000 ff  ___ ___   0 0
00:00.02   +++  ---- 2048 40 0440 ff   +++  ---- 3136 40 3fff ff   +++  ---- 2944 40 0970 ff  ___ ___   0 0
00:00.04   +++  ---- 2048 40 0440 ff   +++  ---- 3136 40 3fff ff   +++  ---- 2944 40 0970 ff  ___ ___   0 0
00:00.06   +++  ---- 2048 40 0440 ff   +++  ---- 3136 40 3fff ff   +++  ---- 2944 40 0970 ff  ___ ___   0 0
00:00.08   +++  ---- 2048 40 0440 ff   +++  ---- 3360 40 3fff ff   +++  ---- 2944 40 0970 ff  ___ ___   0 0
[/size]
Greetings
Kees
Attachments
SID2MIDIw.zip
(283.98 KiB) Downloaded 76 times

User avatar
Samwise
Site Admin
Posts: 1823
Joined: Mon Mar 14, 2005 9:13 pm
Contact:

Re: BeebSID

Post by Samwise » Tue Aug 28, 2012 2:35 pm

I inadvertently started a discussion on text editors, which has now been split off into its own 2012 editor holy war topic, as it wasn't directly relevant to this original topic.

Sam.

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

BeebSID Disk#11 TV Tunes!

Post by PitfallJones » Sat Feb 09, 2013 5:27 pm

The first for 2013 - 26 fab tunes (I ran out of keys) - enjoy!
beebsid11.jpg
beebsid11.jpg (54.69 KiB) Viewed 1138 times
Attachments
beebsid11.zip
(42.51 KiB) Downloaded 151 times

User avatar
oss003
Posts: 3004
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: BeebSID

Post by oss003 » Sat Feb 09, 2013 6:04 pm

Ok PJ,

keep up the good work!!! =D>

Greetings
Kees

User avatar
MartinB
Posts: 5213
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: BeebSID

Post by MartinB » Sat Feb 09, 2013 8:42 pm

Thanks for another gem PJ =D>

(You really should get a Grammy nomination for a 'Lifetime Services to BeebSID' award :D)

User avatar
billcarr2005
Posts: 1337
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: BeebSID

Post by billcarr2005 » Sat Feb 09, 2013 11:57 pm

Thanks for continuing to create these "albums"!
Did you ever get an auto-relocation program sorted? :)

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: BeebSID

Post by PitfallJones » Sun Feb 10, 2013 4:09 pm

Thanks for that Guys,

I enjoy getting new tunes converted as I have my BBC plugged into a decent speaker and the BeebSID sounds great.

SIDs are so uniquely brilliant I think due to all the 1000s of songs that people have already created over the years - I find them more 'interesting' sounding than midis - it's amazing the quality of music people have made from just 3 channels.

I don't need to put in so much effort converting each song now as I use SidReloc if it's out of range and then my own program to fix the SIDchip addresses and zero play addresses.

If the song still doesn't work I just pick an alternative version or a different song - or like with a few songs on the Queen Disk I have to disassemble each song by hand - but that can take several days per song!

Disk#11 was actually going to be a 1982 disk but I couldn't find a SID for "Come on Eileen". I tried making one but it didn't sound good enough. I've got a much better understanding of what makes a SID sound good now - that SID2MIDI program Kees posted was great - you can really see clearly whats being changed in each channel. Of course understanding is not the same as creating!

-PJ

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

BeebSID Disk#12 - How about some Jarre?

Post by PitfallJones » Mon Apr 29, 2013 1:01 pm

In this case less is more!
beebsid12.jpg
beebsid12.jpg (20.53 KiB) Viewed 892 times
Attachments
beebsid12.zip
(20.93 KiB) Downloaded 135 times

User avatar
oss003
Posts: 3004
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: BeebSID

Post by oss003 » Mon Apr 29, 2013 3:31 pm

Allright PJ ....... again another masterpiece ready =D> =D>
Back to the 80's, I like this kind of music!

Greetings
Kees

User avatar
MartinB
Posts: 5213
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: BeebSID

Post by MartinB » Mon Apr 29, 2013 6:47 pm

Another great release in the 'Now that's what I call SID music' series by DJ PJ =D> :D

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: BeebSID

Post by PitfallJones » Wed May 01, 2013 2:09 am

Ha! ha! Actually this musical series is my inspiration. :-)
top.jpg
top.jpg (66.44 KiB) Viewed 801 times

User avatar
richardtoohey
Posts: 3712
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: BeebSID

Post by richardtoohey » Wed May 01, 2013 4:19 am

Ah, yes, the greatest "hits" of the 80s :D ... had to type that carefully ... one letter makes all the difference ... :lol:

What a blast from the past - not just Sam, but also those songs ... :D

User avatar
sweh
Posts: 2043
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: BeebSID

Post by sweh » Thu May 02, 2013 12:04 am

Oh I remember them. I had Volume 61 from 1977. A neighbour bought it as a birthday present...

Huh, funny! I have hundreds of collection CDs, but there's 6 songs on that album I don't have!
Rgds
Stephen

User avatar
martinw
Posts: 1352
Joined: Sat Nov 13, 2010 10:31 am
Location: Aberdeenshire, Scotland
Contact:

Re: BeebSID

Post by martinw » Wed May 08, 2013 6:44 pm

Cheers guys this is a very nifty little addition to my Acorn setup, playing through the Master speaker 8)

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

Martin :D

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: BeebSID

Post by PitfallJones » Fri May 10, 2013 11:43 am

Oh I remember them. I had Volume 61 from 1977. A neighbour bought it as a birthday present...
Hey -that's a great site - thanks. I have three albums I think - one with a 'terrific' version of Bohemian Rhapsody - when I was a kid I though the songs were the real thing!


Cheers guys this is a very nifty little addition to my Acorn setup, playing through the Master speaker
Excellent choice of Benny Hill :-)

User avatar
oss003
Posts: 3004
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: BeebSID

Post by oss003 » Fri May 10, 2013 12:17 pm

Hey PJ,

Sam also sticks on an Atom!!

Greetings
Kees
Atomic Sam.PNG
Atomic Sam.PNG (110.12 KiB) Viewed 632 times

User avatar
PitfallJones
Posts: 447
Joined: Fri Feb 22, 2008 3:44 pm
Contact:

Re: BeebSID

Post by PitfallJones » Sat May 11, 2013 9:53 am

Excellent stuff Kees - Sorry I couldn't help myself - try this one - Linda was always my favourite...
miss_lusardi.jpg
miss_lusardi.jpg (165.21 KiB) Viewed 599 times
I shall endeavour to stay on topic in future..

Post Reply