Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - S. P. Gardebiter

#41
Falls irgendjemand dran interessiert ist.
Der Sourcecode ist vielleicht etwas schwer zu verstehen :o
Falls es Fragen gibt einfach an mich wenden.
Dieser Code gibt als Output nur Rohdaten aus, Format ist Mono bei 44100 Hz, signiertert, 16-Bit PCM.

Code (glbasic) Select
CountX = 0
CountY = 0
DIM Count[16]
DIM CountZ[16]

SampleRate = 44100

NumInstruments = 2
Samples = 0

// Für Noten und erzeugung des Tones
DIM Volume[8192][16]
DIM Frequency[8192][16]
DIM Length[8192][16]
DIM Volume[8192][16]
DIM Note[120]
DIM CurrentLength[16]
DIM TotalLength[16]
// Für die Frequenz Modulations Synthese
DIM FMS[16]
DIM FMFrequency[16]
DIM FMFineTune[16]
DIM FMShift[16]
DIM FMVolume[16]
DIM Sample[16]
// Noten, Notenlänge und Lautstärke definieren
Frequency[0][0] = 29
Frequency[1][0] = 32
Frequency[2][0] = 34
Frequency[3][0] = 36
Frequency[4][0] = 37
Frequency[5][0] = 41
Frequency[6][0] = 34
Frequency[7][0] = 41
Frequency[8][0] = 46
Frequency[9][0] = 48
Frequency[10][0] = 49
Frequency[11][0] = 46
Frequency[12][0] = 48
Frequency[13][0] = 44
Frequency[14][0] = 41
Frequency[15][0] = 34
Frequency[16][0] = 36
Frequency[17][0] = 37
Frequency[18][0] = 41
Frequency[19][0] = 34
Frequency[20][0] = 33
Frequency[21][0] = 34
Frequency[22][0] = 36
Frequency[23][0] = 37
Frequency[24][0] = 41
Frequency[25][0] = 37
Frequency[26][0] = 36
Frequency[27][0] = 34
Frequency[28][0] = 36
Frequency[29][0] = 37
Frequency[30][0] = 39
Frequency[31][0] = 41
Frequency[32][0] = 44
Frequency[33][0] = 46
Frequency[0][1] = 25
Frequency[1][1] = 28
Frequency[2][1] = 30
Frequency[3][1] = 32
Frequency[4][1] = 34
Frequency[5][1] = 37
Frequency[6][1] = 29
Frequency[7][1] = 37
Frequency[8][1] = 41
Frequency[9][1] = 41
Frequency[10][1] = 41
Frequency[11][1] = 37
Frequency[12][1] = 39
Frequency[13][1] = 36
Frequency[14][1] = 33
Frequency[15][1] = 30
Frequency[16][1] = 32
Frequency[17][1] = 34
Frequency[18][1] = 36
Frequency[19][1] = 25
Frequency[20][1] = 24
Frequency[21][1] = 25
Frequency[22][1] = 27
Frequency[23][1] = 29
Frequency[24][1] = 34
Frequency[25][1] = 29
Frequency[26][1] = 27
Frequency[27][1] = 25
Frequency[28][1] = 27
Frequency[29][1] = 29
Frequency[30][1] = 34
Frequency[31][1] = 36
Frequency[32][1] = 39
Frequency[33][1] = 41
Frequency[0][2] = 24
Frequency[1][2] = 18
Frequency[2][2] = 25
Frequency[3][2] = 18
Frequency[4][2] = 25
Frequency[5][2] = 20
Frequency[6][2] = 27
Frequency[7][2] = 20
Frequency[8][2] = 27
Frequency[9][2] = 22
Frequency[10][2] = 29
Frequency[11][2] = 22
Frequency[12][2] = 29
Frequency[13][2] = 22
Frequency[14][2] = 29
Frequency[15][2] = 22
Frequency[16][2] = 29
Frequency[17][2] = 18
Frequency[18][2] = 25
Frequency[19][2] = 18
Frequency[20][2] = 25
Frequency[21][2] = 20
Frequency[22][2] = 27
Frequency[23][2] = 20
Frequency[24][2] = 27
Frequency[25][2] = 17
Frequency[26][2] = 24
Frequency[27][2] = 17
Frequency[28][2] = 24
Frequency[29][2] = 17
Frequency[30][2] = 24
Frequency[31][2] = 17
Frequency[32][2] = 24
Frequency[33][2] = 15
Frequency[34][2] = 22
Frequency[35][2] = 15
Frequency[36][2] = 22
Frequency[37][2] = 17
Frequency[38][2] = 24
Frequency[39][2] = 17
Frequency[40][2] = 24
Frequency[41][2] = 18
Frequency[42][2] = 25
Frequency[43][2] = 18
Frequency[44][2] = 25
Frequency[45][2] = 17
Frequency[46][2] = 24
Frequency[47][2] = 17
Frequency[48][2] = 24
Frequency[49][2] = 18
Frequency[50][2] = 25
Frequency[51][2] = 18
Frequency[52][2] = 25
Frequency[53][2] = 20
Frequency[54][2] = 27
Frequency[55][2] = 20
Frequency[56][2] = 27
Frequency[57][2] = 22
Frequency[58][2] = 29
Frequency[59][2] = 24
Frequency[60][2] = 31
Frequency[61][2] = 26
Frequency[62][2] = 34
Frequency[63][2] = 38
Frequency[64][2] = 41
FOR CountY = 0 TO 1
Length[0][CountY] = 2
Length[1][CountY] = 2
Length[2][CountY] = 8
Length[3][CountY] = 2
Length[4][CountY] = 2
Length[5][CountY] = 4
Length[6][CountY] = 10
Length[7][CountY] = 2
Length[8][CountY] = 2
Length[9][CountY] = 2
Length[10][CountY] = 4
Length[11][CountY] = 4
Length[12][CountY] = 4
Length[13][CountY] = 4
Length[14][CountY] = 16
Length[15][CountY] = 8
Length[16][CountY] = 2
Length[17][CountY] = 2
Length[18][CountY] = 4
Length[19][CountY] = 8
Length[20][CountY] = 8
Length[21][CountY] = 2
Length[22][CountY] = 2
Length[23][CountY] = 2
Length[24][CountY] = 2
Length[25][CountY] = 2
Length[26][CountY] = 2
Length[27][CountY] = 2
Length[28][CountY] = 2
Length[29][CountY] = 2
Length[30][CountY] = 2
Length[31][CountY] = 2
Length[32][CountY] = 2
Length[33][CountY] = 8
NEXT
FOR CountX = 1 TO 64
Length[CountX][2] = 2
Volume[CountX][2] = 20000
NEXT
Length[0][2] = 4
Volume[0][2] = 0
FOR Count = 0 TO 33
FOR CountY = 0 TO 1
Volume[Count][CountY] = 20000
NEXT
NEXT

// Notenfrequenz

Note[0] = 27.5

FOR Count = 1 TO 119
Note[Count] = 1.059463094359 * Note[Count-1]
NEXT

// Für die Modulationssynthese: Frequenz, Phasenverschiebung und Lautstärke

FMFrequency[0] = 24
FMFrequency[1] = 12
FMFrequency[2] = 0
FMShift[0] = 0
FMShift[1] = 50
FMShift[2] = 0
FMVolume[0] = 1
FMVolume[1] = 1
FMVolume[2] = 0.5

FOR CountY = 0 TO 15
FOR CountX = 0 TO 8191
INC TotalLength[CountY], Length[CountX][CountY] * 4410
NEXT
NEXT

IF OPENFILE(1, "Output.wav", FALSE) // Save output

// Synthese, speicherung der Noten

CountX = 0
CountY = 0

WHILE TRUE
FOR CountY = 0 TO NumInstruments
IF Count[CountY] <> Length[CountZ[CountY]][CountY] * 4410
INC Count[CountY], 1
INC CurrentLength[CountY], 1
FMS[0] = (SIN(360/SampleRate*Count[CountY]*Note[Frequency[CountZ[CountY]][CountY]+FMFrequency[0]]+FMShift[0])*Volume[CountZ[CountY]][CountY]*FMVolume[0])
FMS[1] = (SIN(360/SampleRate*Count[CountY]*Note[Frequency[CountZ[CountY]][CountY]+FMFrequency[1]]+FMShift[1])*Volume[CountZ[CountY]][CountY]*FMVolume[1])
FMS[2] = SIN(360/SampleRate*Count[CountY]*Note[Frequency[CountZ[CountY]][CountY]+FMFrequency[2]]+FMShift[2])
IF FMS[2] >= 0
FMS[2] = (1*Volume[CountZ[CountY]][CountY]*FMVolume[2])
ELSE
FMS[2] = (0*Volume[CountZ[CountY]][CountY]*FMVolume[2])
ENDIF
Sample[CountY] = (FMS[0]+FMS[1]+FMS[2])/3
ELSE
Count[CountY] = 0
IF CurrentLength[CountY] = TotalLength[CountY]
BREAK
ELSE
INC CountZ[CountY], 1
ENDIF
ENDIF
NEXT
WRITEWORD 1, (Sample[0]+Sample[1]+Sample[2])/3
WEND

CLOSEFILE 1

ENDIF

#42
Ich hab hier ein Problem mit der Endianess... Gibt es einen Weg bei GLBasic anzugeben ob die Daten im Big Endian oder Little Endian gespeichert werden? :o
Wenn nicht, könnte man es bald hinzufügen?
#43
Gibt es irgendeine Möglichkeit, (zumindest unter Windows) einen Sound per GLBasic Programm erstellen zu lassen bzw. gleich abzuspielen? Hat jemand mit sowas schonmal Erfahrungen gemacht?

Edit: Wahrscheinlich brauch ich dazu das .wav File Format oder? :P
#44
Ich bastel gerade an einem Editor für ein Windows Spiel, wäre sehr schön wenn es dafür eine Funktion gäbe. (Mir egal ob Multiplatform oder nicht - es ist eh Windows only.)
#45
A friend of mine just tested my game :P
In window mode the window pops up but the screen is white.
My friend is using Windows Vista...
My game is running well on my PC and on another PC too :P
As far as I know my friend has got the OpenGL drivers.
#46
Hallo!
Ich hab hier ein Problem mit der 3D Programmierung...
Mein Original Bildschirm ist 640x480 Pixel groß.
Das Stück was ich verwende aber nur 383x464 die schon bei 32x16 starten.
Wenn ich etwas in 3D zeichne (Korridor z.B.), ist die Mitte demnach verschoben, egal wie oft ich es versuche ich krieg es einfach nicht perfekt hin (So dass die Mitte im 383x464 Kästchen genau passt).

Kann mir wer helfen? :/
#47
Hab mal eine kurze Frage...

Wird die Rotation bei der Kollision mit eingerechnet oder nicht? :P

Apropos, bin jetzt endlich stolzer Besitzer von GLBasic :P
GLBasic ist defintiv die richtige Programmiersprache für mich.
Und ein dank an Gernot für das adden von Fileposition.
#48
Hab ein Problem mit meinem Editor, obwohl die Executable im selben Ordner ist (Macintosh), sagt mir mein Error Log, das er sie nicht finden kann :/

Muss sie in einen speziellen Ordner?

Wers nicht versteht; dem kann ichs nochmal genauer erklären b.z.w. den sourcecode posten :P
#49
GLBasic - de / Fehler?
2008-Apr-01
Hi, hab heute ne Fehlermeldung gekriegt:

Code (glbasic) Select
compiling:
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::Draw_Stage()':
G:\DOKUME~1\SPFD42~1.GAR\LOKALE~1\Temp\glbasic\gpc_temp0.cpp:113: error: no match for 'operator=' in '__GLBASIC__::sfxx = __GLBASIC__::RND(6.4e+2)'
D:/Project/Languages/GLBasic/Compiler/platform/Include/glb.h:275: note: candidates are: __GLBASIC__::DGIntArray& __GLBASIC__::DGIntArray::operator=(const __GLBASIC__::DGIntArray&)
*** FATAL ERROR - Bitte die Compiler-Ausgabe ins Forum kopieren
Durch diesen Code:

Code (glbasic) Select
IF Stage = 1
IF StageInit = TRUE
FOR count = 0 TO 63
IF sfxon[count] = 1
IF sfxy[count] >= 496
sfxon[count] = 0
ENDIF
IF sfxtype[count] = 2
INC sfxy[count], 1
ENDIF
IF sfxtype[count] = 1
INC sfxy[count], 2
ENDIF
IF sfxtype[count] = 0
INC sfxy[count], 3
ENDIF
DRAWANIM 2, sfxtype[count], sfxx[count], sfxy[count]
ELSE
sfxx = RND(640)
sfxy[count] = -16
sfxon[count] = 1
IF count <= 9
sfxtype[count] = 0
ENDIF
IF count <= 24
sfxtype[count] = 1
ENDIF
IF count >= 25
sfxtype[count] = 2
ENDIF
DRAWANIM 2, sfxtype[count], sfxx[count], sfxy[count]
ENDIF
NEXT
ELSE
FOR count = 0 TO 63
sfxx[count] = RND(640)
sfxy[count] = RND(480)
sfxon[count] = 1
IF count <= 9
sfxtype[count] = 0
ENDIF
IF count <= 24
sfxtype[count] = 1
ENDIF
IF count >= 25
sfxtype[count] = 2
ENDIF
DRAWANIM 2, sfxtype[count], sfxx[count], sfxy[count]
StageInit = TRUE
NEXT
ENDIF
ENDIF

RETURN

ENDSUB
Wahrscheinlich war ich nur malwieder zu doof :)
Ich hoffe ihr könnt mir helfen.
#50
Ok, I'm a bit annoyed, since I've searched for more than 2 hours now. If I'm wrong I'm really sorry.
I'm really disappointed that you can't delete projects, I mean how can you forget such a command? :(
#51
Die bmp's die ich laden will (muss), haben keine bmp Extension sondern eine pbm Extension. Und sie haben eine Signatur am ende. Gibt es eine Möglichkeit (Ausser sie manuell einzulesen und neu zu speichern) sie trozdem zu lesen? Ich weiß übrigens nicht ob es an der Signatur oder an der Extension liegt, vielleicht auch an beidem :P

b.z.w. Gibt es eine Chance dass es dafür Änderungen/Möglichkeiten, in einer neuen Version von GLBasic gibt? ;)
Vielleicht, das sie von vorne gelesen werden und defekte Daten/die Signatur am Ende ignoriert werden und am Header anstatt der Extension erkannt werden.
Wäre sehr dankbar. :)

Edit: Hab grade geguckt, es wird wohl am Header erkannt, weil es an der Extension nicht liegt, sondern an der Signatur ;)
#52
If I execute the following code, my program hangs up for whatever reason:

Code (glbasic) Select
LET Config
LET ConfigSaved
LET file$

Config = DOESFILEEXIST("Config.dat")
IF Config
ConfigSaved = TRUE
OPENFILE(1, "Config.dat", TRUE)
READLINE 1, file$
CLOSEFILE 1
GOTO Open
ELSE
ConfigSaved = FALSE
PRINT "Please type exectuable name:", 16, 16
INPUT file$, 16, 32
GOTO Open
ENDIF
#53
Wenn ich den folgenden Code ausführe, hängt sich mein Programm beim laden auf, warum auch immer:

Code (glbasic) Select
LET Config
LET ConfigSaved
LET file$

Config = DOESFILEEXIST("Config.dat")
IF Config
ConfigSaved = TRUE
OPENFILE(1, "Config.dat", TRUE)
READLINE 1, file$
CLOSEFILE 1
GOTO Open
ELSE
ConfigSaved = FALSE
PRINT "Please type exectuable name:", 16, 16
INPUT file$, 16, 32
GOTO Open
ENDIF
#54
Is there a way to jump to a file position?
I really need it in order to make an editor for a game.
If there is no possibility I hope there will be a command for this in the next version.
#55
Gibt es eine möglichkeit an eine bestimmte Position in einer Datei zu springen?
Wenn nicht, hoffe ich dass es eventuell in einer neuen Version vorkommt >_<

Brauche das ganz dringend für einen Editor.
#56
Bug Reports / IF und Array
2008-Mar-26
Arrays funktionieren nicht mit IF :/
Ich brauch das ganz dringend für mein Spiel >_<

Das heißt:

Code (glbasic) Select
FOR x = 0 TO 20
        IF i[x] = 1
                i[x] = 0
        ENDIF
NEXT
würde nicht funktionieren. Das programm crasht sogar.

Vielleicht bin ich auch einfach nur zu doof. ;)

Edit: Der macht das auch nicht wenn ich diesen code ausführe:

Code (glbasic) Select
FOR x = 0 TO 20
        i[x] = 0
NEXT
Ein wenig seltsam.
#57
Mein Problem ist, dass ich nur ein Bild reinladen will und es für mehrere Sprites benutzen will, aber was ist wenn die Sprites über den Bildschirm hinaus gehen? Werden sie dann einfach nicht gezeichnet? Natürlich habe ich eine Abfrage drin, aber bei den Sprachen die ich bis jetzt hatte, mussten sie gelöscht werden.

Gilt für Variablen und Dateien das gleiche? Muss man Variablen zum Schluss löschen, damit das Ram freigeben und Dateien schließen?

Ich weiß die Fragen sind vielleicht ein wenig dumm, aber es sind die einzigen die ich im moment habe, ansonsten ist alles klar :P
#58
GLBasic - de / Vorstellung
2008-Mar-26
Hi!

Ich bin mir nicht sicher, ob das hier normal ist, aber dachte einfach ich stelle mich hier mal vor.
Ich habe lange gesucht bis ich endlich eine Programmiersprache gefunden hatte, die meinen Anforderungen gerecht wurde. Und nun hoffe ich dass meine Suche ein Ende hat.
Ich werde GLBasic höchstwahrscheinlich bald kaufen, solange muss ich wohl die Demo benutzen.
Ich hoffe das ich hier spass habe und Leuten helfen kann, ebenso aber Hilfe bekomme. :P

Ihr könnt euch darauf verlassen, dass ich jeweils in beiden Sections, der deutschen und der englischen posten werde.

Grüße,
S. P. Gardebiter
#59
Off Topic / Introduce
2008-Mar-26
Hi there!

I'm not sure if this is something regular, I hope so though.
Long I've searched for a programming language which fits me, I hope my search has now came to an end.
Yeh, as you might guess, I'm going to buy GLBasic.
I hope to have a happy time here, to get some help and in return help other members too :P

Cheers,
S. P. Gardebiter

Edit: b.t.w. You can be sure that I will post both, in the german and in the english section.