Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help needed..
#31
Have you checked this?
http://forum.qbasicnews.com/viewtopic.php?t=8978
Antoni
Reply
#32
Yeah I've taken a look at this.
This one plays midi tunes.

And thats not the one I'm looking for either.

The one I am looking for is more of a program that generates simple analog sounds using sine waves, saw waves, sort of an oscillator type thingie.

Are you sure the QSound lib does that?

I might be stupid.
Reply
#33
The QBSound.bi file will generate a tone at a Freq using a midi timbre to do it. It would be nice if I.... errr.... I mean the person who wrote it would get off their duff and get a cross-platform general sound generation routine going that didn't require midi.


I have done a little of this with OpenAL, see this thread. It isn't great, but its a start.

And BTW, the QBSound.bi, doesn't play midi tunes (i.e. Midi Files) .... it lets you controll the midi device in windows (some day in Linux too) so that you can make your own music and/or sounds.

To use the sound feature of it try this:

Code:
#include once "qbsound.bi"

option explicit
sound 300, 1, midiSquare_Wave

Hope those points help.... if you come up with something better, different, or anything to add to the library please post it!
Reply
#34
@Vic
here another GUI example.
It uses a RC file for declaring the GUI.
This is supposedly the smallest GUI EXE you can get with fb: 3072bytes.
(at least without using a messagebox as a "hello world" window)

The rc file was created using Ketil0's ResED - the great resource editor coming with RadASM.
This resource editor is able to read and write rc files, creating GUI's in a snap.


dialog.rc
Code:
#define IDD_DLG1 1000
IDD_DLG1 DIALOGEX 6,6,194,102
CAPTION "HELLO WORLD"
FONT 8,"MS Sans Serif"
STYLE 0x10CC0000
EXSTYLE 0x00000080
BEGIN
END

dialog.bas
Code:
''
'' Dialog Example
''
'' compile with:  fbc -s gui dialog.rc dialog.bas
''
''
option explicit

#INCLUDE ONCE "win/kernel32.bi"
#INCLUDE ONCE "win/user32.bi"

#define IDD_DLG1 1000


declare function DlgProc ( byval hWnd as long, byval uMsg as long, byval wParam as long, byval lParam as long ) as integer
                              

'''
''' Program start
'''    

    ''
    '' Create the Dialog
    ''
    DialogBoxParam(GetModuleHandle (NULL), IDD_DLG1, NULL, @DlgProc, NULL)
    
    
    ''
    '' Program has ended
    ''
    ExitProcess (0)
    end

'''
''' Program end
'''    

                                  

function DlgProc ( byval hDlg as long, byval uMsg as long, byval wParam as long, byval lParam as long ) as integer
    ''
    '' Process message
    ''
    if uMsg = WM_INITDIALOG THEN      
        
    ''
    '' Window was closed
    ''
    elseif uMsg = WM_CLOSE THEN
        EndDialog( hDlg, 0)      

    else
        DlgProc = 0
        exit function
    end if
    
   DlgProc = 1
   exit function
end function

It's not a big thing, but it's nice... and small 8)
Reply
#35
Cool, example added, thanks.

If one day we could add to fbide a form editor like radasm has ;).. one day, one day..
Reply
#36
Quote:If one day we could add to fbide a form editor like radasm has Wink.. one day, one day..

Actually, because Windows is my main OS, I'm using ResED as form editor.
It works great (have to change my code to use resources though...).

The only downside is that people can change the resources...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)