Latency, nudge and midi

Author
fep
Max Output Level: -67 dBFS
  • Total Posts : 1186
  • Joined: 2006/10/21 13:57:09
  • Location: San Diego, California
  • Status: offline
2007/05/16 12:29:24 (permalink)

Latency, nudge and midi

I"m trying to set up my nudge correctly. My first nudge is for audio and I determined it by sending an audio track to my mixer and rerecording it to another audio track. I compared the wave forms and it was 71 samples late. So I set my 1st nudge to 71 samples.

Now I'd like to do a similar calculation for tracking with my midi keyboard. So I'm monitoring my already recorded in Sonar reference drum track thru my mixer and recording a midi track from my keyboard. So I have latency from the computer to the mixer, and latency from the midi keyboard to the computer. The problem is I don't know how to get the precision that I was able to get for my audio latency. How do I precisely calculate the latency for this?

Thanks in advance.

Some of My Tunes

HS 6 XL, M-audio Delta 44, Digitech GNX3000, Dell Dimension 8400 Pentuim 4 3.4 Ghz, 2GB Ram
#1

7 Replies Related Threads

    Beagle
    Max Output Level: 0 dBFS
    • Total Posts : 50621
    • Joined: 2006/03/29 11:03:12
    • Location: Fort Worth, TX
    • Status: offline
    RE: Latency, nudge and midi 2007/05/16 14:49:47 (permalink)
    Per ZUNGLE:

    Audio Loop Back Test(As I do it)

    ....Open SHS

    ...go to track view

    ...right click time ruler see options and set time ruler format to Samples.....not Absolute Time or Musical Time.

    ...set metronome to Audio/recording.......... no pre-count or pre-roll.

    ...Arm track #1 and record audio metronome to track #1. About 4 measures. (you use Delta 44 right?)( If so you can record audio metronome by selecting mon mixer for track#1 input...make sure its also selected in Delta control panel.)

    ...Turn off all metronome features audio, midi... all.

    ...Arm track #2

    ...In real time record track#1 onto Track #2....You should now have 2 audio tracks #1 is original #2 is real time recorded copy.

    Remember you cannot simply copy track#1 to #2 or paste or do any kind of offline edits, its not the same.

    ...You may record track #1 to #2 by selecting mon mixer for track#2 input. Hint I leave my monitors off while doing this to avoid nasty feedback loops.

    Depending on interface a user may have to send audio out of machine and then back in to record in real time from track#1 to #2. Coming out of machine lengthens audio path and could add more latency.

    ...Now magnify track heights a little.......pick a wave peak in track#1 and the relative wave peak in track #2.
    ...They probably look good in placement, with beat and each other....at least to the naked eye.

    ...Mark that peak with marker or now time.

    ...Now magnify track width and height... the integers on time ruler should become more accurate as you magnify, take it down to actual bits( integers of 1)

    ...Find your reference wave peak in track#1 and Look for relative wave peak in track #2

    ...Count along the time ruler .....the difference in wave peak #1 to wave peak #2 is your exact... to the sample offset(latency).

    ...It could be a few samples or hundreds, even thousands............. but its there.

    Because you love bench marks play with your ASIO and WDM drivers and buffers each time do a test. This will accurately tell you whats happening with each change.

    Knowing your exact offset helps you deal with latency accurately and efficiently.

    Now you can set up nudge and eliminate offsets with a single key stroke. I don't know if its just me, but it seems like nudge feature isn't a priority for a lot of users.

    Did this make sense ?

    Midi test would use same principles with different mechanics.

    http://soundcloud.com/beaglesound/sets/featured-songs-1
    i7, 16G DDR3, Win10x64, MOTU Ultralite Hybrid MK3
    Yamaha MOXF6, Hammond XK3c, other stuff.
    #2
    ohhey
    Max Output Level: 0 dBFS
    • Total Posts : 11676
    • Joined: 2003/11/06 16:24:07
    • Location: Fort Worth Texas USA
    • Status: offline
    RE: Latency, nudge and midi 2007/05/16 15:41:02 (permalink)

    ORIGINAL: fep

    I"m trying to set up my nudge correctly. My first nudge is for audio and I determined it by sending an audio track to my mixer and rerecording it to another audio track. I compared the wave forms and it was 71 samples late. So I set my 1st nudge to 71 samples.

    Now I'd like to do a similar calculation for tracking with my midi keyboard. So I'm monitoring my already recorded in Sonar reference drum track thru my mixer and recording a midi track from my keyboard. So I have latency from the computer to the mixer, and latency from the midi keyboard to the computer. The problem is I don't know how to get the precision that I was able to get for my audio latency. How do I precisely calculate the latency for this?

    Thanks in advance.


    First you might check to see what values you can nudge by on a midi track. Midi can only really be nudged by the resolution PPQ (pulses per quarter note) you are working at. Audio on the other hand can be nudged by the sample so there are many thousands per second. The amount of timeline time a ppq is depends on the tempo of the song so there is no static translation. I don't think there is a reference point to check the latency between keyboard key press and what sub "frame" ppq stamp the note gets in event view. However that is where you would check it to see exacly where it was put.

    You are also dealing with several sources of latency with midi. 1. The performance latency, the time it takes from keypress for the note to be recorded in Sonar. That trip goes from the internal detetion inside the keyboard to the data going out it's midi port or USB connection, to the midi driver (remember, not related to the sound card driver for audio I/O), and into Sonar. 2. After the note is recorded there can be latency going back out the driver and midi interface to a hardware synth and it's response time or the response time of a software synth and that can depend on CPU power so it's variable depending on the power of the system and how many other things are going on. For example you might get good response time when the project is first started and you are just laying down backing tracks. But it can get worse after you add some audio tracks and start adding effects plugins for them or other synth tracks. This is a good reason to bounce or freeze early.
    #3
    Beagle
    Max Output Level: 0 dBFS
    • Total Posts : 50621
    • Joined: 2006/03/29 11:03:12
    • Location: Fort Worth, TX
    • Status: offline
    RE: Latency, nudge and midi 2007/05/16 15:44:10 (permalink)
    Sorry - my turn to misunderstand the question. the post I gave above is for audio, not for MIDI. Frank's got your answer there about MIDI.

    http://soundcloud.com/beaglesound/sets/featured-songs-1
    i7, 16G DDR3, Win10x64, MOTU Ultralite Hybrid MK3
    Yamaha MOXF6, Hammond XK3c, other stuff.
    #4
    fep
    Max Output Level: -67 dBFS
    • Total Posts : 1186
    • Joined: 2006/10/21 13:57:09
    • Location: San Diego, California
    • Status: offline
    RE: Latency, nudge and midi 2007/05/16 17:54:54 (permalink)
    Thanks Reese, That is basically what I did to calculate audio latency which I tried to explain in my first few sentences.

    Thanks Frank, Lots of good info, food for thought. You mention that midi latency will change as the CPU workload changes. I'd assume then that audio latency will also change as CPU workload changes. Is that correct?

    Also, in HS 4 you can nudge midi clips in increments of samples. HS 4 will just move the whole clip by however many samples you nudge it for and the undelying midi events will move by that many samples. I just tested that and at a tempo of 95bpm a nudge of 71 samples = 2 ppq and at 180bpm a nudge of 71 samples = 5 ppq (960 ppq is the resolution in HS 4).

    But the problem remains, what is a good practical way to deal with latency.
    #5
    ohhey
    Max Output Level: 0 dBFS
    • Total Posts : 11676
    • Joined: 2003/11/06 16:24:07
    • Location: Fort Worth Texas USA
    • Status: offline
    RE: Latency, nudge and midi 2007/05/16 22:14:12 (permalink)

    ORIGINAL: fep

    Thanks Reese, That is basically what I did to calculate audio latency which I tried to explain in my first few sentences.

    Thanks Frank, Lots of good info, food for thought. You mention that midi latency will change as the CPU workload changes. I'd assume then that audio latency will also change as CPU workload changes. Is that correct?

    Also, in HS 4 you can nudge midi clips in increments of samples. HS 4 will just move the whole clip by however many samples you nudge it for and the undelying midi events will move by that many samples. I just tested that and at a tempo of 95bpm a nudge of 71 samples = 2 ppq and at 180bpm a nudge of 71 samples = 5 ppq (960 ppq is the resolution in HS 4).

    But the problem remains, what is a good practical way to deal with latency.


    Latency is a fact of life and you just have to live with it. As for the audio engine that is one big program and it spits everything out at the same time no matter what the CPU load up to the point it starts to drop out. The software synths are seperate processes and can degrade without indication it's happening.

    HS4 is trying to offer a consistant user interface so it will let you nudge by samples but in reality I don't think it can output midi at a fraction of a ppq, so it just "appears" to be able to do it. It makes a calculation and gets as close as it can but still moves the data by the ppq resolution, it's not sample accurate just like sheet music doesn't show exactly when the notes will happen in time, midi doesn't either but at least it's finer then sheet music. You don't see many scores with 960th notes.

    Most sound cards have direct monitoring or you can use a mixer to get around audio latency while tracking but there is nothing you can do about software synth latency. What I have done before is use a sound from my midi keyboard to monitor to input the performace so I'm in time with the song when I hear it. Then change the output of the midi track to the software synth later. That seems to work well to keep me in time as long as the sound is close to the same ADSR as the one I'll be using in the software synth. To hear the onboard sound and the playback I use a mixer or an extra input on my sound card and use the sound cards DSP mixer to echo it back to the same outputs Sonar is playing on. With that setup I don't even need the software synth loaded when tracking.

    Also you can lower CPU load by doing only one software synth at a time, bounce to audio, then move on to the next one. Also, don't add a bunch of effects till you are done tracking and get ready for the mix. I like to bounce all tracks to audio before I start the mix so I can nudge them if needed and have all the envelopes and effects bins available. It's also best for archiving, after all I might not have some of these software synths in the future when I go back to do a remix.
    #6
    fep
    Max Output Level: -67 dBFS
    • Total Posts : 1186
    • Joined: 2006/10/21 13:57:09
    • Location: San Diego, California
    • Status: offline
    RE: Latency, nudge and midi 2007/05/17 18:22:08 (permalink)
    Thanks for all that. You've changed the way I'll record in the future.

    One more question on variable latency.

    Assume I don't use any software synths during the performance stage of recording, i.e. all midi tracks are using the sound module of my keyboard. Then does that midi path have any degrade in latency as the CPU load increases? (The path being recorded audio (if any) to my mixer, prerecorded midi tracks from PC to sound module on external keyboard to mixer, and midi out of performed track to PC)

    post edited by fep - 2007/05/17 18:25:40

    Some of My Tunes

    HS 6 XL, M-audio Delta 44, Digitech GNX3000, Dell Dimension 8400 Pentuim 4 3.4 Ghz, 2GB Ram
    #7
    Beagle
    Max Output Level: 0 dBFS
    • Total Posts : 50621
    • Joined: 2006/03/29 11:03:12
    • Location: Fort Worth, TX
    • Status: offline
    RE: Latency, nudge and midi 2007/05/17 18:36:27 (permalink)
    there's still going to be SOME time between when you press a key on the keyboard and when the data arrives in the software. with no softsynths running, that time should be very small.

    http://soundcloud.com/beaglesound/sets/featured-songs-1
    i7, 16G DDR3, Win10x64, MOTU Ultralite Hybrid MK3
    Yamaha MOXF6, Hammond XK3c, other stuff.
    #8
    Jump to:
    © 2024 APG vNext Commercial Version 5.1