Page 1 of 1
farbrauschs music lib in a Purebasic userlibrary ...
Posted: Sat Feb 12, 2005 7:37 pm
by WolfgangS
Hi,
with some help of traumatic, Paul and Rings I wrapped kb/farbrauschs libv2 static library. Tthe synthesizer that was responsible for creating all sounds in the famous farbrausch intros such as .the .product, poemtoahorse, Candytron, Flybye and of course the 96 kilobyte shoot-em-up .kkrieger to a Purebasic userlibrary.
Summarized: With this userlibrary you can play .v2m songs.
The Links:
+ The userlibrary Libv2Purebasic
www.schliess.net
+ .schnurpfel - a lame libv2 player written with Libv2Purebasic
www.schliess.net
+ kb/farbrausch
http://kebby.org
+ farbrausch
www.farb-rausch.de
+ libv2 library with some additional infos
http://www.1337haxorz.de/products.html
Have fun + MFG
WolfgangS
Posted: Sat Feb 12, 2005 9:29 pm
by Tommeh
Cool, i'll have fun playing around with this good work

Re: farbrauschs music lib in a Purebasic userlibrary ...
Posted: Sat Feb 12, 2005 10:33 pm
by traumatic
In case someone's interested, here's the original (obviously adapted) example:
Code: Select all
ssInit(?theTune, GetForegroundWindow_())
OpenConsole()
PrintN("Farbrausch Tiny Music Player v0.2")
PrintN("Code and Synthesizer (C) 2000-2004 kb/Farbrausch");
PrintN("Now Playing: 'Experimental Trance' by DaFunk");
ssPlay()
Dim anim.b(3) : anim() = @"|/-\"
Repeat
ConsoleLocate(0,4)
Print(FormatDate("%ii:%ss", ssGetTime()*0.001) + " " +Chr(anim(Int(ssGetTime()/250.0)&3)))
Sleep_(10)
Until GetAsyncKeyState_(#VK_ESCAPE)
ssClose()
CloseConsole()
End
DataSection
theTune:
IncludeBinary("Dafunk - Experimental Trance.v2m")
EndDataSection
I really liked the animation

Posted: Mon Feb 14, 2005 7:07 pm
by Fred
Works great here, very cool lib..
Posted: Mon Feb 14, 2005 7:22 pm
by WolfgangS
:*)
...with a little help from my friends...
Re: farbrauschs music lib in a Purebasic userlibrary ...
Posted: Thu Feb 17, 2005 12:49 am
by traumatic
The following line of my above example doesn't work in v3.93b1:
Code: Select all
Print(FormatDate("%ii:%ss", ssGetTime()*0.001) + " " + Chr(anim(Int(ssGetTime()/250.0)&3)))
only the "Chr(anim(Int(ssGetTime()/250.0)&3)))"-part is shown.
However this works:
Code: Select all
Print(FormatDate("%ii:%ss", ssGetTime()*0.001) + " " + Hex(anim(Int(ssGetTime()/250.0)&3)))
This works, too:
Code: Select all
Print(FormatDate("%ii:%ss", ssGetTime()*0.001) + " " + Str(anim(Int(ssGetTime()/250.0)&3)))
And even that works (no additional space):
Code: Select all
Print(FormatDate("%ii:%ss", ssGetTime()*0.001) + Chr(anim(Int(ssGetTime()/250.0)&3)))
It worked in 3.92. Sorry, I just couldn't nail it down...
Re: farbrauschs music lib in a Purebasic userlibrary ...
Posted: Thu Feb 17, 2005 1:01 am
by traumatic
Another strange thing:
Take the above code and remark the following lines:
Code: Select all
; PrintN("Farbrausch Tiny Music Player v0.2")
; PrintN("Code and Synthesizer (C) 2000-2004 kb/Farbrausch");
; PrintN("Now Playing: 'Experimental Trance' by DaFunk");
Now the debugger says: "Array index out of bounds" !?
And no, this is no 3rd party library issue, try the following:
Code: Select all
OpenConsole()
PrintN("PureBasic rules") ; comment me to get "Array index out of bounds"!
Dim anim.b(0) : anim() = @"|/-\"
Repeat
ConsoleLocate(0,4)
Print(FormatDate("%ii:%ss", i*0.001) + " " + Chr(anim(Int(i/250.0)&3)))
i+10
Sleep_(10)
Until GetAsyncKeyState_(#VK_ESCAPE)
CloseConsole()
End
@WolfgangS: Sorry for hijacking your thread! Maybe some kind admin will move this

Re: farbrauschs music lib in a Purebasic userlibrary ...
Posted: Thu Feb 17, 2005 6:44 pm
by traumatic
Ok, this is not legal (I knew but liked it) and only worked with pure luck in 3.92
Thanks for clearing this, Fred!
Posted: Sat May 10, 2008 9:24 am
by THCM
Hi, there's a new v2m version out!
http://www.1337haxorz.de/products.html#v2
It would be very nice to have the new version as a lib for Purebasic!
Thanx in advance!
Posted: Sat May 10, 2008 10:04 am
by DarkDragon
I converted the new v2synth player code within 3 days of work after it was released (This spaghetti code of kb is really damn hard - Never thought anyone would missuse C++ to do spaghetticode in OOP [you can't do spaghetti code in OOP languages, just kb is able to do this] ) to purebasic. If you want it, please send me a private message and I'll send you the translated code.