Page 1 of 1

Posted: Wed Jan 30, 2002 1:55 pm
by BackupUser
Restored from previous forum. Originally posted by willinyork.

Hi!

By now probably half the people who look on these forums know that I have been programming a simple audio loop sequencer with PB. It's coming along very nicely, but my programming skills are not too good and there are a couple of features I want to add to my program but do not know how to. I have been told that I can do it with Windows API, but even after researching it, it is still beyond my knowledge. Basically, is there a more experienced coder who could help me with this? Of course, you would be fully credited for your work and you'd get your link in the program and guide, and (as I am hoping to sell this as shareware when it is finished - about $8 or so, I think) I would pay you for your work (maybe $10-$20 or the equivalent in whichever currency you want). Of course, if the program is a success and sells loads, then I would obviously give a bonus to you :) What I want to do, is to be able to output a loop to a single wav file (combine the 8 wav files in the right sequence to create a new . Also, I am hoping to create a very basic "synthesiser" section - I studied Music Technology at college so I know how sounds etc work, but I cannot create/generate a wav file from PB (no idea how to do it!). If there is anyone who would be interested in helping with this, please let me know!

Thanks :)

Will Morton (registered PB user)
PS: D/l the current version of my sequencer at http://www.download.com - search for QLB Loop Sequencer

Posted: Wed Jan 30, 2002 4:25 pm
by BackupUser
Restored from previous forum. Originally posted by Rings.
all I want is a simple program to record from the
auxiliary input on my sound card so I can save some
of my very old and decaying cassette tapes to CD..... -jb
below is a VB-Example.it uses onlx the winmm.dll:

Option Explicit
'autor :pramod kumar ([url]mailto:tkpramodkumar@yahoo.com">tkpramodkumar@yahoo.com)
'after a lot of searching for recording sound and save to wav file
'I found two samples in net
'one is Sabu's example to record sound and play
'second is Damjan's save CD trcks to WAV
'it is combination of this two samples
'Thanx to Sabu's "" Then
If Dir(txtFileName) "" Then
Kill (txtFileName)
End If
cmdStop.Enabled = True
Call RecordSound(txtFileName)
End If
End Sub

Private Sub cmdStop_Click()
If cmdRecord.Enabled = False Then
RecdTime = False
End If
cmdRecord.Enabled = True
cmdStop.Enabled = False
End Sub

Private Sub Command1_Click()
cdg1.ShowSave
txtFileName.Text = cdg1.FileName
End Sub

Private Sub Form_Load()
cmdStop.Enabled = False

optFreq(0).Caption = "44,100 kHz, 16 Bit, Stereo"
optFreq(1).Caption = "44,100 kHz, 8 Bit, Stereo"
optFreq(2).Caption = "48,000 kHz, 16 Bit, Stereo"
optFreq(3).Caption = "48,000 kHz, 8 Bit, Stereo"

sBits = "16"
sBytes = "172000"
sSample = "44100"

optFreq(0).Value = True

End Sub

Private Sub optFreq_Click(Index As Integer)
Select Case Index
Case 0
sBits = "16"
sSample = "44100"

Case 1
sBits = "8"
sSample = "44100"

Case 2
sBits = "16"
sSample = "48000"

Case 3
sBits = "8"
sSample = "48000"

End Select
End Sub


Getting better with a little help from my friends....thx Siggi

Posted: Wed Jan 30, 2002 6:10 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.

And of course you can find a rough translation of this on the PB Resources Site :)

http://www.reelmediaproductions.com/pb

What I couldn't figure out is that the WAV file that is created won't play from my Windows Media Player but loads and plays fine from SoundForge.

The bitrate is set to 172000 but I think it should be 176400.
If I use the higher setting it craps out and ends up recording a 22kHz mono wav file. Maybe someone knows the solution to this??

Posted: Wed Jan 30, 2002 7:10 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

willinyork:
>I studied Music Technology at college so I know how sounds etc work,
>but I cannot create/generate a wav file from PB
>(no idea how to do it!)

look at the FileFormats page for the
.WAV file description:
http://www.wotsit.org/

.WAV should be very easy to create.

cya,
...Danilo

(registered PureBasic user)

Posted: Wed Jan 30, 2002 10:20 pm
by BackupUser
Restored from previous forum. Originally posted by willinyork.

Hi Paul! Your PB conversion of that code is great :) I am sure that I could modify it a little to create a pseudo-wav-output on my sequencer. However, I am having similar problems to you! Any file I record using the code generates a wav 11,025 Hz, 8 Bit, Mono! And that's with the bitrate at 172000. Changing it to 176400 makes no difference it seems. Does anyone have any ideas? Thanks!

Posted: Wed Jan 30, 2002 10:26 pm
by BackupUser
Restored from previous forum. Originally posted by willinyork.

Also, I forgot to say - I CAN play the generated wavs through win media player, BUT I can't actually delete the files unless I rest - it says the files are in use (even thou PB, mediaplayer, etc etc is closed down). Any ideas?! :)

Posted: Wed Jan 30, 2002 10:57 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.

There is a typo in my Close command...
The snippet has:
"close recound"

should be...
"close recsound"

I will fix this and repost it :)

Posted: Wed Jan 30, 2002 11:32 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.

I didn't have time to do anything fancy but you could set a maximum record length (like reclength.l=1800) and then put a button gadget on the form and check for it to be pressed after the delay.

If pressed then have elasped=reclength*1000
This will take you out of the record loop and stop recording.

Posted: Thu Jan 31, 2002 12:07 am
by BackupUser
Restored from previous forum. Originally posted by willinyork.

ARGH! Still can't figure why it's recording mono 8 bit 11.025kHz samples! Other than that, this code is absolutely ace! Can anyone shed any light on this? Pleeeeeeease? Cheers!

Posted: Thu Jan 31, 2002 9:47 pm
by BackupUser
Restored from previous forum. Originally posted by willinyork.

Anyone got any idea at all - AT ALL - why I can't get anything other than a mono 8bit 11025Hz sample form the above code? Anyone?! I've tried changing the bitrate, but to no avail. I'm using PB2.82, win98, and an SBLive soundcard.

Posted: Sat Feb 02, 2002 8:04 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.

Thanks to more info supplied by Willy, I have updated the "recordwav" snippet on the Resources site. It seems to work fine on my system anyway :)

Posted: Sun Feb 03, 2002 7:04 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.

@willinyork:
http://www.un4seen.com/music/music_bass.html

Look at this. What do you think ??
(You are a sound expert)

cya,
...Danilo

(registered PureBasic user)

Posted: Sun Feb 03, 2002 9:23 pm
by BackupUser
Restored from previous forum. Originally posted by willinyork.

I haven't played around with any of that software yet, but if it does what it says on the site... then it's excellent indeed! Especially at the freeware price :)