Page 2 of 2

Re: Raw Sound Creation Demo (cross-plattform)

Posted: Tue Apr 20, 2010 4:01 am
by GBeebe
One word: Sweet!

Linux users need to add:

Code: Select all

#WAVE_FORMAT_PCM = 1
because it's not defined.

Re: Raw Sound Creation Demo (cross-plattform)

Posted: Tue Apr 20, 2010 5:23 am
by WilliamL
I changed the song playing routine and it makes more sense now.

Unfortunately, on my Mac, I get an IMA error after the second tone on the 4th line at 'id = CatchSound(#PB_Any,*memory)' (line 224).

Re: Raw Sound Creation Demo (cross-plattform)

Posted: Tue Apr 20, 2010 8:43 am
by Joakim Christiansen
WilliamL wrote:Unfortunately, on my Mac, I get an IMA error after the second tone on the 4th line at 'id = CatchSound(#PB_Any,*memory)' (line 224).
Hmm, weird. It may be something silly I've done, I'll see if I can figure it out.

Re: Raw Sound Creation Demo (cross-plattform)

Posted: Tue Apr 20, 2010 5:34 pm
by WilliamL
@JC

It seems to have something to do with how many tones that are played. If I take out the first line of data the song plays that much farther past line 4 position 2. In other words, it only seems to play so many tones before the error (17).

Re: Raw Sound Creation Demo (cross-plattform)

Posted: Tue Apr 20, 2010 6:57 pm
by Joakim Christiansen
WilliamL wrote:@JC

It seems to have something to do with how many tones that are played. If I take out the first line of data the song plays that much farther past line 4 position 2. In other words, it only seems to play so many tones before the error (17).
Aha, well maybe this helps then:

Code: Select all

Procedure addTone(f,d)
  sound = catchToneEx(1000,100,f,d)
  PlaySound(sound):Delay(400)
  FreeSound(sound)
EndProcedure
There it frees up the sound it created when it is done playing it.

Re: Raw Sound Creation Demo (cross-plattform)

Posted: Tue Apr 20, 2010 7:17 pm
by WilliamL
Same error at same location and now I'm not so sure the number of tones played it the problem. If I rem out the first two lines of data the IMA appears just 2 notes later than before.

Note that I changed your code...

Code: Select all

;Have fun! ;-)

Procedure addTone(f,d)
    Protected sound
    sound = catchToneEx(1000,100,d,f)
    PlaySound(sound):Delay(d)
    FreeSound(sound)
EndProcedure

addTone(676,460):addTone(804,340):addTone(676,230):addTone(676,110):addTone(902,230):
addTone(676,230):addTone(602,230):addTone(676,460):addTone(1012,340):addTone(676,230):
addTone(676,110):addTone(1071,230):addTone(1012,230):addTone(804,230):addTone(676,230):
addTone(1012,230):addTone(1351,230):addTone(676,110):addTone(602,230):addTone(602,110):
addTone(506,230):addTone(758,230):addTone(676,460):addTone(676,460)