Jump to content

MIDI support for sidplay2


TK.
 Share

Recommended Posts

As mentioned in another thread, currently no accurate .sid file player for the ASID protocol is available anymore. Totally frustrated I hacked into the unix version of sidplay2 today, and made some experiments - with the motivation to DIY a new solution. :)

Sidplay2 offers a modular API for output devices, therefore it was quite easy to forward the SID register accesses to the MIDI interface. By using the ASID protocol, data is compressed in a way which ensures no dataloss so long a .sid file is played at a C64 typical update rate of 50 Hz. However, as you can hear in this sample:

http://www.ucapps.de/tmp/sidplay2_via_midi_try1.mp3

the driver still needs some work. Timings are too wacky. This is partly related to the way how I access the MIDI interface (/dev/snd/midi is accessed via write(), no special ALSA functions are used), but mainly because the sending routine is not synchronized to the 50 Hz update rate of the emulated C64 sound routine. Thats nothing which couldn't be improved. :)

I'm planning to release the source code, but it will only run under Linux due to the way how the MIDI interface is accessed.

However, is there somebody with Windows programming skills, who has the right tools for building sidplay2 under Windows, and who knows how to access the MIDI interface?

Best Regards, Thorsten.

Link to comment
Share on other sites

Unfortunately, sidplay2 doesn't just "build out of the box"  >:(

I did actually get the source package building, after finally working out where each directory of source had to go and tinkering with project files. Then decided I should build off the development source in CVS which might at least have someone else trying to build it with Visual Studio, but that didn't build immediately either...

- you have to install "resid-0.16-p2.tgz" into "resid" subdirectory of root of all source. This contains changes to the official resid 0.16 which is in "resid-0.16.tar.gz" 

- you have to fix one compile error by replacing "log(2)" with "log(2.0)"

Even with the lack of documentation on setting up a Visual Studio build environment, this was far quicker to setup than a lot of other open source projects ;D

Link to comment
Share on other sites

Instructions for Linux users:

I compiled the CVS release - under Linux the compile order is important (don't remember which directories I compiled first, but you will find this out...). It's required to execute "bootstrap" in each directory in order to generate the "configure" file - the rest works as usual.

resid is not part of the CVS for some reasons - the patched version is important. On my PC, the builder/resid-builder was not compilable due to an unknown mute() function in resid-emu.cpp - I commented this out, thereafter it worked.

Best Regards, Thorsten.

Link to comment
Share on other sites

After one hour of additional work, .sid tunes are replayed much better now: :)

http://www.ucapps.de/tmp/sidplay2_via_midi_try2.mp3

I will clean up the code and thereafter release it as is - due to my low C++ knowledge, I don't know how to realize certain functions, e.g. passing the MIDI device via command line (currently it's hard coded), or writing the ASID routines more object oriented.

Great that you want to help out, Wilba! :)

Best Regards, Thorsten.

Link to comment
Share on other sites

ok, something was wrong - I applied the .patch file over the original release, maybe this was the reason.

It was the reason... the Makefile which is generated from resid-0.16-p2.tgz is not complete, "make install" doesn't copy the new include files + library to /usr/local/...

Workaround: generate a Makefile with the resid-0.16.tgz package and use this one

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 months later...

I have proudly finished my first midibox sid (just 1core+1sid) and wanted to play sid files. Unfortunately ASID XP didn't work on my win2k-machine and sidplayer showed the behavior that was mentioned before. but i wanted to hear definetly my favourite c64-song  ;)

So I did a small workaround:

  • installed midiyoke and midiox to have virtual midiports
  • played the file in sidplayer
  • recorded sysex messages in midiox
  • set the "delay after f7" down to 8ms
  • played the recorded sysex messages

This method is not very effective, but it was the only way for me, to get a nice playback. Now I have a new fileformat for c64-songs: .syx

I'm so happy with my fresh midibox, i never want to switch it off again  ;D

Link to comment
Share on other sites

Im just wondering which version of Sidplay are ye using?

In the older version of Sidplay  for Win32 (Nov 7 2002), theres a really handy mixer, with the 4 sid channels.

So you can mute or solo channels of your choice.

After this version they removed it for reasons unknown, it was a really handy feature imo.

Im pretty sure all the updates since were improvements to the sound engine.

I havent used the linux version but i guess its  also missing the mixer now.

Do you think it would be cool to use the source from this version just to have the mixer?

Or is there already away to mute channels with the Midibox itself?

Just a thought.

Link to comment
Share on other sites

I have one more question thats sort of related.

Is it possible to extract the Presets/Patches from a SID file?

What i mean is extract the synth patches that were used in each track.

So we could convert them to the format the bankstick uses, and play the patch live.

The tricky thing is that the patches change throughout the track so it might be difficult to read all patches.

Link to comment
Share on other sites

  • 2 months later...

bump!

So this will be merged into the official sidplay2? I see the development of sidplay2 is stopped since a year approximately and nobody wants to continue it in a more active way. Time for forking?

What aobut using sidplay2 from Debian? It seems to have a few fixes: http://packages.debian.org/sid/sidplay

I found this for mac guys: http://www.sidmusic.org/sidplay/mac/

Link to comment
Share on other sites

I haven't enough C++ experiences to integrate my "MIDI hack" correctly into sidplay2

All I did was to enhance the resid builder by some MIDI output routines. Normaly a seperate builder has to be created (as they did for HardSID), but my solution requires an emulation in background, so that .sid routines are able to read out the SID "random/env3" register.

MIDI interface is currently hardcoded to /dev/midi - I don't know how to forward a device argument from command line to a builder.

How about your programming skills? I could give you the changed builder "as-is" for a proper integration into the sidplay project.

Best Regards, Thorsten.

Link to comment
Share on other sites

How about your programming skills? I could give you the changed builder "as-is" for a proper integration into the sidplay project.

Me? I even can't code a line of basic. I want to learn computer programming soon, but I think it's very difficult to me and not sure when being able to do something really useful.

You can ask Raph, a canadian geek that does DIY hardware stuff related to retrocomputing (and a few other stuff related to microcontrollers) and maintains MikMod. Maybe you can convince him for sending a proper patch to sidplay2 developers or making some kind of fork if they don't reply.

I find the idea of playing SID tunes from C64 with MIDIbox very interesting, but I have no skills.

Link to comment
Share on other sites

I have proudly finished my first midibox sid (just 1core+1sid) and wanted to play sid files. Unfortunately ASID XP didn't work on my win2k-machine and sidplayer showed the behavior that was mentioned before. but i wanted to hear definetly my favourite c64-song  ;)

So I did a small workaround:

  • installed midiyoke and midiox to have virtual midiports
  • played the file in sidplayer
  • recorded sysex messages in midiox
  • set the "delay after f7" down to 8ms
  • played the recorded sysex messages

This method is not very effective, but it was the only way for me, to get a nice playback. Now I have a new fileformat for c64-songs: .syx

I'm so happy with my fresh midibox, i never want to switch it off again  ;D

Ok, this sounds really cool. What do you mean by "played the recorded sysex messages"? How did you manage that?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...