• SONAR
  • syncing an external keyboard with Sonar
2017/12/12 04:50:29
mwmcbroom
I've done this before, but it was lotsa years ago, and I no longer remember what to do.
 
I have a Casio digital piano that I've just hooked up to a Win7 PC running Sonar Platinum. I've figured out how to get Sonar to send MIDI info to the keyboard, but the problem I'm encountering is the keyboard is playing out of sync with the other instruments, which are just plain MIDI. To be more clear, the kb is actually playing the MIDI part through its own built-in speakers.
 
The problem I've run into is the kb is actually playing its part maybe an eighth note ahead of all the other instruments. Heck, I would have thought, if anything, it would be behind the others by a small amount, but not preceding them.
 
I'm just not familiar anymore with all the various controls that Cakewalk has having to do with controlling the timing of an instrument. And I don't want to start just clicking away at things cuz if it works I'll probably never realize exactly what I did to make it work, and if it doesn't then I may have made things worse. So if someone here would either point me toward a source that will clearly explain how to get things set so my external kb will play in sync or perhaps explain it, I'd really appreciate it.
 
My next big task will be to try and figure out how I can use some of this Casio's 700+ instruments in Sonar. Still haven't figured out yet how to bring the voices in as MIDI, or might I just have to bring them in as audio and (gasp) actually have to play the parts? I'm a guitarist, hence the (gasp).
 
Sure hope there's a way to get to the bottom of both these issues.
 
 
 
2017/12/12 07:46:31
bvideo
The KB is playing out its own speakers almost instantaneously upon receiving MIDI notes.
Meanwhile, the DAW may be delaying its audio output for two different reasons. It's called latency.
 
Solution #1: hook the keyboard's audio output to one of your audio interface inputs, let that input echo through Sonar, and turn off the keyboard's speakers. Sonar will delay echoing the keyboard's input so that it matches its internal delay (latency).
 
Solution #2: find out the reason for Sonar's output delay. Usually it's one of two things:
 
reason#1: large audio buffers, usually configured that way by the user to avoid dropouts. Solution #2 might be to reduce Sonar's audio device driver buffers, maybe to 256 or lower, depending on what audio interface you use. If your audio interface demands large buffers, maybe solution #1 is best.
 
reason#2: using DSP effects (plug-ins) that require delay. These effects look "ahead" in the audio stream to compute effects for present time. Yes, that means they want to look at future audio before they generate current effects. Sounds a little crazy, but the DAW has to compensate by delaying audio output so these effects can get a sneak peek. It's called Plug-in Delay Compensation. So solution #2 might mean finding the effect you are using somewhere in your project that is demanding this latency. A test of whether latency compensation is your problem is to override PDC by setting the [PDC] button in your control bar. If this nearly eliminates Sonar's delay compared to your keyboard's speakers, then you need to find & eliminate a PDC-hungry plug-in. Of course overriding PDC can spoil the sound of some effects.
 
There's another cause of output delay that is not from Sonar; it's the Windows sound system MIDI synth. Just don't use it.
 
2017/12/12 16:57:01
Base 57
Go to Preferences/Audio/Sync and Caching and adjust the Timing Offset. Be aware that this is a universal setting and may create a problem with midi input timing (or even fix one you were unaware that you had).
 
2017/12/12 17:26:24
mwmcbroom
Thanks very much for taking the time to respond. Your response has been helpful. I may respond to your points out of order, but I'll try to respond to all of them.
 
I'm well aware of latency. Fortunately my sound card, an M-Audio Delta 66, can achieve very low latency levels. I think that right now it's somewhere under 10ms. If I use the 1ms = 1 ft rule, this means it's the same as listening to my amplified guitar from less than 10 feet away. Good enough for me.
 
I haven't hooked the synth's audio outs up to the computer yet. Fortunately, my Delta card has a break-out box called "Omni IO" which is, essentially, a compact four channel mixer. So I'll be able to run my synth in through it.
 
I should probably back up and give you a clearer picture of my setup. When I built this machine, I built it as my DAW. But that was several years ago. We moved to a new home recently and I'm still dealing with boxes all over the place. I have not reassembled my DAW yet. So far, all I have going is the computer and this one keyboard. I have a couple of mixers, a few external effects processors, another keyboard, a Roland GR-33 guitar synth, and a Roland JV1010 synth, all of which I need to hook up to this machine. With the exception of the mixers, it's all still in boxes and I don't know which boxes all the stuff is in. So later on down the road, things are gonna get a whole lot more complicated than they are now. But still at the heart of the beast will be my trusty old Delta 66 card.
 
The Delta card usually defaults to 256 buffers. I often run it at 1024 if I'm getting some static in my output. But that doesn't seem to be a problem yet. I prefer running it at 24/96. 96k I've found, substantially reduces latency from slower rates, like 44.1k, for instance. In that little performance window, CPU tasking is pretty low. This is a fairly quick machine even if it's getting a little old now. I'm running Win7 64-bit, a 3.4 GHz processor, quad core, running 8 gigs of RAM, plus I have a huge amount of disk space -- 3 TB, little of which is occupied with programs and other data so far. I dunno when (or if) I'll be upgrading to Win10. So far I see no need for it. I'm perfectly content with Win7. It's the best OS M$ had ever produced, and that includes v8.x. But I dunno, maybe 10's better. I suppose if I were ever to get a laptop with a touch screen, I might want to run Win10. But I have an iPad for that.
 
The only way I can turn off this keyboard's speakers is to plug something into the headphones jack. One thing that would be illuminative would be to let the speakers be and play a piece with the kb running through my sound card's mixer -- see just how much latency is actually occurring. If under 10ms, it should still be noticeable but just barely. But the kb's earliness is approximating 125 ms, if I'm doing my mental math correctly, so I should definitely be able to see the difference. Tempo of the piece = 120 bpm or 2 beats per second, 1/4 beat early = 1/8 second= 125 ms.
 
I've brought this tune into Sonar as a MIDI type 1 file, and, as it sits, there are no effects at all associated with it yet. But I am using MS GS Wavetable Synth because that's the only one that comes up as a default. I don't like it much either. I like Cakewalk's TTS-1, but from what I understand it's just the GS Wavetable synth being run through a Cakewalk mixer, yes?. I have a few other software synths, but none of them supply the standard MIDI selection of instruments.  Well, anyway, I'll take a look at that, as well. IF I can get the Aria player that came with Band in a Box to work with Sonar, that'll give me quite a few sounds to choose from.
 
Hello Base 57, and thanks for your response. Will it make a difference if there is not yet any audio that Sonar is having to handle? Right now, it's all MIDI. Appreciate the tip, though. This could come in handy for when I am dealing with audio as well as MIDI.
2017/12/12 18:51:13
Base 57
 
It's complicated. The Timing Offset in preferences is generally for tightening up the timing of external sequencers. As its calibrated in seconds, the offset is the same regardless of tempo. However it offsets input as well as output. For some users that is a good thing. For others it is the opposite of a good thing.
 
When you add Audio tracks to the mix along with tracks playing from the external synth it will be imperative that the midi be properly synced. Until audio is added it shouldn't really matter as long as all of the tracks play through the keyboard [suggest not using the audio metronome in SONAR but a simple midi click or drum track instead (reasons would be a whole nother thread)].
 
Another option is to use the Time offset option in the midi track inspector. The problem with that is it is set in ticks. So the offset would be different for different tempos.
 
And of course a third option is to use a Soft Synth like TTS-1 or Rapture, but that is outside the boundary of your question and so a different topic.
 
Best of luck to you
 
-Don't forget to set "Local Off" on your keyboard when looping through SONAR (or any other DAW).-
 
--edit to add this-
Don't confuse Timing Offset in Preferences Synchronization with the Record Latency Adjustment. The Timing Offset changes the MIDI clock not audio.
2017/12/12 19:13:50
Cactus Music
OK I'm glad I read your second post as that explains a lot more about your system.
 
With what you are doing there should be no delay. I think I know what your problem is..your midi routing. 
 
Most of the set up for using external sound hardware is found in preferences. 
You pick your audio interfaces Midi ports MIDI/Devices/Outputs/ Delta midi
Now in the OUTPUT selection of the midi track you select that as your output.. or a VST synth. I know it can be done but I've never sent a midi track to both a VST and external. I always just duplicate the tracks for those situations. I really stopped using external sounds a long time ago because the quality is always sub par for what I use inside Sonar now. 
 
I think your issue is for some reason you also involving the MS wavetable... don't use that bl;oody thing, it's terrible. 
 
You are way better off using Sonars many VST synths. The TTS-1 will automatically load up when you OPEN any GM midi file , but to do this you would have to go back to MIDI/Devices/ output and make sure nothing is selected first.
That's a great trick I use all the time. The song will play the way it was meant to sound. Then I just replace TTS-1 sounds with better VST's.  You can always go back and check your interface midi output after the song loads up if for some reason you have a sound in your keyboard you just can't live without.  TTS-1 is a lot better than Wavetable. Wavetable is like 4bit.   
 
 
2017/12/12 23:38:10
bvideo
Right, TTS-1 is your best first choice right now. It is NOT "just the GS Wavetable synth being run through a Cakewalk mixer". The confusion may lie in the fact that TTS-1 can be used to emulate a General MIDI synth, which is what the Windows wavetable synth also does. Other people have experienced delay using the Windows synth too, so maybe replacing that would be a worthwhile next step.
2017/12/13 00:50:40
57Gregy
Could you set all the MIDI tracks to play through the keyboard?
I suppose it would be a problem if the patch you want to hear doesn't exist in the keyboard, though.
I record all my MIDI using my keyboard's sounds and later change them to soft synths. Or not.
2017/12/13 03:41:37
mwmcbroom
Okay, guys, thanks very much for your advice. It's gonna take me a while to work my way through everything you've outlined, but I will do so.
 
But right now I have an immediate, pressing problem that I've just discovered -- -having to do with Cakewalk TTS-1. Now, I've used TTS-1 before -- on this very machine -- and I happen to like it a lot. But for some really bizarre reason when I set it up just now TTS-1 is sounding terribly distorted. Honestly, I dunno if "distorted" is the right word. Horrendously out of phase seems to fit better. As far as I know, I haven't changed any of the settings that have to do with it. I've confirmed that it is TTS-1 too because if I set things back to MS GS Wavetable, the voice(s) return to normal -- or as normal as the GS Wavetable can sound, leastwise. If I load a VSTi, the sounds played through it are normal sounding. And if I set things up so that the sounds are playing through my Casio, they sound normal as well. It's just TTS-1. I haven't tried any other soft synths yet to see if it is a greater problem than just TTS-1. Guess I should do that next.
 
When I first set it up, there's that Insert Soft Synth Options popup you get, and I'm working on memory that's a little bit hazy here cuz it's been quite a while since the last time I encountered this popup, but all I did was check "Enable Midi Output" and I left everything else alone. By "everything else" I mean that under "Create These Tracks," the boxes "Midi Source" and "All Synth Audio Outputs: Stereo" were already checked and under "Open These Windows," "Synth Property Page" and "Synth Rack View" were already checked.
 
Down at the bottom, under "Display Automation Information On," the "First Synth Audio Track" was the selection on the drop down and "Recall Assignable Controls" is checked.
 
I've always just left everything alone and just checked "Enable Midi Output" when I wanted to enable a synth. I'm wondering if one of the defaults may have changed, leading to this unlistenable condition. I'm slowly working my way through every possible setting one at a time to see what is causing this problem, and it's probably gonna take me a while. Got any ideas where my TTS-1 setup got all crossways with itself?
 
Update: I've just discovered that things are even worse with Sample Tank v3. The instruments sound very distorted. With 5 instruments loaded into Sample Tank, it plays for a couple of seconds and then stops. A popup down at the bottom of the screen appears, which reads:
 
Audio Dropout
The audio engine has been stopped unexpectedly
 
And there's a help button to click on, which takes me to a Cakewalk web page where several dropout options are presented. Most of them I'm already familiar with. But I'll read through all of them anyway in the slim hopes that the solution may be presented. I'll update this thread if I find anything that works.
 
Update 2: I just tried loading all six instruments from a MIDI file into Cakewalk's TTS-1. Playback halted at the beginning of sounds. When I tapped on the spacebar, Sonar locked up (Not Responding). And it's staying in that condition, so it looks like things won't get sorted, and I'll have to dump Sonar, then I'll try restarting it.
 
Well, that's what I had to do. I restarted Sonar and reloaded the same MIDI file. This time, I selected a single instrument to be used with TTS-1. The rest I left at deaf. Same thing, I'm getting that weird out of phase distortion sort of sound. This is so aggravating. I'm running out of options to try.
 
 
 
2017/12/13 04:37:26
mwmcbroom
I've been chipping away at the problem with my keyboard playing ahead. I tried something simple. I reduced the tempo of the song -- a lot. From 120 down to 80. What become immediately obvious is that it's playing ahead not by a tempo value, but by a time value. It's still playing ahead by a fractional amount, but now that I've slowed the tempo down, it's obvious that it isn't a quarter beat ahead. It's more like an eight of a second ahead. Sounds small, but that's 125ms and enough to drive one nuts.
 
So now I'm gonna go take a look at anything associated with time and not tempo.
© 2025 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account