Search found 647 matches

by grindstone
Dec 07, 2019 17:41
Forum: General
Topic: Preprocessor question
Replies: 16
Views: 350

Re: Preprocessor question

Very strange.

Code: Select all

#Define INC_LIB "..\_code_lib_new_

#Include Once INC_LIB\graphics_v02.bi"
works, while

Code: Select all

#Define INC_LIB "..\_code_lib_new_\

#Include Once INC_LIBgraphics_v02.bi"
throws an error.
by grindstone
Dec 06, 2019 14:55
Forum: General
Topic: Preprocessor question
Replies: 16
Views: 350

Re: Preprocessor question

There's indeed a trick to do so. First you have to rename your include directory to "_ code_lib_new_" with a space between the leading underscore and the rest of the name. Then you can code #Define INC_LIB "..\_ '#Define INC_LIB "_ #Include Once INC_LIB code_lib_new_\graphics_v02...
by grindstone
Nov 15, 2019 15:18
Forum: Game Dev
Topic: Controlling two characters at once
Replies: 3
Views: 187

Re: Controlling two characters at once

If using a multi-core-processor, it could help to do every calculation in an own thread.
by grindstone
Nov 08, 2019 13:26
Forum: Beginners
Topic: Why UBound doesnt take into account 0 reporting array size?
Replies: 6
Views: 246

Re: Why UBound doesnt take into account 0 reporting array size?

UBound notifies the upper bound (the uppermost index) of an array, not the total number of indices. E.g. array(20 to 22) will report a UBound value of 22, although there are only three indices (20, 21 and 22) available.
by grindstone
Oct 23, 2019 11:14
Forum: Community Discussion
Topic: Audio library for FreeBasic - Features
Replies: 77
Views: 12762

Re: Audio library for FreeBasic - Features

Your thoughts make sense, I agree. Here some routines for amplification and normalizing with a little example, at the moment 32bit float only: Declare Function db (x As Single) As Single Declare Function ra (x As Single) As Single Declare Sub ampfloat (buffer As Single Ptr, bufsize As ULong, amplifi...
by grindstone
Oct 22, 2019 22:33
Forum: Community Discussion
Topic: Audio library for FreeBasic - Features
Replies: 77
Views: 12762

Re: Audio library for FreeBasic - Features

I don't know what happened, but today the Wordpad trick works. Very strange... internally, in my library, WAV data are stored at 8 or 16 bit formats, mono or stereo, pcm uncompressed, with a fixed size header. As internal format I would strongly recommend 32bit float, just because this format provid...
by grindstone
Oct 21, 2019 18:25
Forum: Community Discussion
Topic: Audio library for FreeBasic - Features
Replies: 77
Views: 12762

Re: Audio library for FreeBasic - Features

You're right, I'm using Windows. I know that Wordpad trick, but it doesn't work if there aren't any line breaks at all (no Chr(10), not even a space). Maybe I could contribute some routines for amplifying, normalizing and converting .WAVs (pcm and float, 16 and 32 bit), but I'd have to recode them u...
by grindstone
Oct 21, 2019 17:54
Forum: Community Discussion
Topic: Audio library for FreeBasic - Features
Replies: 77
Views: 12762

Re: Audio library for FreeBasic - Features

@angros47: What editor do you use? I've downloaded your sfx.zip, but here in FbEdit your sources are displayed as one single line without any line breaks. The compiler seems to get along with this, but for me as a human your source code is simply unreadable :-(
by grindstone
Oct 17, 2019 11:28
Forum: General
Topic: Pan and Zoom 2D with mouse (solved)
Replies: 6
Views: 286

Re: Pan and Zoom 2D with mouse

Whatever the origin of your trouble may be, the polling of the mouse wheel surely in't: #Define RES_W 1920 #Define RES_H 1080 Static As Integer old_ms Dim As Integer mx,my,ms,mb Dim As Double zoom, pan_x, pan_y Do GetMouse mx,my,ms,mb If ms <> old_ms Then Zoom = (ms+4) / 4 '' Zoom in increments of ....
by grindstone
Oct 16, 2019 14:41
Forum: Community Discussion
Topic: [offtopic] retro computing VASM
Replies: 10
Views: 684

Re: [offtopic] retro computing VASM

But an FB - AVR - compiler would be great anyway. :-D
by grindstone
Oct 15, 2019 13:27
Forum: Community Discussion
Topic: [offtopic] retro computing VASM
Replies: 10
Views: 684

Re: [offtopic] retro computing VASM

A freeBasic compiler for AVR would be GREAT!!!
by grindstone
Oct 05, 2019 15:11
Forum: General
Topic: String Sort problem
Replies: 24
Views: 1336

Re: String Sort problem

Dinosaur wrote:Each time I replace a Comma, I remembered the position with LFCnt.LF(X):

Could it be that you DIMmed an array inside your UDT and try to access it beyond its upper bound?
by grindstone
Oct 03, 2019 16:54
Forum: General
Topic: Sound file sample access (WAV or MP3)
Replies: 6
Views: 684

Re: Sound file sample access (WAV or MP3)

I don't know what exactly you want to do, but here's a snippet that normalizes a single wav - file (pcm or float). It's part of a program I use to batch - normalize / convert the wav - files of a whole directory. For the conversion it uses ffmpeg . #Include "..\fbm_RIFFheader.bas" #Include...
by grindstone
Sep 20, 2019 9:38
Forum: Beginners
Topic: File created by an external program
Replies: 4
Views: 671

Re: File created by an external program

In Windows, you could try to open the file in exclusive mode. This will fail as long as the file is accessed by an other program: #Include "windows.bi" Dim As HANDLE fh Dim As String filename = "c:\testfile.txt" Do fh = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0...
by grindstone
Aug 31, 2019 15:04
Forum: Windows
Topic: open output file with no name
Replies: 2
Views: 3760

Re: open output file with no name

If you slightly change this snippet to

Code: Select all

Dim as string filename1
Print Open (filename1 for output as #1)
Sleep
you'll see that it retrurns error code 2, meaning "File not found". So no file will be created.

Go to advanced search