QBSound Updated For 0.15 (PLAY, SOUND and BEEP Tool)

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
maddogg6
Posts: 824
Joined: Dec 07, 2005 22:58
Contact:

Post by maddogg6 »

Hmm - it seems midiox isnt report correctly for the sample you made either.

Heres what midiox got while the sample (qsound.bas) ran.

Code: Select all

 TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT               
 003E3C9F  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E3C9F  13   1     B4    40    00    5  ---  CC: Pedal (Sustain)   
 003E3C9F  13   1     B5    40    00    6  ---  CC: Pedal (Sustain)   
 003E3CA0  13   1     B8    40    00    9  ---  CC: Pedal (Sustain)   
 003E3CA0  13   1     BB    40    00   12  ---  CC: Pedal (Sustain)   
 003E74D6  13   1     B6    40    00    7  ---  CC: Pedal (Sustain)   
 003E74D6  13   1     B7    40    00    8  ---  CC: Pedal (Sustain)   
 003E74D6  13   1     B8    40    00    9  ---  CC: Pedal (Sustain)   
 003E74D6  13   1     BB    40    00   12  ---  CC: Pedal (Sustain)   
 003E7DBA  13   1     B1    40    00    2  ---  CC: Pedal (Sustain)   
 003E7DBA  13   1     B2    40    00    3  ---  CC: Pedal (Sustain)   
 003E7DBA  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E7DBB  13   1     BC    40    00   13  ---  CC: Pedal (Sustain)   
 003E913E  13   1     B1    40    00    2  ---  CC: Pedal (Sustain)   
 003E920C  13   1     B2    40    00    3  ---  CC: Pedal (Sustain)   
 003E920C  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E920C  13   1     B4    40    00    5  ---  CC: Pedal (Sustain)   
 003E92DA  13   1     B6    40    00    7  ---  CC: Pedal (Sustain)   
 003E92DA  13   1     B7    40    00    8  ---  CC: Pedal (Sustain)   
 003E92DB  13   1     BC    40    00   13  ---  CC: Pedal (Sustain)   
 003E93A9  13   1     B2    40    00    3  ---  CC: Pedal (Sustain)   
 003E93A9  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E93A9  13   1     B4    40    00    5  ---  CC: Pedal (Sustain)   
 003E93AA  13   1     B8    40    00    9  ---  CC: Pedal (Sustain)   
 003E93AA  13   1     BA    40    00   11  ---  CC: Pedal (Sustain)   
 003E93AA  13   1     BB    40    00   12  ---  CC: Pedal (Sustain)   
 003E93AB  13   1     BF    40    00   16  ---  CC: Pedal (Sustain)   
 003E9478  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E9478  13   1     B4    40    00    5  ---  CC: Pedal (Sustain)   
 003E9478  13   1     B5    40    00    6  ---  CC: Pedal (Sustain)   
 003E9479  13   1     B6    40    00    7  ---  CC: Pedal (Sustain)   
 003E9479  13   1     B7    40    00    8  ---  CC: Pedal (Sustain)   
 003E9479  13   1     B8    40    00    9  ---  CC: Pedal (Sustain)   
 003E9479  13   1     B9    40    00   10  ---  CC: Pedal (Sustain)   
 003E9479  13   1     BB    40    00   12  ---  CC: Pedal (Sustain)   
 003E9479  13   1     BC    40    00   13  ---  CC: Pedal (Sustain)   
 003E9547  13   1     B2    40    00    3  ---  CC: Pedal (Sustain)   
 003E9548  13   1     B9    40    00   10  ---  CC: Pedal (Sustain)   
 003E9615  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E9615  13   1     B4    40    00    5  ---  CC: Pedal (Sustain)   
 003E9615  13   1     B5    40    00    6  ---  CC: Pedal (Sustain)   
 003E9616  13   1     B8    40    00    9  ---  CC: Pedal (Sustain)   
 003E9616  13   1     BD    40    00   14  ---  CC: Pedal (Sustain)   
 003E96E4  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E96E5  13   1     B6    40    00    7  ---  CC: Pedal (Sustain)   
 003E96E5  13   1     BA    40    00   11  ---  CC: Pedal (Sustain)   
 003E96E5  13   1     BD    40    00   14  ---  CC: Pedal (Sustain)   
 003E97B4  13   1     B3    40    00    4  ---  CC: Pedal (Sustain)   
 003E9951  13   1     B6    40    00    7  ---  CC: Pedal (Sustain)   
 003E9951  13   1     B7    40    00    8  ---  CC: Pedal (Sustain)   
 003E9951  13   1     B8    40    00    9  ---  CC: Pedal (Sustain)   
 003E9951  13   1     B9    40    00   10  ---  CC: Pedal (Sustain)   
 003E9951  13   1     BD    40    00   14  ---  CC: Pedal (Sustain)   
 003EAFD1  13   1     B5    40    00    6  ---  CC: Pedal (Sustain)   
 003EAFD1  13   1     B6    40    00    7  ---  CC: Pedal (Sustain)   
 003EAFD1  13   1     B7    40    00    8  ---  CC: Pedal (Sustain)   
 003EAFD2  13   1     BB    40    00   12  ---  CC: Pedal (Sustain)   
 003EAFD2  13   1     BE    40    00   15  ---  CC: Pedal (Sustain)   
 003EAFD2  13   1     BF    40    00   16  ---  CC: Pedal (Sustain)   
maddogg6
Posts: 824
Joined: Dec 07, 2005 22:58
Contact:

Post by maddogg6 »

Addition:
other stuff I monitor with midiox seems ok..??
Keeling
Posts: 148
Joined: May 27, 2005 15:03
Location: USA
Contact:

Post by Keeling »

This was put together from several sources... Windows API documentation, VB examples, and some VC++ 6 examples. What I use, setting channels, instruments and notes work perfectly. As to the rest of it, I can't say.

There isn't a lot of great MIDI work out there. Pete's QB Express mag has a bit in there this month about MIDI, it might be worth a look and maybe an email to the writer.

http://www.petesqbsite.com/sections/exp ... index.html
maddogg6
Posts: 824
Joined: Dec 07, 2005 22:58
Contact:

Post by maddogg6 »

Thanks for that link - and I did go over it.. and its WAY more than what Im looking to do, like Im not reading a midi file - which is the main focus of that article.

I did send the writer an email for some pointer on the basic necessities for simply sending a midi message to a port of my choice.

Seems to be what I find - is more complex that what Im trying to do.

Thanks again,

Mark
vspickelen
Posts: 38
Joined: Jul 28, 2005 14:06
Location: holland
Contact:

Post by vspickelen »

This program makes minimal midi winapi calls (plain hex to "midiOutClose", "midiOutOpen" and "midiOutShortMsg" only), but produces maximum noise.


Just the barebones:

Code: Select all

'subject: midi strings a-minor chord
'author : vspickelen
'code   : freebasic 0.16b win
DEFINT A-Z
#INCLIB "winmm"

'winapi prototypes
DECLARE FUNCTION midClose Alias "midiOutClose" (ByVal hMidiOut)
DECLARE FUNCTION midiOpen Alias "midiOutOpen" (ByRef lphMidiOut, ByVal uDeviceID, ByVal dwCallback, ByVal dwInstance, ByVal dwFlags)
DECLARE FUNCTION midiMsg Alias "midiOutShortMsg" (ByVal hMidiOut, ByVal dwMsg)

DIM msg(3), hnd '           pointer

'open default midi out device
if not midiOpen(hnd, -1, 0, 0, 0) then

   for k = 0 to 11
      t = k and 3
      read msg(t)
      midiMsg hnd, msg(t) ' notes on
   next k
   sleep 3000

   for t = 3 to 0 step -1
      msg(t) and= not 16
      midiMsg hnd, msg(t) ' notes off
      sleep 333
   next t

   print "key..."
   sleep
   midClose hnd '           close midi
end if
end

'string patches
data &H002AC0,&H0029C1,&H0028C2,&H0028C3
'channel pan
data &H300AB0,&H500AB1,&H600AB2,&H200AB3
'notes A,e,a,c'
data &H552D90,&H403491,&H5A3992,&H553C93
regards,
vspickelen
maddogg6
Posts: 824
Joined: Dec 07, 2005 22:58
Contact:

Post by maddogg6 »

vspickelen wrote:This program makes minimal midi winapi calls (plain hex to "midiOutClose", "midiOutOpen" and "midiOutShortMsg" only), but produces maximum noise.
Yes - this is more something my 'speed' - as I understand the example.. Thank you soo much.

WooHoo!

edit:
And I see I can choose the PORTID I send these messages to:
in the midiOpen function - the '-1' is selecting midiMapper - but if you know the device ID of the port you wish to send to... finding this out is maybe a pain but definitly do-able.

Thanks again every one for all the help/input.

Mark.
maddogg6
Posts: 824
Joined: Dec 07, 2005 22:58
Contact:

Post by maddogg6 »

for those Win32 users wanting to use a different DEVICEID for selecting other than the default midi port - look here.
http://www.freebasic.net/forum/viewtopic.php?t=3731
yevrowl
Posts: 19
Joined: Aug 12, 2022 21:37
Location: Kiev
Contact:

Re: QBSound Updated For 0.15 (PLAY, SOUND and BEEP Tool)

Post by yevrowl »

Keeling wrote: Dec 05, 2005 3:12The code can be found here: QBSound_04_Dec_05.zip
Unfortunately, the archive can no longer be downloaded from the link.
angros47
Posts: 2421
Joined: Jun 21, 2005 19:04

Re: QBSound Updated For 0.15 (PLAY, SOUND and BEEP Tool)

Post by angros47 »

Well, did you notice that the link was from 20 years ago?

I doubt the code would work anyway on recent compiler and operating system.

If it can help, I published my own sound library:

https://sourceforge.net/projects/freeba ... ary/files/

Update: I found the version of July 2005 on my hard drive. I don't have the most recent version. Funny thing... at the time I copied the PLAY parser, and used it in some codes of mine, and I think the parser used in my own library it's partially based on it.
Post Reply