Author Topic: BASS.NET API 2.4.12.7  (Read 783476 times)

Ian @ un4seen

  • Administrator
  • Posts: 20436
Re: BASS.NET API 2.4.0.0 beta
« Reply #375 on: 21 Mar '08 - 17:46 »
I've created a mixing application with a number of tracks going into a couple of submix streams, mixing together to a stereo stream, with dsps and vst plugins hooked up at various points, but it will only run on one core

Yep, BASS currently has a single "update thread", in which output buffers are updated during playback. There are other threads running too (eg. the sync thread and DirectSound's threads), so some load can be spread amongst cores, but the bulk of the work is done by the update thread.

I'm thinking about creating a couple of threads (maybe one per mixer channel) and pushing stream data to them through a fifo buffer. But I don't know whether this will work. Is this the way to go?

I think that would work. You probably wouldn't have to implement your own FIFO buffering, instead you could use "push" streams (plugged into the mixer), eg. decode and push data (via BASS_StreamPutData) to them in worker threads.

Thinking about it, multiple update threads could be a good idea. Besides spreading the load over multiple cores when playing multiple channels, another benefit I see is that it could prevent a slow updating channel from affecting other channels. With a single update thread, if a channel update takes too long, not only could its output buffer underrun, but the buffers of other playing channels could do so too.

I'll look into it. Multiple update threads wouldn't really affect what you're doing though, as a mixer would still do its work in a single thread. The mixer would have to create its own threads to take advantage of multiple cores in rendering the mix. Perhaps something for later :)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.0 final
« Reply #376 on: 2 Apr '08 - 08:44 »
02.04.2008: Version 2.4.0.0 final is finally out!

This is the official and final 2.4 BASS.NET version!

Please see the help file (.chm) for a complete list of changes and take a look to the "Upgrading from 2.3" section!
Note, that support for .Net 1.1 has been discontinued. Supported .Net Framework versions include 2.0, 3.0 and 3.5.

BASS.NET:
Full Install:
  www.un4seen.com/filez/4/Bass24.Net.zip

Lib only:
  www.un4seen.com/filez/4/Bass24.Net_update.zip

BASS_WADSP:
  www.un4seen.com/filez/4/bass_wadsp24.zip


Installer notes:
The provided samples are now installed to the <AppDataUser> directory!

Please (re)download, due to a little last minute change.
« Last Edit: 2 Apr '08 - 13:25 by radio42 »

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.1
« Reply #377 on: 4 Apr '08 - 09:08 »
04.04.2008: Version 2.4.0.1 is out!

There was a small glitch in the BASSmidi implementation:
- MIDI_EVENT_TEMPO event was missing in the BASSMIDIEvent enum.
- BASS_MIDI_StreamGetMark bug-fix

BASS.NET:
Full Install:
  www.un4seen.com/filez/4/Bass24.Net.zip

Lib only:
  www.un4seen.com/filez/4/Bass24.Net_update.zip

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.1
« Reply #378 on: 4 Apr '08 - 14:09 »
Hello,

I don't know if it is something caused by Bass 2.4 or Bass .Net 2.4.0.1, but first time I call the Bass_ChannelSetAttribute function with a new parameter (first time I set volume, first time I change tempo, first time I set new pitch...), I notice a short lag (about half a second) then all the other times it will runs very smoothly.

Can you confirm this behavior ?


Also for the previous MSHelp 2.0 merging problem with MSDN 9.0, the only way to make it work for me was to modify those two lines in H2Reg.ini :

[Merge_Namespace]
;<nsName>|<option>
MS.VSIPCC+|AUTO
MS.VSCC|AUTO

by

[Merge_Namespace]
;<nsName>|<option>
MS.VSIPCC.v90
MS.VSCC.v90

I also noticed that the h2reg version is outdated : version 1.7 beta or 1.6 stable is released now, you're still using old 1.4 ;)

I tried before to do a devenv /reset and devenv /setup on the VS command line prompt, but with no success.
I have a clean install of VS2008 Professional on a fresh Windows XP SP2 installation.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.1
« Reply #379 on: 4 Apr '08 - 14:27 »
Quote
I don't know if it is something caused by Bass 2.4 or Bass .Net 2.4.0.1, but first time I call the Bass_ChannelSetAttribute function with a new parameter (first time I set volume, first time I change tempo, first time I set new pitch...), I notice a short lag (about half a second) then all the other times it will runs very smoothly.
Can you confirm this behavior ?
-> I can not - at least I haven't notices it so far. But that shouldn't be any BASS.NET issue, since the Bass_ChannelSetAttribute method is a plain mapping to the native BASS method with no extra .Net code involved.

Regarding h2reg: I am upgrading it in the next release.

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.1
« Reply #380 on: 4 Apr '08 - 14:55 »
In fact it did not fixed the registration of the Bass.Net namespace. I thinked it did but I posted too fast ;)
I noticed I can remove some errors in the log file after that I read that :

http://helpware.net/mshelp2/h2tutorial.htm#dtd

I suggest that you read it too ;)

So I removed all the dtd references and get no errors in the logfile. But as I not expected, it also didn't work : the Bass.Net namespace still doesn't appear in the Filter zone of MSDN.

I then came back to the original h2reg.ini and tried again with h2reg.exe -r -m (after a h2reg.exe -u -m) but still nothing about Bass.Net appears in the filter zone.

That's not preventing me to using Bass.net, but the integration with VStudio help was really a big feature for me, could you test on a VS2008 installation with minimal options (not installing VSHIK and Help SDK... I haven't on my dev machine, and I think I'm not the only one :))


Also here we can read something interesting about the filter and search of msdn 8.0 and 9.0 :
http://helpware.net/mshelp2/h2reg.htm#vs8search

Hope it helps ! :)

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.1
« Reply #381 on: 4 Apr '08 - 16:00 »
I finally get it to work, I now have Bass.Net integrated into my MSDN !!  ;D

I joined the files I used to get it work.

Also created a xml file in C:\Program Files\Common Files\Microsoft Shared\VS Help Data\9.0\Filters\1033 : BassNetFilter80.xml

content :

<?xml version="1.0" encoding="utf-8"?>
<SearchFilter xmlns="http://schemas.microsoft.com/VisualStudio/2004/08/Help/SearchFilter" Version="0.1.0.0">
    <FilterAttribute>
        <Id>Language</Id>
        <Name _locID="name.1">Language</Name>
        <FilterValue>
            <Id>Bass.Net</Id>
            <Name _locID="name.2">BASS.NET API for the Un4seen BASS Audio Library collection
</Name>
            <Meaning>
                <LocalFilterString>("DocSet"="Bass.Net")</LocalFilterString>
                <TocInclude></TocInclude>
                <OnlineFilterString>
                 <![CDATA[
                            <StringTest Name="ExtendedProperty" Operator="Equals" Value="ms07H2BF" ExtendedProperty="MSCategory"/>
                 ]]>
                </OnlineFilterString>   
            </Meaning>
        </FilterValue>
    </FilterAttribute>
</SearchFilter>


Also added this registry key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Help\VisibleFilters :
BassNetFilter80  DWORD  value = 1


This add Bass.Net namespace into the search filters ;)



Then I closed everything about VS, and tried to run again h2reg.exe -r -m, restarted VS2008, opened the help and... Bass.Net was here.

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.1
« Reply #382 on: 12 Apr '08 - 13:18 »
Hello,


I just wanted to use the TAG_INFO.PictureGetImage function... But I just found this never work with id3v2.4 tags !
And of course... all my music collection is tagged with id3v2.4 + sometimes apev2 ... Such a pity.
The strange thing is that TAG_INFO.PictureCount returns the good number of pictures ! But there is no picture returned, just NULL.

Consider the following VB.Net example :

Dim infos As Un4seen.Bass.AddOn.Tags.TAG_INFO = entry.EntryInfos '  (entry.EntryInfos is a valid TAG_INFO)
Dim nbPictures As Integer = infos.PictureCount ' (this returns "1" and that's right, I have a picture in this mp3...)
Dim pic As System.Drawing.Image

(...)

                If nbPictures > 0 Then ' I want draw the picture
                    pic = infos.PictureGetImage(0) ' This should store the picture in pic. But this just returns a NULL value for ID3 tag > v2.3 !
                    e.Graphics.DrawImage(pic, New PointF(150, 10)) ' ===> Null reference exception !
                End If


Could it be possible to fix this ? I'm pretty sure that's quick to fix :)

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.1
« Reply #383 on: 12 Apr '08 - 13:25 »
Will check that - but, here it works just fine.

So can you please provide a sample file which is not working for you.
You can mail it to me at: bn @ radio42 . com

THX

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.1
« Reply #384 on: 12 Apr '08 - 17:44 »
Be ready : I am currently sending an email with two identical files, however one is id3v2.3 and the other is id3v2.4.
I am able to retrieve the property PictureCount successfully for both files, but I an only retrieve the picture for tag id3v2.3.

I used Mp3Tag to create my tag on my files, and unfortunately I don't know how to convert all my music library to 2.3 without loosing all my cover-art...

If you can find the problem, then I needn't convert to id3v2.3.

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.1
« Reply #385 on: 13 Apr '08 - 10:26 »
Hi,

I scanned you ID3v2.4 files, but found, that it really looks, like the APIC tag is incorrectly written.
You can find the original description at: http://www.id3.org/id3v2.4.0-frames
Which defines the APIC tag as:
<Header for 'Attached picture', ID: "APIC">
     Text encoding      $xx
     MIME type          <text string> $00
     Picture type       $xx
     Description        <text string according to encoding> $00 (00)
     Picture data       <binary data>

However, in your v2.4 file the APIC tag looks more like:
     Text encoding      $xx
     MIME type          <text string> $00
     Description        <text string according to encoding> $00 (00)
     Picture type       $xx $00
     Picture data       <binary data>

Plus the frame-length value provided seems to be incorrect.
As you can see, in your file the "picture type" value is at the wrong location and therefore shifts the picture data.

So I tried your file also with various outher players and ID3 tag readers.
Except Winamp ALL others also doen't display the picture correctly!

So I am not sure what Winamp and your Mp3Tag editor are doing, but for me it really looks, like the ID3v2.4 APIC tag is incorrectly written to the file and is not according to the id3.org specs.

So I don't know what to do!

One more funny thing:
Once I open you ID3v2.4 file in Winamp and modify some stupid tag value (e.g. the year) and then saved the tag changes...then Winamp is correctly writing the ID3v2.4 tags - and such BASS.NET displays the picture correctly.
So it seems, that Winamp somehow recognizes the incorrect picture tag and somehow corrects them when writing them.
So that is (to me) definitly the proof, that it is not BASS.NET - but unluckily your "Mp3Tag" editor tool, which simply writes incorrect picture tags).
« Last Edit: 13 Apr '08 - 10:32 by radio42 »

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.1
« Reply #386 on: 13 Apr '08 - 11:36 »
Well... That's (for me and my music collection) not a a very good news...
So now here is what I propose :
- You do not change one line of your code
- I exchange my MP3 tagger with a more ID3-specs compliant one :D
- Eventually (that's really not compulsory) you add a little function to check if the tag is a valid one, and if not then set the number of available pictures to "0" ;)

However it will not be very easy as MP3Tagger is a famous and very used one, because it can retrieves the tags and covers from various internet databases. Apart Winamp that I don't want to install (too intrusive in its last versions), do you know a good mp3 tagger ?


I will not ask you to not conform to the ID3 specs, I am sorry that MP3Tag is not able to write correct ID3v2.4 tags.

Thanks for your time !

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.1
« Reply #387 on: 13 Apr '08 - 13:40 »
I'll check what I can do.
Maybe there a way (like Winamp is doing) to detect when and how the tags are wrong and to adjust my reader somehow...I'll check thta.

riesm

  • Posts: 51
Re: BASS.NET API 2.4.0.1
« Reply #388 on: 13 Apr '08 - 17:58 »
Hi,

I am struggling to get the BASS_FX_BPM_CallbackSet Method to work. I have written the code below:
Code: [Select]
_bpmProc = New BPMPROC(AddressOf MyBPMProc)
BassFx.BASS_FX_BPM_CallbackSet(strm, _bpmProc, 5.0F, Utils.MakeLong(45, 240), BASSFXBpm.BASS_FX_BPM_MULT2, IntPtr.Zero)

But when I execute this, the MyBPMProc is called like million times a second instead of every 5 seconds. Is this a bug (bass.net 2.4.0.1) or am I doing something terribly wrong? Thanks in advance as always!

Cheers,
riesm

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.1
« Reply #389 on: 13 Apr '08 - 20:44 »
I couldn't reproduce that here.

How are you creating your channel handle (strm) ?
ANd how are you playing it?

riesm

  • Posts: 51
Re: BASS.NET API 2.4.0.1
« Reply #390 on: 13 Apr '08 - 20:54 »
This my code

Code: [Select]
istream = Bass.BASS_StreamCreateFile(mTags.URL, 0, 0, BASSFlag.BASS_STREAM_DECODE Or BASSFlag.BASS_DEFAULT)
strm = BassFx.BASS_FX_TempoCreate(istream, BASSFlag.BASS_FX_FREESOURCE Or BASSFlag.BASS_DEFAULT) BASSFXFlag.BASS_SAMPLE_LOOP

'BPM
_bpmProc = New BPMPROC(AddressOf MyBPMProc)
BassFx.BASS_FX_BPM_CallbackSet(strm, _bpmProc, 5.0F, Utils.MakeLong(45, 240), BASSFXBpm.BASS_FX_BPM_MULT2, IntPtr.Zero) = False Then
Bass.BASS_ChannelPlay(strm, False)

Perhaps this will help.

riesm

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.1
« Reply #391 on: 13 Apr '08 - 22:40 »
Hmm, that looks a bit strange,
1. In the second line: why is there the BASS_SAMPLE_LOOP flag outside the brackets?
2. In the last line: why do you start to play, if the CallbackSet fails?

riesm

  • Posts: 51
Re: BASS.NET API 2.4.0.1
« Reply #392 on: 14 Apr '08 - 02:01 »
Code: [Select]
istream = Bass.BASS_StreamCreateFile(mTags.URL, 0, 0, BASSFlag.BASS_STREAM_DECODE Or BASSFlag.BASS_DEFAULT)
strm = BassFx.BASS_FX_TempoCreate(istream, BASSFlag.BASS_FX_FREESOURCE Or BASSFlag.BASS_DEFAULT)

'BPM
_bpmProc = New BPMPROC(AddressOf MyBPMProc)
BassFx.BASS_FX_BPM_CallbackSet(strm, _bpmProc, 5.0F, Utils.MakeLong(45, 240), BASSFXBpm.BASS_FX_BPM_MULT2, IntPtr.Zero)
Bass.BASS_ChannelPlay(strm, False)

Sorry Bernd, I forgot to delete some comments and/or extra things not needed for the code sample, so ad 1, the BASS_SAMPLE_LOOP outside the brackets was a comment and ad 2, the callback does not fail, instead calls _bpmproc procedure every other cycle.

Thx.
riesm

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.2
« Reply #393 on: 14 Apr '08 - 11:35 »
14.04.2008: Version 2.4.0.2

BASS_MIDI: bug-fix
  - BASS_MIDI_FontGetInfo bug-fix
General:
  - Tags add-on: Support for ID3v2.4 unsyrchronised picture frames added

BASS.NET:
Full Install:
  www.un4seen.com/filez/4/Bass24.Net.zip

Lib only:
  www.un4seen.com/filez/4/Bass24.Net_update.zip

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.2
« Reply #394 on: 14 Apr '08 - 14:14 »
That's what I can call a fast reaction !  :D
Thank you very much, I try it now and will post some feedback about the new rev here.

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.2
« Reply #395 on: 14 Apr '08 - 14:47 »
My first reaction is : It seems that you forget to specify 2.4.0.2 for the assembly or provided the link is not the right one. I downloaded the full archive and the version is still 2.4.0.1.
The "update only" archive contains two dll, also in 2.4.0.1.

I missed something. What is Bass.Net-wmadrm.dll ?

The help version is 2.4.0.2, that's okay.

However I uninstalled 2.4.0.1 to ensure I have the new help, I saw you updated h2reg to 1.7.0.0, however there is still the namespace registration issue with VS2008. The reason is that you should not specify the DTD reference in the .HXC, and the .HXK. With DTD It only works for those who have Help workshop installed. Without DTD reference it works for all users.

So please consider to update these files from
<!DOCTYPE HelpIndex SYSTEM "MS-Help://Hx/Resources/HelpIndex.dtd">
to
<!DOCTYPE HelpIndex>

Thanks ! :)

Edit : in the help, there is still reference to 2.4.0.1 everywhere, not 2.4.0.2, eg :


Code: [Select]
Namespace:  Un4seen.Bass.AddOn.Fx
Assembly:  Bass.Net (in Bass.Net.dll)
Version: 2.4.0.1 (2.4.0.1)

but the help contains :

Code: [Select]
BASS.NET Version History
14.04.2008: Version 2.4.0.2

Some little things to change before too many people download 2.4.0.2 ;)

« Last Edit: 14 Apr '08 - 15:14 by gabsoftware »

riesm

  • Posts: 51
Re: BASS.NET API 2.4.0.2
« Reply #396 on: 14 Apr '08 - 15:27 »
Hi Bernd,

I have used an extended stream test sample to check if the problem was with my application. Below an excerpt of the code I use:

Code: [Select]
' Initializes the bass object
If False = Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, Me.Handle, Nothing) Then
  MsgBox("BASS Init Error!")
End If

' Loads the stream
If TextBox1.Text.ToLower().EndsWith(".mp3") Then
  strm = Bass.BASS_StreamCreateFile(TextBox1.Text, 0, 0, BASSFlag.BASS_DEFAULT)
End If

' If there was an error
If strm = 0 Then
  MsgBox("Error!")
  Exit Sub
End If

_bpmProc = New BPMPROC(AddressOf MyBPMProc)
If BassFx.BASS_FX_BPM_CallbackSet(strm, _bpmProc, 5.0F, Utils.MakeLong(45, 240), BASSFXBpm.BASS_FX_BPM_MULT2, IntPtr.Zero) = False Then
  Debug.WriteLine("Bass error code: " & Bass.ERROR.ToString)
End If

' Plays the stream
Bass.BASS_ChannelPlay(strm, False)

Private Sub MyBPMProc(ByVal handle As Integer, ByVal newbpm As Single, ByVal user As IntPtr)
  Debug.WriteLine("bpm: " & newbpm.ToString)
End Sub

I use 5.0F in the BASS_FX_BPM_CallbackSet Method and according to documentation, that means that my BPMProc should be called every 5 seconds, however it is called an infinite amount of times. Am I doing something wrong here, or am I misreading the documentation and should the BPMProc be called endlessly?

Cheers,
riesm

radio42

  • Posts: 4576
Re: BASS.NET API 2.4.0.2
« Reply #397 on: 14 Apr '08 - 16:10 »
@ riesm:
No - that looks fine.
So this one is probably a BASS_FX issue.
Do you mind posting your code and question again to the general BASS_FX post - so that JOBnik can take a look at it!

@ gabsoftware :
Dam, you are right.
I just forgot to change the assembly info;-)
Regarding the DOCTYPE issue - I'll check that as well.
And forget about the wmadrm stuff, that's only for users who purchased a WMADRM version.

So a new BASS.NET version 2.4.0.2 is up on the page... please (re)download.
« Last Edit: 14 Apr '08 - 16:43 by radio42 »

gabsoftware

  • Posts: 30
Re: BASS.NET API 2.4.0.2
« Reply #398 on: 14 Apr '08 - 16:31 »
Wow can't wait to try the really good one ! ;D

riesm

  • Posts: 51
Re: BASS.NET API 2.4.0.2
« Reply #399 on: 14 Apr '08 - 17:46 »
Thanks for looking into it. I have reposted to BASS_FX forum.

Cheers,
riesm