Translate 20 lines of C++

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Hi !
There is a library available to play .sid files. Unfortunately to show how it works there is only a C++ sourcecode available.
If you can help me to translate 20 lines of C++ in Purebasic i would be extremely happy :)

Get the Source, Library and a few .sid songs from here: http://www.schliess.com/stuff/libsid.zip
Mainpage of the libsidplay2 library: http://sidplay2.sourceforge.net/
Get a .sid Player and feel the magic of .sid files:http://www.d.kth.se/~d93-alo/c64/spw/

MFG
:)WolfgangS
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Kendrel.

i'd be also very interested in this...

ill have a look into it myself tomorrow, but i fear my c++ knowledge isnt big enough... atleast ill try it.

if someone of you is able to do it, then please come on and help us out... i loved the c64 and still listen to some of its sid musics... would be very nice to have some of them in a game or something... makes retro stuff even more retro :)

so long,

kendrel
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Why don't you post those 20 C++ lines? It would be easier...

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

>Why don't you post those 20 C++ lines? It would be easier...

Because you need the whole packet from http://www.schliess.com/stuff/playsid.zip, but if you want ... :wink:

MFG
:)WolfgangS



Code: Select all

#include "sidplay\sidplay2.h" #include "sidplay\sidtune.h" 
#include "AudioDriver.h" 
#include "AudioConfig.h" 

const char* szSidFile = "bub.sid"; 
void* pBuffer = 0; 


int main(int argc, char* argv[]) 
{ 
AudioDriver* pAudioDriver = new AudioDriver; 

AudioConfig* pAudioConfig = new AudioConfig; 
pBuffer = pAudioDriver->open(*pAudioConfig); 

SidTune* pTune = new SidTune(szSidFile, 0, false); 
pTune->selectSong(2); 

sidplay2* pSidplay2 = new sidplay2; 
pSidplay2->loadSong(pTune); 
pSidplay2->configure(sid2_mono, 44100, 16, false); 
pSidplay2->environment(sid2_envPS); 
pSidplay2->optimisation(1); 


for(;;) { 
pSidplay2->play(pBuffer, pAudioConfig->bufSize); 
pBuffer = pAudioDriver->write(); 
}
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Hi WolfangS,
Only 20 lines???
You forgot the headers definitions. Hehehehe.
Is more easy download from the site.
Byby
Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Link to http://www.schliess.com/stuff/libsid.zip
is repaired now ...

Download it and get the C++ Source, the library and a few .sid Songs ...


MFG
:)WolfgangS
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by GPI.

Why do you not use a Winamp-Plugin for playing SID-Files.

viewtopic.php?t=5104

When you use the "out_ds.dll" as output-plugin, you should be able to play Sids and use the soundsystem of PureBasic.

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

HI GPI!
Unfortunately there is no other way to contact you ...
Did you also figure out how to change from one song to the other song when MORE then ONE song is in a single songfile ?
This happend e.g. in .sid files ....
When i load the .sid plugin with the WinAmp there appears another scrollbar to scroll through the different songs in the single file.

Thank you for your time
WolfgangS
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by GPI.

Hmm, this is a problem of your Plugin. The SID-Plugin, that you are use, open this second scrollbar.

I used the SidAmp V1.33-Plugin and there is no second scrollbar.

http://www.labyrinth.net.au/~adsoft/sidamp/
or
http://www.zophar.net

(i set the engine to "reSID-Engine")



PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

HI !
I used the SidAmp V1.33-Plugin and there is no second scrollbar.
It is buggy with the SidAmp V1.33 (also 1.34) Plugin. You have to start the WinAmp and the pointer of your playlist have to be on a "multisong" .SID file. It better work with the in_littlesid.dll http://www.sid6581.org(but worse sound quatity :|)
Look at this: http://www.schliess.com/stuff/Image5.png and you will see the special scrollbar with the information how many songs are in the file and which one is the actual.

I´m quite sure there is a standardized way to figure out how many songs are in one file and a special way to choose from it.

Check it again with this .SID file (it contains 4 songs)http://www.schliess.com/stuff/Sandision.sid

MFG
:)WolfgangS
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by GPI.

I don't think, that there is a possiblity to find out how many songs are in the file.

Is it in Winamp possible to switch the Sounds in the file by pressing a Button?

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Hi !
Yes. I the case of the picture WinAmp figured out how many songs are in the file (in this case 10) the actual song (2nd one) and you can change the current song by pressing "+" or "-".
You see this scrollbar when you use the in_littlesid.dll and the in_sid.dll plugin.
The scrollbar should appear every time when a musicfile is loaded which provides more then one song in a file. Unfortunately i know only .sid.
Does .XM provides more then one song in a single file ?

MFG
:)WolfgangS
Post Reply