PortAudio for PB

Share your advanced PureBasic knowledge/code with the community.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

PortAudio for PB

Post by Trond »

I'm posting it here so more people see it. PortAudio is quite cool because it is suited to generate audio on the fly.

Updated link: http://turboupload.com/75g3c1u04u00
Dll only, recompiled with Vista/7 support: http://turboupload.com/xifpxhxs6zu9 (not sure if it works ok)
http://www.purebasic.fr/english/viewtopic.php?f=13&t=29175&start=15 wrote: I recompiled portaudio and uploaded it here:
http://www.rocketsoft.gm-school.uni.cc/uploads/dist.zip

freak's files (except portaudio dll and lib) are included to help you get started, I hope it's okay freak.

Also the file contains the reference doc for portaudio and a tutorial from the portaudio wiki.
Last edited by Trond on Mon Nov 07, 2011 11:00 am, edited 2 times in total.
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: PortAudio for PB

Post by Blue Steel »

what i'm after is a program that allows you to actually generate the sounds like you used to be able to to on older computers like the C64 .. where ytou don't need a darn .wav file or anything.. where you cxan generate say a sound from a iser definable wave form , frequence , pitch, duration , reverb , echo, volume ,attack , sustain , release etc...

and i've yet to find any language out there that 'll let you do that or any addons .. nothing.. nada.. i did find many years ago as program that could generate .wav files doing stuff like i'm after .. but not usable in a program. I DON'T want to PLAY any external file or resource .. I want to generate sound on the fly

is there anything out there like that...

PS: people really need to start naming Zip and distro files appropriatly .. not just setup or distro ..or demo .. start telling us by the name of the file what it is .. ie: PortAudio_for_PB.zip so that when we download it and get around to looking at it then we know what it is ..

Thanks
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
User avatar
idle
Always Here
Always Here
Posts: 5042
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: PortAudio for PB

Post by idle »

Thanks Trond, looks interesting

@blueSteel

Demivec posted a sound generator utility recently, though you could always do it your self.
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: PortAudio for PB

Post by Shardik »

Blue Steel,

have you already taken a look into flaith's retro sound generator? He used
his code example to generate the pacman and zelda sound:
http://purebasic.fr/english/viewtopic.php?t=36497
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: PortAudio for PB

Post by Blue Steel »

Thankls for that link.. looking into it now..

also i seaeched for "sound generator" and author "Demivec" and found nothing :(

but its starting to look more promising
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: PortAudio for PB

Post by Shardik »

User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: PortAudio for PB

Post by Blue Steel »

hmmm... ok.. its not actual music i want to re-create but those noise sound effects from on the C64.. eg: the clash , bang , thump, footstep , and alike

I really don't know where to start.. i've been searching for years ..

I want to be able to convert my old C64 programs to PureBasic without having to load up an emulator and record all the sound effects into wav files or what ever.. I know it can be done because they are doing it in the emulators
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: PortAudio for PB

Post by Blue Steel »

There are several source codes out there but i don't know anywhere near enough to convert or edit them to make like an addon (free of course) to any language .. via commands that will take the user input and pass it through the sound functions to convert it to a format windows can handle..

It shouldn't be all that hard to do really as some are written in C and some in java and some in C++ even one written in Pascal/Delphi just from doing a search around now

(BTW If a mod could please strip from my first pise in this thread into a new thread please.. I didn't / still don't want to hijack this one .. sorry)
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: PortAudio for PB

Post by Shardik »

Have you taken a look into this thread? It's utilizing the retro sound generation
library SpotFX:
http://www.purebasic.fr/english/viewtopic.php?t=30657
Blue Steel wrote:If a mod could please strip from my first pise in this thread into a new thread please..
+1
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: PortAudio for PB

Post by Trond »

Blue Steel wrote:what i'm after is a program that allows you to actually generate the sounds like you used to be able to to on older computers like the C64 .. where ytou don't need a darn .wav file or anything.. where you cxan generate say a sound from a iser definable wave form , frequence , pitch, duration , reverb , echo, volume ,attack , sustain , release etc...

and i've yet to find any language out there that 'll let you do that or any addons .. nothing.. nada.. i did find many years ago as program that could generate .wav files doing stuff like i'm after .. but not usable in a program. I DON'T want to PLAY any external file or resource .. I want to generate sound on the fly

is there anything out there like that...
This is supposed to be what you need. In the callback you specify the EXACT sample values to be sent to your soundcard. You don't need any wav files. Look at Tutorial.pb.
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: PortAudio for PB

Post by Blue Steel »

sorry i can't see "Tutorial.pb" in the archive anywhere :(
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: PortAudio for PB

Post by Trond »

Oups, I mean Sine.pb.
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: PortAudio for PB

Post by Demivec »

Blue Steel wrote:Thankls for that link.. looking into it now..

also i seaeched for "sound generator" and author "Demivec" and found nothing :(

but its starting to look more promising
Here's a link.
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: PortAudio for PB

Post by Blue Steel »

Found it thanks .. ;)
i've also found PJ's version and am looking into it too..

definatly looks like i've finaly located something i've been looking for for 20+ years.

I'll delve into your source code and studdy it.. and hopefully bew able to make it so that i can get it to take in the ADSR etc. values direct from my old C64 stuff (there seems to be a lot more settings in this than in those days)

Thanks one and all for your help

now to get PJ's one working i need tyo sort out the missing misc2 library :(
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
User avatar
Blue Steel
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Aug 31, 2005 4:49 pm
Contact:

Re: PortAudio for PB

Post by Blue Steel »

ok using purebasic 4.41 how / where do i get the misc2 library (and any other libraries i may need)
Currently using PureBasic 4.51(x86)

Image http://www.codingmonkeys.com
Covers many languages including PureBasic
Post Reply