QB, PLAY statement and library

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
N3trunn3r
Posts: 110
Joined: Feb 14, 2008 15:48

Re: QB, PLAY statement and library

Post by N3trunn3r »

Thanks angros, that sounds like a good solution. I'll try some experimentation.

Just tried to compile ExtLibsfx under DOS, but get this error:
I use DosBox-X to compile because it supports long filenames.
Image
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: QB, PLAY statement and library

Post by angros47 »

@Coolman
The mit license would have allowed anyone to make small changes and then release the library as proprietary software. The lgpl prevents that

@N3trunn3r
The errors you got in dos make me think you compiled the library without some modules. How did you compile it?
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: QB, PLAY statement and library

Post by Coolman »

I understand your argument but if there is a version of a library with the mit license, who will be interested or buy an equivalent one with a proprietary license. Those who steal the code of others without giving them any credit will have a very bad reputation and will be banned from the community and probably from the job market.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: QB, PLAY statement and library

Post by angros47 »

Also, why would a mit license be better? I remind you that both the freebasic runtime and the graphic libraries are under LGPL already, so anyone who had issues with those licenses would not use FreeBasic not the sfx library anyway
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: QB, PLAY statement and library

Post by Coolman »

it's simple. the mit license is in my opinion the best because it doesn't impose any limit on the distribution of programs. it's total freedom to share codes and skills.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: QB, PLAY statement and library

Post by angros47 »

As you said, "in your opinion" ;-)

What would you want to be able to do, with that library, that the lgpl license prevent you from doing, while the mit license would allow it?
hhr
Posts: 206
Joined: Nov 29, 2019 10:41

Re: QB, PLAY statement and library

Post by hhr »

Great stuff, thank you very much, angros47.

Code: Select all

#include "sfx.bi"
#inclib "fbsfx"

Dim As Single f=440

SoundSet (44100,1,16)

Do
   Print "SineWave"
   SOUND SineWave(f),1.5
   If Getkey=27 Then Exit Do ' Any key to continue, ESC to end.
   
   Print "HarmonicWave"
   SOUND HarmonicWave(f,1,0,0.3,0,0.8),1.5
   If Getkey=27 Then Exit Do
   
   Print "TriangleWave"
   SOUND TriangleWave(f),1.5
   If Getkey=27 Then Exit Do
   
   Print "SawToothWave"
   SOUND SawToothWave(f),1.5
   If Getkey=27 Then Exit Do
   
   Print "PulseWave"
   SOUND PulseWave(f),1.5
   If Getkey=27 Then Exit Do
   
   Print "PulseWave"
   SOUND PulseWave(f,0.1),1.5
   If Getkey=27 Then Exit Do
   
   Print "PulseWave"
   SOUND PulseWave(f,TriangleWave(0.01)),10
   If Getkey=27 Then Exit Do
   
   Print "SyncWave"
   SOUND SyncWave(TriangleWave(f),f/2),1.5
   If Getkey=27 Then Exit Do
   
   Print "FrequencyModulate"
   SOUND FrequencyModulate(TriangleWave(f),SineWave(0.1), 0,0),7
   If Getkey=27 Then Exit Do
   
   Print "DSPFilter"
   SOUND DSPFilter(SawToothWave(f),10000,SineWave(1),1,0.7),1.5
   If Getkey=27 Then Exit Do
   
   Print "ADSREnvelope"
   SOUND ADSREnvelope(HarmonicWave(f/2,1,0,0.7,0,0.2),0.01,0,1,0.99,0.5),0.5
   SOUND ADSREnvelope(HarmonicWave(2*f,1,0,0.7,0,0.2),0.01,0,1,0.99,0.5),0.5
   SOUND ADSREnvelope(HarmonicWave(f,1,0,0.7,0,0.2),0.01,0,1,0.99,0.5),0.5
   If Getkey=27 Then Exit Do
   
   Print "NoiseWave"
   SOUND NoiseWave(),1.5
   If Getkey=27 Then Exit Do
   
   Print "================="
Loop
Edit:
f (frequency) as Single, see SoundFunction.bas.
Last edited by hhr on Jul 22, 2022 6:05, edited 1 time in total.
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: QB, PLAY statement and library

Post by angros47 »

I am glad you find it useful
Post Reply