Show Posts
|
|
Pages: [1] 2 3 ... 7
|
|
1
|
Developments / BASS / Re: Generate pure tone
|
on: 1 Apr '13 - 11:02
|
Hi, I quite certain there are other ways to achieve what you need to do. But my first thought would be to create a sine wave (y=sin(x) if you're float or y=sin(x)*32767 if you're 16bits integer) in memory then loop while playing it... Hope this starts the reflexion  [EDIT] The whole project you need may be synth.c Ian already supplies with BASS
|
Reply
Quote
|
|
|
2
|
Developments / BASS / Re: BASS_MIDI_StreamGetEvents crashes ?
|
on: 2 Mar '13 - 16:09
|
Hi Ian  All I had to do and I should have done it before I bothered you, is to change Declare Function BASS_MIDI_StreamGetEvents Lib "bassmidi.dll" (ByVal handle As Long, ByVal track As Long, ByVal filter As Long, events As Any) As Long to Declare Function BASS_MIDI_StreamGetEvents Lib "bassmidi.dll" (ByVal handle As Long, ByVal track As Long, ByVal filter As Long, ByVal eventsarrayadress As Long) As Long as I did in 2009... So this is working now And I drop out the loop by replacing nTrack by -1  That's working even better like this, thank you very much !
|
Reply
Quote
|
|
|
3
|
Developments / BASS / Re: BASS_MIDI_StreamGetEvents crashes ?
|
on: 1 Mar '13 - 15:48
|
Ok, Thanks Ian I'll have a try with this asap. I just saw the definition changed from "track" to "chan" : Declare Function BASS_MIDI_StreamGetEvents Lib "bassmidi.dll" (ByVal handle As Long, ByVal track As Long, ByVal filter As Long, ByVal eventsarrayadress As Long, ByVal eventc As Long) As Long
Declare Function BASS_MIDI_StreamGetEvents Lib "bassmidi.dll" (ByVal handle As Long, ByVal chan As Long, ByVal filter As Long, events As Any) As Long
any relation with my issue ? I'll be back  Thx.
|
Reply
Quote
|
|
|
4
|
Developments / BASS / BASS_MIDI_StreamGetEvents crashes ?
|
on: 1 Mar '13 - 09:47
|
Hi Ian, Hi you all BASSists  Do you remember when very first version of BASS_MIDI_StreamGetEvents had a 5th parameter that should contain eventc when we wanted to get the events into an array ? That was version 2.4.3.9, circa june '09... The .chm file wasn't up to date but, if I remember well, you explained me how to use it. Here your BASSMIDI.bas code: ' Declare Function BASS_MIDI_StreamGetEvents Lib "bassmidi.dll" (ByVal handle As Long, ByVal track As Long, ByVal filter As Long, ByRef events As BASS_MIDI_EVENT, ByVal eventc As Long) As Long Declare Function BASS_MIDI_StreamGetEvents Lib "bassmidi.dll" (ByVal handle As Long, ByVal track As Long, ByVal filter As Long, ByVal eventsarrayadress As Long, ByVal eventc As Long) As Long
Here is my VB6 code: Dim nTrackCount As Long Dim nTrack As Long Dim nEventCount As Long Dim aEvents() As BASS_MIDI_EVENT
' .../... nEventCount = BASS_MIDI_StreamGetEvents(chan, nTrack, MIDI_EVENT_NOTE, 0, 0) ' count how many MIDI_EVENT_NOTE events we got in this track If nEventCount > 0 Then ReDim aEvents(0 To nEventCount - 1) BASS_MIDI_StreamGetEvents chan, nTrack, MIDI_EVENT_NOTE, VarPtr(aEvents(0)), nEventCount ' get the events ' .../...
This runs very well  I decided to grow up since then... But latest revision of the DLL (2.4.7.0) hasn't got this eventc parameter anymore for you always return the whole array. Knowing the user asked for how many he'd get before, this seems leggit to me. Here your corresponding BASSMIDI.bas code: Declare Function BASS_MIDI_StreamGetEvents Lib "bassmidi.dll" (ByVal handle As Long, ByVal chan As Long, ByVal filter As Long, events As Any) As Long
But, when I modify my source code according to this, it runs well for the (say) 3 first (empty ?) tracks: ' .../... nEventCount = BASS_MIDI_StreamGetEvents(chan, nTrack, MIDI_EVENT_NOTE, 0) ' count how many MIDI_EVENT_NOTE events we got in this track If nEventCount > 0 Then ReDim aEvents(0 To nEventCount - 1) BASS_MIDI_StreamGetEvents chan, nTrack, MIDI_EVENT_NOTE, VarPtr(aEvents(0)) ' get the events ' .../...
But then, the DLL suddenly crashes (I can't trap any error) at counting step (is it when nTrack matches the first non empty track # ?). So I have to stick to 2.4.3.9  Any idea ? Thanks 
|
Reply
Quote
|
|
|
5
|
Developments / BASS / Re: For the Fun (WinDev project)
|
on: 12 Jan '13 - 13:01
|
Perhaps some of you, will remember me. I have written a complete "free" WinDev project including both source code and EXE that is using BASS.DLL + OpenGL and a nice AERO-GLASS skin of my own. To run the demo go to the EXE folder and start "BlackBox.exe" Here is the direct link to the full project: Download BlackBox Patrice Terrier www.zapsolution.comHi Patrice, This is a unbelievable gift your offer me, I was just trying to marry WinDev and BASS DLLs. Your project will act as the starter kit I needed. As I'm working with WD17, may be WD18 soon for its new TimeLine control seems very interesting, could you tell me if DotNet is mandatory or if regular API are just fine (may be faster) ? Thanks again  Arthur.
|
Reply
Quote
|
|
|
6
|
Developments / BASS / Re: BassMidi trouble with sound
|
on: 29 Jul '12 - 09:58
|
I'm sure I must be asking something obvious, but I'm sort of stuck here. I try to play midi file with bassmidi.dll, I get C example from bassmidi.dll archieve - miditest, compile it and try to play some midi file and I see lyrics from this file & timeline but I don't hear any sound. Could anybody answer me, what am I doing wrong?
Hi MishaK, You didn't mention it, so the first thing to check is the soundfont. Did you download chorium.sf2 (for example), then tell the miditest program to use it ([Replace] button)?
|
Reply
Quote
|
|
|
7
|
Developments / BASS / Re: Bassmidi multiple questions
|
on: 17 Jul '12 - 07:09
|
Each preset entry takes 4 bytes, with the low 2 bytes (LOWORD) being the preset number and the high 2 bytes (HIWORD) being the bank number, so your soundfont includes 00/06/0A/0D/13/20/28/29/31/32/38/3D/48 (hex) presets in bank 0. Dumb me.  This was so obvious, thank you very much for your very detailed answer Ian 
|
Reply
Quote
|
|
|
8
|
Developments / BASS / Re: Bassmidi multiple questions
|
on: 15 Jul '12 - 17:55
|
Hi, Ian  Sorry I left you "alone" for this long.  I just tried this new function above but I can't figure how to handle what it returns: I just made a sample test with a the smallest SF2 file I found in my disk drive It just a quick adaptation from your miditest VB example. Dim fontinfo As BASS_MIDI_FONTINFO Dim nBuffer() As Byte Dim newfont As Long newfont = BASS_MIDI_FontInit("C:\512gm-b.sf2", 0)
If (newfont) Then Dim sf As BASS_MIDI_FONT sf.font = newfont sf.preset = -1 ' use all presets sf.bank = 0 ' use default bank(s) Call BASS_MIDI_StreamSetFonts(0, sf, 1) ' set default soundfont Call BASS_MIDI_StreamSetFonts(chan, sf, 1) ' set for current stream too Call BASS_MIDI_FontFree(font_) ' free old soundfont
If (BASS_MIDI_FontGetInfo(newfont, fontinfo)) Then Debug.Print "SF2 Name : " & VBStrFromAnsiPtr(fontinfo.name) Debug.Print fontinfo.presets & " presets" ReDim nBuffer(123456) If (BASS_MIDI_FontGetPresets(newfont, nBuffer(0))) Then
I'm stripping out the code I wrote to display hexadecimal bytes from the nBuffer array I got these answers: SF2 Name : General MIDI 13 presets 00 00 00 00 06 00 00 00 0A 00 00 00 0D 00 00 00 ................ 13 00 00 00 20 00 00 00 28 00 00 00 29 00 00 00 ........(...)... 31 00 00 00 32 00 00 00 38 00 00 00 3D 00 00 00 1...2...8...=... 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 H...............
I notice I get 13 DWORD numbers, that's a good thing... But how to deal with them, next? BTW, there is a small typo in the BASSMIDI.BAS module : Type BASS_MIDI_DEVICEINFO name As Long ' description id As Long flags As Long; End Type should be Type BASS_MIDI_DEVICEINFO name As Long ' description id As Long flags As Long End Type Without the semicolon  Many thanks. Arthur.
|
Reply
Quote
|
|
|
10
|
Developments / BASS / Re: BASS_FX 2.4.6
|
on: 8 Sep '10 - 16:27
|
Bpm := BASS_FX_BPM_DecodeGet(C, 0, L, 0, BASS_FX_FREESOURCE, BPMCallback);
the resulting "Bpm" is zero  Just a question, are your Bpm variable and BPMCallback correct ?
|
Reply
Quote
|
|
|
11
|
Developments / BASS / Re: BASSMIDI MIDI I/O Functions
|
on: 14 Jul '10 - 17:41
|
Hi Ian, I didn't expect you to implement these functions this soon, thank you very much. So first try : Jazz++ sequencer sends to MidiYoke #1, Synth.exe listens to same channel. First impression : latency seems very good, have to test it with my own fingers though  Second thing, the mid file I'm playing has two notes playing at the same time and sometimes, one doesn't strike, and rarely, none strike at all. If you want, please have a llok at b9_2.mid in your incoming folder. I'll have to implement this dll in a program in order to find where the bug comes from. I haven't got too much time at this moment but I hope I could send you some more consistent comments soon. Second try : Axiom 61 keyboard plugged into one of my USB ports: Every thing works pretty well, aftertouch does work too  Got a weird fader #8 behaviour, changes preset, bend and things like that  have to find which CC it's got, coming later with more info. And I do confirm : latency is *very* good, its very playable! Thanks a lot again, Ian. Have a good july 14th (our time to celebrate)  Regards, Arthur.
|
Reply
Quote
|
|
|
13
|
Developments / BASS / BASSMIDI MIDI I/O Functions
|
on: 9 Jul '10 - 09:39
|
|
Hi Ian, You told us, years ago, that Midi "I/O", or should I say "Input" at least, would be possible in a future BASSMIDI version. Did you think of it since yesteryear? I already know Bass.net has something that would help me but I'm not fan of .net so this is why I'm asking you,
Best regards, Arthur.
|
Reply
Quote
|
|
|
14
|
Developments / BASS / Re: bass_midi: Ian, pleas add BASS_MIDI_StreamGetEventNote
|
on: 14 Jul '09 - 16:20
|
|
Hi Ian, firemen and all,
Thank you Ian for this new feature, It fulfills my needs in finding which channel matches best the lyrics.
I'm sorry, firemen, I didn't understand a word of your explanation. Hope this works for you ;-)
In my software, I finally decided to compare number of Note On events to number of Lyrics events (with some percentage tolerance) and refine with difference between note on and lyric tick marks, the smaller the better. Works fine with most kar files I tried.
And what's best is that it is lightning fast to compute this. I threw my previous note on tick finder method (the one with a fake decoding channel).
Thanks a lot Ian for listening to our wishes.
Best regards, Arthur.
|
Reply
Quote
|
|
|
17
|
Developments / BASS / Re: bass_midi: Ian, pleas add BASS_MIDI_StreamGetEventNote
|
on: 11 Jun '09 - 10:37
|
It is necessary to determine what channel is the melody for solo MIDI karaoke. Plan to compare the track with the text.
I'm working on such a thing. For information: As a first attempt, I rendered the midifile to nothing to catch every note event. The sampling rate choice is important in the way you are very loose in note tick if sampling is low but time to compute is too long if you try to get precise tick timing with higher sampling rate. Your proposal is very interesting, but as it is not available yet, I decided to write my own midi file parser, very interesting  I then realized some midi files have lyrics written apart in a separate track, some other files have text events embedded in an instrument track (the one I want to mute), some have both. If you fall in the first case of figure (format 0 midi files always do), first work is to (automatically) choose which test/lyric track you want to use. We discussed this here not so long ago : I choosed to select the longest list. Next find the midi channel having similar note on count AND minimum tick errors. Hope this helps. Do you have similar techniques ?
|
Reply
Quote
|
|
|
18
|
Developments / BASS / Re: BASSMIDI MIDI_EVENT_NOTE BASS_MIDI_TICK
|
on: 19 May '09 - 17:33
|
|
Good evening Ian,
Thanks for keeping on helping me.
1) Yes, soundfonts were removed, I saw it in the other thread.
2) I'm wondering if calculating number of samples in a tick would be accurate when handling a midi file embedding tempo changes, but this could be a good idea.
3) As far as I don't render for real, I'm asking myself if I have to call BASS_ChannelGetData with floating point width in order to match the BASS_MIDI_StreamCreateFile BASS_SAMPLE_FLOAT flag. Anyway, I'll give it a try.
Most regards, Arthur.
|
Reply
Quote
|
|
|
19
|
Developments / BASS / Re: BASSMIDI MIDI_EVENT_NOTE BASS_MIDI_TICK
|
on: 18 May '09 - 17:27
|
Good evening Ian, you are totally true, as usual. First, I put your new DLL in my developpement folder, and it does work! There are no more such big tick count differencies ! The "error" is now constant and equals to 1. In a second time, I had a look at my code: Effectively, as told in another thread, to speed up this decoding to null, with no soundfont, to get every event, I had lowered the sample frequency to 1kHz : BASS_MIDI_StreamCreateFile(BASSFALSE, StrPtr(sFileName), 0, 0, BASS_STREAM_DECODE Or BASS_SAMPLE_MONO Or BASS_MIDI_NOFX, 1000) This was the faulty parameter ! When I put it at 44100, tick "errors" get all down to 0 and it's now accurate ! But the whole thing is v-e-r-y slow  So I really do thank you for helping me pointing out the cause of this problem, I never thought of this 1ms stupid sampling rate! So, to resume, there is no more problem but it does take a lot of time. I'm currently trying to decode the midifile myself (in standard midifile format) to see if I can get these informations faster. I'll get back with further information if I succeed. Grateful thanks, Mr Ian ! Regards, Arthur.
|
Reply
Quote
|
|
|
20
|
Developments / BASS / Re: BASSMIDI MIDI_EVENT_NOTE BASS_MIDI_TICK
|
on: 15 May '09 - 17:27
|
Sorry Ian, I was not using a regular FTP client for this attempt, thought WXP was good enough, silly thought, isn't it? So you'll find Luis.kar in incoming folder. As told earlier, I rely on mf2t from MidiOx to have an "impartial" vision of ticks and I found these (midichannel are numbered from 1 to 16): 36240 On ch=4 n=67 v=105 36480 On ch=4 n=67 v=94 36720 On ch=4 n=67 v=96 39360 On ch=4 n=67 v=101 39720 On ch=4 n=69 v=97 40080 On ch=4 n=70 v=100 40320 On ch=4 n=74 v=96 41040 On ch=4 n=72 v=96 44160 On ch=4 n=72 v=102 44520 On ch=4 n=72 v=94 44880 On ch=4 n=72 v=90 45120 On ch=4 n=74 v=100 45480 On ch=4 n=74 v=88 45840 On ch=4 n=74 v=90 46080 On ch=4 n=75 v=100 46440 On ch=4 n=75 v=98 46800 On ch=4 n=75 v=62 47040 On ch=4 n=78 v=99 47400 On ch=4 n=79 v=102 47760 On ch=4 n=81 v=97
I wrote similar decoding using BassMidi library (I stripped off if then end if statements to make it clearer: .../... BASS_ChannelSetSync nChan, BASS_SYNC_MIDI_EVENT Or BASS_SYNC_MIXTIME, MIDI_EVENT_NOTE, AddressOf CalculNote, 0 Do nCount = BASS_ChannelGetData(nChan, aBuffer(0), 2) ' aBuffer is an array of integers DoEvents Loop While (nCount = nLength) And BASS_ChannelIsActive(nChan) .../...
Sub CalculNote(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long) midichan = data \ 65536 eventparam = data Mod 65536 nValue = eventparam Mod 256 nVelocity = eventparam \ 256 nTick = BASS_ChannelGetPosition(channel, BASS_POS_MIDI_TICK) debug.print nTick;" On ch=";midichan;"n=";nValue;" v=";nVelocity End Sub And I get this timing (midichan lies between 0 and 15): 36241 On ch=3 n=67 v=105 36481 On ch=3 n=67 v=94 36721 On ch=3 n=67 v=96 39361 On ch=3 n=67 v=101 39714 On ch=3 n=69 v=97 40081 On ch=3 n=70 v=100 40321 On ch=3 n=74 v=96 41027 On ch=3 n=72 v=96 44161 On ch=3 n=72 v=102 44521 On ch=3 n=72 v=94 44867 On ch=3 n=72 v=90 45121 On ch=3 n=74 v=100 45481 On ch=3 n=74 v=88 45841 On ch=3 n=74 v=90 46081 On ch=3 n=75 v=100 46441 On ch=3 n=75 v=98 46787 On ch=3 n=75 v=62 47039 On ch=3 n=78 v=99 47389 On ch=3 n=79 v=102 47761 On ch=3 n=81 v=97
As you can see, there is more than 1 tick difference at ticks # 39714/39720, 41027/41040, 44867/44880, 46787/46800, 47389/47400, ... Thanks again for your support.  Regards, Arthur.
|
Reply
Quote
|
|
|