Bass23

Blitz3D Forums/Blitz3D Userlibs/Bass23

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi, I`m having a problem using BASS with some MIDI files, and I`m stumped.

I can load the MIDI, play it fine, and display the length in both bytes and seconds using BASS_ChannelGetLength() and BASS_ChannelBytes2Seconds() respectively - just to test I can get them really.

However, when I try to use BASS_ChannelGetTags and the BASS_TAG_MIDI_TRACK (defined at bottom of bass_midi.bb) I get an "illegal type conversion".

The docs say that "If successful, the requested tags/headers are returned, else NULL is returned", however I am not getting that far - Blitz is refusing to compile it.

I have tried making title a string, float, int - maybe I have to use banks and peek/poke, but I would like this confirming if possible.
I have also tried varying combinations of using "rp" instead of "midi" in the BASS_ChannelGetTags() call, but all to no avail.

If I comment out the offending line, it compiles and runs fine.

Does anyone have any idea why?

; Includes
Include "bass.bb"
Include "bass_midi.bb"

; Initialise
HWND = BASS_HWND()
BASS_Init(-1,44100,0,HWND,BASS_NULL)

; Setup
midi=BASS_MIDI_StreamCreateFile(0,"midiFile.mid",0,0,0,44100)

rp=BASS_ChannelPlay(midi,True)

midiSize#=BASS_ChannelGetLength(midi) 
midiSecs#=BASS_ChannelBytes2Seconds(midi,midiSize)

; *** Problem Line
title=BASS_ChannelGetTags(midi,BASS_TAG_MIDI_TRACK)

; Main Loop
While Not KeyDown(1)

	Cls

	BASS_Update()

	; Test info
	Text 10,10,midiSize
	Text 10,30,midiSecs

	Flip

Wend

BASS_Stop()
BASS_Free()