25 May '13 - 12:16 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Audio and MIDI in sync? (long...)  (Read 1226 times)
JacekH
Posts: 24


« on: 14 Feb '07 - 22:55 »
Reply with quoteQuote

I have many questions about working with BASS. I had some ‘days off’ (2 or 3 years) from this great library. Now I’m back with my old idea of audio-MIDI application. What  I want to do is almost a classic audio-MIDI sequencer plus some more features. So:

1. Playing one or more BASS Channels. Channels are sent to one or more devices in perfect sample sync between them.
2. Playing one or more MIDI tracks (e.g. SMF 1) along audio data in perfect sync with audio stream.

Mixing channels to one device (output) is no problem. But I have no idea how to play multiple channels to many outputs in sample sync. I’ve asked about it a couple years ago but it wasn’t resolved. How can I do it today? Any BASS Add-on? I haven’t tested BASS ASIO. Is it possible using it?

And the next question. I use WinAPI low-level routines to send and receive MIDI events. Also I have my own procedure to play MIDI files using MIDI streams. But I have not idea how to sync MIDI streams to external clock (MTC and MIDI Clock)...

Also, I cannot figure out how to sync MIDI to audio. I mean sending MIDI events from MIDI file using short messages (not MIDI stream) in synchronization to audio clock.

Btw. Is there any limitation in ChannelSetSync counts?

Regards,
Jacek
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #1 on: 15 Feb '07 - 17:00 »
Reply with quoteQuote

Mixing channels to one device (output) is no problem. But I have no idea how to play multiple channels to many outputs in sample sync. I’ve asked about it a couple years ago but it wasn’t resolved. How can I do it today? Any BASS Add-on? I haven’t tested BASS ASIO. Is it possible using it?

I'm not sure it's possible to have sample accurate sync between different devices with 100% certainty. But if you want multiple BASS streams to start playing at exactly the same time, I think the closest you'll get is by joining them (BASS_ChannelJoin).

Btw. Is there any limitation in ChannelSetSync counts?

There's no limit, but I guess it could slightly affect performance if you have loads of them, as BASS looks through them when a syncable event occurs.

I'm afraid I can't advise on the MIDI hardware sync stuff.
Logged
JacekH
Posts: 24


« Reply #2 on: 16 Feb '07 - 00:19 »
Reply with quoteQuote

Quote
I'm not sure it's possible to have sample accurate sync between different devices with 100% certainty.

Of course, using more one audio card without word clock synchronization never gives perfect sync. A little more explanation. I mean using WDM/MME driver, not ASIO. My audio card has 18 mono outputs and I'd like to play multiple audio files to multiple outputs. The only solution I can see is a little bit complicated Wink I had a class for playing PCM wave files. I've tested that preparing buffers for all audio files (to many audio outputs) and then starting them to play simultaneously give me a perfect sample sync. The problem is playing non-PCM files ;-) A lot of work with all these format and BASS can do it Smiley So I can decode files, mix them if I need to and then get_data to fill my class' buffers. Maybe I'll try it but... I wrote that post before deep testing your BASS_ASIO. And bingo Wink It can do it exactly what I need Smiley More about it in my another post.

Quote
There's no limit, but I guess it could slightly affect performance if you have loads of them, as BASS looks through them when a syncable event occurs.

I asked about it because I had an idea to use sync events as a counter.... But it seems I have to look a better solution.

Thank you,
Jacek
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines