Author Topic: Oldskool Musaxxs Engine for FB  (Read 12248 times)

0 Members and 1 Guest are viewing this topic.

Offline slippy

  • Atari ST
  • ***
  • Posts: 172
  • Karma: 42
    • View Profile
Oldskool Musaxxs Engine for FB
« on: June 09, 2007 »
Hey dudes,

I finally found some time to finish a first releaseable (still kinda beta) version of my OSMEngine ... find attached a package with some samples, the library and a readme ...  O0

Have fun using it ...

As always - any comments are welcome and appreciated ...  :||

Cheers,
SLiPPY


Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Oldskool Musaxxs Engine for FB
« Reply #1 on: June 10, 2007 »
Works very nicely for me here on Vista!  Have some karma!

Jim
Challenge Trophies Won:

Offline Emil_halim

  • Atari ST
  • ***
  • Posts: 248
  • Karma: 21
    • View Profile
    • OgreMagic Library
Re: Oldskool Musaxxs Engine for FB
« Reply #2 on: June 10, 2007 »

slippy773 , did not work in my system , XP SP2.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #3 on: June 10, 2007 »
Worked here, XP SP2, really really excellent work, have some Karma! I'm gutted that I never included this in the last newsletter!

Once question... How easy to one file it all into the finished product if something like bin2bas was used to convert the fc song?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #4 on: June 10, 2007 »
Heh, sorry I just realised that you'd included an example of that already!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline slippy

  • Atari ST
  • ***
  • Posts: 172
  • Karma: 42
    • View Profile
Re: Oldskool Musaxxs Engine for FB
« Reply #5 on: June 10, 2007 »
thanks for your comments so far ...

@emil_hamil: what exactly did you do? and what version of DirectX have you installed?

... just realized that there are some problems with proper looping of some of the musics ... gonna fix it asap :)

cheers,
SLiPPY

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #6 on: June 10, 2007 »
Ah, well I have been playing with this a little, it's really good Slippy, well done mate!

But...

Code: [Select]
' simple in-mem test
#include "osmereplayer.bi"
#include "media/dthings.bi"

    #define ptc_win
    #include "tinyptc.bi"
    #include "windows.bi"

    dim shared buffer(640*480) as uinteger
    IF (PTC_OPEN("WWW.DEFACTO2.NET",640,480)=0) THEN
    END-1
    END IF 


    dim shared info as osme_music_info_t
playOSMEMusicMem(@zaxxs(0), 1007, 1)
    info = getOSMEMusicInfo()
    print "Now playing " + info.title + " by " + info.author

    while(GetAsyncKeyState(VK_F1)<>-32767)
        ptc_update@buffer(0)
    wend
   
    stopOSMEMusic()
    ptc_close
    end

Causes the console window to crash horribly.
Is this library dependant somehow on having the console window open?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #7 on: June 10, 2007 »
Here's an example of it dying slightly on exit in an intro I am working on (unfinished).
Shockwave ^ Codigos
Challenge Trophies Won:

Offline slippy

  • Atari ST
  • ***
  • Posts: 172
  • Karma: 42
    • View Profile
Re: Oldskool Musaxxs Engine for FB
« Reply #8 on: June 10, 2007 »
Hey shocky,

I'm afraid ... on my Vista and on my Win XP SP2 it works ... both the intro (btw. cool as  usual *g*) and your small sample ...

How does it look like, when it crashes?

 ???

Cheers,
SLiPPY

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #9 on: June 10, 2007 »
Well, the tinyptc window closes as normal, however the console window is left open and will not close, it needs to be killed with the task manager here (XP SP2).

Thanks for comments about the intro. The intro will more than likely use ufmod as I have an xm module for it already, but if I can get your library to exit properly I will be using it in the next thing I make for S!P :) Will credit you fully of course.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Oldskool Musaxxs Engine for FB
« Reply #10 on: June 10, 2007 »
Ah, well I have been playing with this a little, it's really good Slippy, well done mate!

But...

Code: [Select]
' simple in-mem test
#include "osmereplayer.bi"
#include "media/dthings.bi"

    #define ptc_win
    #include "tinyptc.bi"
    #include "windows.bi"

    dim shared buffer(640*480) as uinteger
    IF (PTC_OPEN("WWW.DEFACTO2.NET",640,480)=0) THEN
    END-1
    END IF 


    dim shared info as osme_music_info_t
playOSMEMusicMem(@zaxxs(0), 1007, 1)
    info = getOSMEMusicInfo()
    print "Now playing " + info.title + " by " + info.author

    while(GetAsyncKeyState(VK_F1)<>-32767)
        ptc_update@buffer(0)
    wend
   
    stopOSMEMusic()
    ptc_close
    end

Causes the console window to crash horribly.
Is this library dependant somehow on having the console window open?
I found the problem, because you are using tiny_ptc internal 'escape key' check when you press it this command "stopOSMEMusic()" won't be executed. In the code above if you press F1 everything will work fine.
To fix this use "ptc_allowclose(0)" and change the while command to "while(GetAsyncKeyState(VK_ESCAPE)<>-32767)"

Btw, nice work slippy773

 :cheers:
Challenge Trophies Won:

Offline Emil_halim

  • Atari ST
  • ***
  • Posts: 248
  • Karma: 21
    • View Profile
    • OgreMagic Library
Re: Oldskool Musaxxs Engine for FB
« Reply #11 on: June 10, 2007 »
thanks for your comments so far ...

@emil_hamil: what exactly did you do? and what version of DirectX have you installed?

... just realized that there are some problems with proper looping of some of the musics ... gonna fix it asap :)

cheers,
SLiPPY

I have DirectX9  installed, and it always exit after a short period without producing any sound !!!!

Offline slippy

  • Atari ST
  • ***
  • Posts: 172
  • Karma: 42
    • View Profile
Re: Oldskool Musaxxs Engine for FB
« Reply #12 on: June 10, 2007 »
Hey emil_halim,

in case it says something like

Quote
OSME library v0.87 (2007/06/09) by SLiPPY/VeCTRONiX! ...
========================================================

OSME:: error while trying to initialize...

you may try to call it like for example with "osmengineplayer.exe media/do_things_loader.sndh" or such ...

are there any other error messages, the lib produces?

cheers,
SLiPPY

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #13 on: June 10, 2007 »
Well I got it working fine :) It was my own fault, the problem was that I was not checking for esc :( I was checking F1 by accident. Thanks for sorting the bugs out folks!

A few small examples of using the VU bars would be really nice now Slippy if you get the time :D Cheers!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Emil_halim

  • Atari ST
  • ***
  • Posts: 248
  • Karma: 21
    • View Profile
    • OgreMagic Library
Re: Oldskool Musaxxs Engine for FB
« Reply #14 on: June 10, 2007 »
Hey emil_halim,

in case it says something like

Quote
OSME library v0.87 (2007/06/09) by SLiPPY/VeCTRONiX! ...
========================================================

OSME:: error while trying to initialize...

you may try to call it like for example with "osmengineplayer.exe media/do_things_loader.sndh" or such ...

are there any other error messages, the lib produces?

cheers,
SLiPPY

Hi slippy773.

Thanks for your help, it works ok now , agian thank you.  :)

Offline slippy

  • Atari ST
  • ***
  • Posts: 172
  • Karma: 42
    • View Profile
Re: Oldskool Musaxxs Engine for FB
« Reply #15 on: June 10, 2007 »
Hey Shocky ...

here's a little method how to use the channel vu

Code: [Select]
sub channelVU()
    dim blank as integer
    snval=50*COS(GADD2/200)       
    snval2=30*COS(GADD2/173)
    blank = SCR_WIDTH / info.channels + snval
    For ch=0 To info.channels-1
        channel = getOSMEChannelVU(ch)
        ' magnify the volume a bit :)
        For y=300+(channel*4) To 300 + (info.max_vu*8)
            y1=(y+snval2) * SCR_WIDTH + snval*2
            ' paint one bar with 40px width
            For x=0 To 40 + channel
                BUFFER(y1+x+blank)=RGB((255-info.max_vu*4)+channel*2,0,0)
            Next x
        Next y
        snval=50*COS(GADD/200)       
        snval2=30*COS(GADD2/173)
        blank = blank + 80 + snval
    Next ch
end sub

and here's how it looks like :)

Basically you can query the info object for the amount of available channels via

info.channels (integer)
and the maximum volume at
info.max_vu (which is 16 for Atari YM-2149 and 64 for Amiga Paula)

to get the current volume per channel just call getOSMChannelVU(channel)

take care that you first call "playOSMEMusic..." and then "info = getOSMEMusicInfo()"

cheers,
SLiPPY
« Last Edit: June 10, 2007 by slippy773 »

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #16 on: June 11, 2007 »
That is really excellent Slippy and thank you very much indeed for posting the example! Very helpful, just the ticket in fact so have some good karma!

I will definately be putting this most excellent lib to use.

In fact now that we have this library and also Rbraz's excellent PTC_EXT, Ogremagic etc, some organisation would perhaps be a good idea of the forum so that these gems are easier to find!

Shockwave ^ Codigos
Challenge Trophies Won:

Offline slippy

  • Atari ST
  • ***
  • Posts: 172
  • Karma: 42
    • View Profile
Re: Oldskool Musaxxs Engine for FB
« Reply #17 on: June 11, 2007 »
thanks dude ...

perhaps you should make a new category for libs or so with bigger file-upload slots :)

Soon (today or tomorrow) I'll release a slightly fixed / size-reduced version of the lib ... question is how can I handle the 300kb upload quota without opening a new topic for this? or should I replace the attachment from the first posting with the current version from now on?

Just let me know ...

Cheers,
SLiPPY



Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Oldskool Musaxxs Engine for FB
« Reply #18 on: June 11, 2007 »
Well, the upload size could be whatever size we want to set it at, Slippy. It's set up as 300kb right now as a compromise measure, there is not unlimited file space and believe it or not, we have over 400mb of files on this board already!

Eventually something is going to have to be done to increase the file storage capacity. We're on shared hosting at the moment, there are lots of possibilities but I don't want to migrate this site to a shit provider so things will be changed in time, but very carefully.

A new forum category for libs would be a great idea. We have a lot of forums that could probably be merged too.

It needs looking at in the near future.

I'm looking forward to testing your lib, it's best to replace the original attachment with the new one, you can do that by editing your post. This way you'll make sure people have the latest version of your very useful lib!

Thanks again for your work on this, it's excellent.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline hellsangel

  • C= 64
  • **
  • Posts: 46
  • Karma: 10
    • View Profile
Re: Oldskool Musaxxs Engine for FB
« Reply #19 on: June 16, 2007 »
is osme exists as C static lib ?
great work
I hope to see new formats like DM, SA, SID...