Qbasicnews.com
January 27, 2022, 01:54:53 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Poll
Question: Should I include Qbasic Cameos?  (Voting closed: January 12, 2003, 10:37:44 PM)
Yes - 9 (100%)
Total Voters: 10

Pages: 1 ... 6 7 [8] 9 10 ... 13
  Print  
Author Topic: Cobra  (Read 99340 times)
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #105 on: December 26, 2002, 10:59:31 PM »

Yeah, the best thing is to build up your own lib peeking here and there.

About PQB alternatives, QMIDI 4.1 and DMAPlay work good together and give a good sound engine, if MIDI music and 1 channel digital sound are enough for you Tongue
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
toonski84
__/--\__
*****
Posts: 2567



« Reply #106 on: December 26, 2002, 11:35:35 PM »

i always thought qmidi was a qlb... hmm..  then i wonder why i didnt use it before... *shrugs*.   i hear the subshock team, whenever they are rescued from their cryogenic status are producing a pure qb mod player suitable for games.  that oughta be interesting... and hey, remember mk jamz?
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #107 on: December 26, 2002, 11:54:52 PM »

Nope, What's that?

About Qmidi... Yeah, you have seen the QLB version, but Jesse Dorland made that one in pure QB first, then someone compiled it into a QLB. I think you can find it in the alypha URL I gave before in this same thread.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
toonski84
__/--\__
*****
Posts: 2567



« Reply #108 on: December 27, 2002, 10:58:49 AM »

*nods*  i would prefer some of the bigger libs (ds4qb, bwswb[sp?]) if  you could compartmentalize them.
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #109 on: December 27, 2002, 03:18:08 PM »

My problem with DS4QB is the huge lag (I have a slow compter) and that it takes so many resources. I have to stick with DOS lil'libs.

Anyhow, I never got BWSB to work... Can you give me some help?
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
toonski84
__/--\__
*****
Posts: 2567



« Reply #110 on: December 27, 2002, 06:15:14 PM »

i wish i could help you.  the only sound i've ever used in my programs is mk jamz and that one-sub wave player.
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #111 on: December 27, 2002, 06:45:59 PM »

What's mk jamz? Maybe it fits in my outcoming simple ASCII game project.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
toonski84
__/--\__
*****
Posts: 2567



« Reply #112 on: December 27, 2002, 07:48:33 PM »

remember the old days of molnar/kalcutta?  they made a music program that used the fm synthesizer that could play in the background called mk jamz if you looped it at a decent rate.
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #113 on: December 27, 2002, 08:30:49 PM »

Aha, FM music. It is cool, I once made a crappy FM tracker... Maybe I'll upload it to our web (WOPR2K) when we finish it Tongue
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
toonski84
__/--\__
*****
Posts: 2567



« Reply #114 on: December 27, 2002, 09:10:32 PM »

yeah, and check out mk jamz, too.  i had a lot of fun with it when i was 12 Smiley
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #115 on: December 27, 2002, 09:14:50 PM »

Aren't they the ones that made "Ambush at South Range?"
Logged
toonski84
__/--\__
*****
Posts: 2567



« Reply #116 on: December 27, 2002, 09:16:48 PM »

yeah, they made a bunch of stupid games, like that and 'bob sagat killer'.  the music program was really the only thing from them that was ever really good.  i'm surprised you remember that proggy game, it was old and wasnt memorable in any way, shape or form...
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #117 on: December 27, 2002, 09:39:22 PM »

Heck, I LOVED Ambush at South Range 2.
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #118 on: December 28, 2002, 12:00:30 AM »

Wow man!! I made a google search and I got 1 entry. The link still works: http://www.fortunecity.de/lindenpark/heiner/541/program/sound/mkjams.zip

Better grab it disappears!!

And the ol'PQB VOC player is this one:

Code:
'
' DMA functions were written by Mike Huff
'
' VOC file has to be Mono, 8bit, any freq.
'
'  Another note: Some sound cards can't play .WAV's over 22050 with
'                these functions.
'
'
DECLARE SUB PlayFile (WavFileName$, WavFreq&)
DECLARE FUNCTION FileLength& (WavFileName$)
DECLARE FUNCTION DMADone% ()
DECLARE FUNCTION ResetDSP% ()
DECLARE SUB MasterVolume (Right%, Left%, Getvol%)
DECLARE SUB WriteDSP (byte%)
DECLARE FUNCTION ReadDSP% ()
DECLARE SUB SpeakerState (OnOff%)
DECLARE SUB DMAPlay (Segment&, Offset&, Length&, Freq&)
DECLARE FUNCTION GetBLASTER% (DMA%, BasePort%, IRQ%)
DECLARE FUNCTION DSPVersion! ()
'-----COMMONs-----
  COMMON SHARED PlaySndFlag%, WavFlag%
  COMMON SHARED BasePort%, LenPort%, Channel%, IRQ%, HaveBlast%, WavRep%, TheWavLen&
  COMMON SHARED TFWav() AS STRING * 32767
'-----End COMMONs-----
ON ERROR GOTO EHandler
CLS

 '$DYNAMIC
  DIM SHARED TFWav(1) AS STRING * 32767
   
'This detects the SB and does some other initializations:

    HaveBlast% = GetBLASTER(Channel%, BasePort%, IRQ%)' Parses BLASTER environment
      IF HaveBlast% THEN PlaySndFlag% = 1 ELSE PlaySndFlag% = 0
     ResetIt% = ResetDSP%
     SpeakerState 1 'turn the speaker on
     MasterVolume 15, 15, 0 'this cranks the master volume all the way up.

'End initialization stuff here

Freq& = 11025                    '<-- Type in the frequency here

FileName$ = "IAMONE.VOC"  ' <-- VOC / WAV file

PlayFile FileName$, Freq&

 DO
  COLOR INT(RND * 16)
  PRINT "Playing sound in background! Yeehaw!"
 LOOP UNTIL DMADone% <> 0

COLOR 15
PRINT "Finished!"
END


EHandler:
COLOR 15
Er% = ERR
PRINT "Something bad happened!"
PRINT "Error code: "; Er%
END
RESUME

REM $STATIC
FUNCTION DMADone%
Count% = INP(LenPort%)
Count2% = INP(LenPort%)
Count& = CLNG(Count% + 1) * CLNG(Count2% + 1)
IF (Count& - 1) >= &HFFFF& THEN junk% = INP(DSPDataAvail%): DMADone% = -1
END FUNCTION

SUB DMAPlay (Segment&, Offset&, Length&, Freq&)
' Transfers and plays the contents of the buffer.
IF PlaySndFlag% = 0 THEN EXIT SUB
Length& = Length& - 1
Page% = 0
MemLoc& = Segment& * 16 + Offset&
SELECT CASE Channel%
    CASE 0
       PgPort% = &H87
       AddPort% = &H0
       LenPort% = &H1
       ModeReg% = &H48
    CASE 1
       PgPort% = &H83
       AddPort% = &H2
       LenPort% = &H3
       ModeReg% = &H49
    CASE 2
       PgPort% = &H81
       AddPort% = &H4
       LenPort% = &H5
       ModeReg% = &H4A
    CASE 3
       PgPort% = &H82
       AddPort% = &H6
       LenPort% = &H7
       ModeReg% = &H4B
    CASE ELSE
       EXIT SUB
END SELECT

OUT &HA, &H4 + Channel%
OUT &HC, &H0
OUT &HB, ModeReg%
OUT AddPort%, MemLoc& AND &HFF
OUT AddPort%, (MemLoc& AND &HFFFF&) \ &H100
IF (MemLoc& AND 65536) THEN Page% = Page% + 1
IF (MemLoc& AND 131072) THEN Page% = Page% + 2
IF (MemLoc& AND 262144) THEN Page% = Page% + 4
IF (MemLoc& AND 524288) THEN Page% = Page% + 8
OUT PgPort%, Page%
OUT LenPort%, Length& AND &HFF
OUT LenPort%, (Length& AND &HFFFF&) \ &H100
OUT &HA, Channel%

IF Freq& < 23000 THEN
   TimeConst% = 256 - 1000000 \ Freq&
   WriteDSP &H40
   WriteDSP TimeConst%
   WriteDSP &H14
   WriteDSP (Length& AND &HFF)
   WriteDSP ((Length& AND &HFFFF&) \ &H100)
ELSE
   IF DSPVersion! >= 3 THEN
      TimeConst% = ((65536 - 256000000 \ Freq&) AND &HFFFF&) \ &H100
      WriteDSP &H40
      WriteDSP TimeConst%
      WriteDSP (Length& AND &HFF)
      WriteDSP ((Length& AND &HFFFF&) \ &H100)
      WriteDSP &H91
   ELSE
      PRINT "You need a Sound Blaster with a DSP v3.x+ to play at high speed."
      EXIT SUB
   END IF
END IF
END SUB

SUB DoSNDEvent (SNDNum%)
 SELECT CASE SNDNum%
  CASE 1
 END SELECT
END SUB

FUNCTION DSPVersion!
' Gets the DSP version.
WriteDSP &HE1
Temp% = ReadDSP%
Temp2% = ReadDSP%
DSPVersion! = VAL(STR$(Temp%) + "." + STR$(Temp2%))
END FUNCTION

FUNCTION FileLength& (WavFileName$)
 OPEN WavFileName$ FOR BINARY AS #1
  TotWavLength& = LOF(1) - 44
  ResWavLength& = TotWavLength& - (32767& * WavRep%) - 44
  IF ResWavLength& > 32767& THEN ResWavLength& = 32767&
 CLOSE #1
IF ResWavLength& = 0 THEN KILL ResWavFileName$
FileLength& = ResWavLength&
END FUNCTION

FUNCTION GetBLASTER% (DMA%, BasePort%, IRQ%)
' This subroutine parses the BLASTER environment string and returns settings.
IF LEN(ENVIRON$("BLASTER")) = 0 THEN GetBLASTER% = 0: EXIT FUNCTION
FOR Length% = 1 TO LEN(ENVIRON$("BLASTER"))
   SELECT CASE MID$(ENVIRON$("BLASTER"), Length%, 1)
      CASE "A"
        BasePort% = VAL("&H" + MID$(ENVIRON$("BLASTER"), Length% + 1, 3))
      CASE "I"
        IRQ% = VAL(MID$(ENVIRON$("BLASTER"), Length% + 1, 1))
      CASE "D"
        DMA% = VAL(MID$(ENVIRON$("BLASTER"), Length% + 1, 1))
   END SELECT
NEXT
GetBLASTER% = 1
END FUNCTION

SUB MakeWav

WavLen1& = FileLength("tfwav1.wav")
WavLen1& = WavLen1& + 44
 OPEN "tfwav1.wav" FOR BINARY AS #1
  GET #1, 0, TFWav(1) 'Get 32k from file (skip header on WAV)
 CLOSE #1
 OPEN "tfall.wav" FOR BINARY AS #1
  PUT #1, 0, TFWav(1)
 CLOSE #1

END SUB

SUB MasterVolume (Right%, Left%, Getvol%)
OUT BasePort% + 4, &H22
'PRINT BasePort%
IF Getvol% THEN
   Left% = INP(BasePort% + 5) \ 16
   Right% = INP(BasePort% + 5) AND &HF
   EXIT SUB
ELSE
   OUT BasePort% + 5, (Right% + Left% * 16) AND &HFF
END IF
END SUB

SUB PlayFile (WavFileName$, WavFreq&)
 WavRep% = 0
 WavFlag% = 1
 TheWavLen& = FileLength(WavFileName$)
 OPEN WavFileName$ FOR BINARY AS #1
  GET #1, 44, TFWav(1) 'Get 32k from file (skip header on WAV)
 CLOSE #1
 'TheWavLen& = TheWavLen& - 44
 DMAPlay VARSEG(TFWav(1)), VARPTR(TFWav(1)), TheWavLen&, WavFreq&
END SUB

FUNCTION ReadDSP%
' Reads a byte from the DSP
DO
LOOP UNTIL INP(BasePort% + 14) AND &H80
ReadDSP% = INP(BasePort% + 10)
END FUNCTION

FUNCTION ResetDSP%
' Resets the DSP
OUT BasePort% + 6, 1
FOR Count% = 1 TO 4
   junk% = INP(BasePort% + 6)
NEXT
OUT BasePort% + 6, 0
IF INP(BasePort% + 14) AND &H80 = &H80 AND INP(BasePort% + 10) = &HAA THEN
   ResetDSP% = -1
ELSE
   ResetDSP% = 0
END IF
END FUNCTION

SUB SpeakerState (OnOff%)
' Turns speaker on or off.
IF OnOff% THEN WriteDSP &HD1 ELSE WriteDSP &HD3
END SUB

SUB WriteDSP (byte%)
' Writes a byte to the DSP
DO
LOOP WHILE INP(BasePort% + 12) AND &H80
OUT BasePort% + 12, byte%
END SUB



Neat snippet Tongue I patched this to make it run better. With WAVs, it produces some noise at the end 'cause most wave editor append info in wav files. The best thing you can do is use the VOC format. You can download Cool Edit 96 here (shareware version) and register it (don't ask me how and read the text in the webpage I linked Wink ) to make the conversions.

CE96 is a good choice if you don't have any sound editing tool and you only need it to cut, trim and convert waves.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
toonski84
__/--\__
*****
Posts: 2567



« Reply #119 on: December 28, 2002, 01:21:47 AM »

yeah, in wormer i used somebody's wave player that was one sub and only played 11k mono wav files.  it's crappy, crappy quality but it was easy as heck.  but that's just me, i'll probably buy my wedding ring 3 days before the wedding and return it after so i dont have to pay anything.  i've used dmaplay before, though, and it's probably the best pure qb option for wave files.  anybody still have that code that stored wave files into ems and played them from memory?
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Pages: 1 ... 6 7 [8] 9 10 ... 13
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!