WRITE...

Previous topic - Next topic

S. P. Gardebiter

Quote from: Hemlos on 2008-Oct-16
Any luck yet  S. P. Gardebiter
Did you figgure out if its a bug with glbasic using the debugger?

Did you try using gernots latest suggestion using samples%[]?

Im interested to see this work.

BTW if you do get it to work, may i suggest making a midi format sound generator?
Theres alot of sound features like, music instruments, ocean waves, and gunshots, helicopters etc etc etc Its all built into the midi drivers already, i think all you need to do is the same thing youre trying here with the wav, building with "write"...
...im working on such a midi program, however, my way requires me to parse data into a 3rd party program to create the file, using a text formated input. I dont like it this way using a second program, but I dont really understand the way write works.

The difference here is that mine is a synthesizer and therefor a sampler.
My code is a bit hard to explain, even I don't know sometimes what I'm doing exactly, it works at the end though it's buggy. If you want to know details it may be easier to contact me via IM or IRC.

Please take a look at this thread: http://www.glbasic.com/forum/index.php?topic=2403.0
~ Cave Story rules! ~

S. P. Gardebiter

Quote from: Hemlos on 2008-Oct-18
Quote from: peterpan on October 18, 2008, 4:24:39 PMHi Hemlos,

your name is S.P.Gardebiter ?
I thought  that i have found, why that byte  will not stored.
That's all.  What did i do wrong here ? Can you say it to me ?

Peter


No.
Ill show you.
Yes.
Code (glbasic) Select
FOR CountX = 0 TO 33
         FOR CountY = 0 TO Length[CountX][0] * 44100 / 10
            INC Count, 1
            FMS[0] = (SIN(360/SampleRate*Count*Note[Frequency[CountX]+FMFrequency[0]]+FMShift[0])*Volume[CountX]*FMVolume[0])
            FMS[1] = (SIN(360/SampleRate*Count*Note[Frequency[CountX]+FMFrequency[1]]+FMShift[1])*Volume[CountX]*FMVolume[1])
            FMS[2] = SIN(360/SampleRate*Count*Note[Frequency[CountX]+FMFrequency[2]]+FMShift[2])
            IF FMS[2] >= 0
               FMS[2] = (1*Volume[CountX]*FMVolume[2])
            ELSE
               FMS[2] = (0*Volume[CountX]*FMVolume[2])
            ENDIF
            Samples[Count][1] = (FMS[0]+FMS[1]+FMS[2])/3
            Samples[Count][0] = Samples[Count][1]
         NEXT


Yes, this is why the fms[2]=,sin wont calculate...you wrote the IF above the same thing as this:

Code (glbasic) Select
if FMS[2] < 0
FMS[2] = 0
else
FMS[2] = Volume[CountX]*FMVolume[2]
endif

it removes negative numbers, also and the SIN before it; will not be calculated/read.

FMS[2] isn't a sin wave, it's a square wave.
~ Cave Story rules! ~

Vampire

Quote from: Kitty Hello on 2008-Oct-14
Im IRC Chat "? betasdk" eingeben.

hallo zusammen :)

das habe ich grad versucht, funzt nicht.
bin mit opera da drin, könnte es daran liegen?
würde die beta sehr gern mal sehen...