The Music Studio community forum has moved!
This forum is in read-only mode. Please visit the new Music Studio community forum.


Accurate latency compensation when recording soft synth

Official update plan and feature suggestions

Accurate latency compensation when recording soft synth

Postby Unknown Crewman » Fri Jun 10, 2016 1:04 pm

Hi,

if I record soft synth with MusicStudio 2.6.5, on an iPAD 2, with iOS 9.3.2, by Audiobus 2.3.8, at 512 frames, the recorded audio tracks have a negative delay of around 1/32 note length at 90 bpm. This could be compensated by moving MIDI notes 1/32 note to the left, so that they are played 1/32 note earlier. However, this isn't a solution.
Since (60000 ms / 90 bpm) / 8 = 83.3333333333 ms/1/32, I consider to insert silence at the beginning of the wav files. IOW as a workaround "Number of seconds to insert at the playhead's position: 0.08" likely should do the job, as long as frame accuracy isn't required. OTOH there still would be an offset of around 3 ms. This happened with Animoog 2.3.5, Crystal Synth XT 2.1.3 and Neo-Soul Keys 2.2.3. There seems to be no noticeable MIDI jitter, it seems to be a fixed negative delay.

Please fix this issue and/or consider to add ms to the silence feature.

Regards,
Ralf

Edit: Don't be confused. I'm talking about sync between MIDI and audio tracks. Audio tracks of recorded MIDI tracks are played 1/32 note to early at 90 bpm, without the audio interface being involved. So I'm not talking of moving MIDI notes before recording a track, but after a track was recorded, to get back sync. As already mentioned, it's better to delay the audio tracks to get back sync.

Edit: Unfortunately the recorded sounds are nebulous regarding attack and release times and added effects. The needed offset seems to be close to 20 ms and not 80 ms, IOW the time close to what is expected as latency for recordings with a sound card at 512 frames. I can't say for sure, but I suspect when recording soft synths an automatic latency compensation assumes the recoding was done with the sound device involved and compensates latency, while there actually is no latency, at least no latency that high, as expected for recordings of external sound sources.
Unknown Crewman
 
Posts: 21
Joined: Sat Mar 14, 2015 4:18 pm

Re: Accurate latency compensation when recording soft synth

Postby Alex » Sat Jun 11, 2016 1:22 pm

"Automatic latency-compensation for audio recordings" is already on the list:
viewtopic.php?f=12&t=2409

Music Studio currently doesn't compensate audio recording latency. Unfortunately, the recording latency is different for each iOS device model, ranging from 20ms to 80ms. On Android, it's even worse. We won't get to it this year, but we'll try to implement some kind of latency compensation in 2017.
Image Image
Alex
 
Posts: 2125
Joined: Wed Jun 23, 2010 4:55 pm
Location: Austria

Re: Accurate latency compensation when recording soft synth

Postby Unknown Crewman » Sat Jun 11, 2016 2:16 pm

Hi,

why are recorded soft synth not in sync with the MIDI tracks?
The audio tracks are definitively played around 20ms to early (perhaps around 15ms, perhaps a little bit more than 20ms, I just tested with the sounds I recorded for a song and they aren't good to find out the exact offset. When recording soft synth from within the same device, I usually expect to be close to sample accuracy. In my previous post "frame" accuracy is a typo.

Regarding Android devices I doubt real-time ability at all. I'm an audio engineer and Linux real-time audio user and noticed some of the Android discussions regarding the architecture and jackd. However, it's a long time ago and things might be improved nowadays.

Regards,
Ralf
Unknown Crewman
 
Posts: 21
Joined: Sat Mar 14, 2015 4:18 pm

Re: Accurate latency compensation when recording soft synth

Postby Alex » Sat Jun 11, 2016 4:59 pm

why are recorded soft synth not in sync with the MIDI tracks?

I need more details to answer that. By "soft synth", do you mean Inter-App Audio (IAA) synth apps, or other CoreMIDI+Audiobus compatible apps that Music Studio sends MIDI to and receives audio via Audiobus? By "MIDI tracks", do you mean Music Studio's internal instruments?

When recording soft synth from within the same device, I usually expect to be close to sample accuracy.

That's not necessarily true for IAA and Audiobus, because the MIDI signals have a time stamp, then there's the latency of the other synth app, then there's the latency of audio signal transfer between apps. However, with Audio Unit Extensions, this is not a problem anymore because AU Extensions run as a plugin, not as a separate app. Music Studio doesn't support AU Extensions yet, but we're going to implement this in a future update.

Regarding Android devices I doubt real-time ability at all. I'm an audio engineer and Linux real-time audio user and noticed some of the Android discussions regarding the architecture and jackd. However, it's a long time ago and things might be improved nowadays.

Absolutely right. The situation hasn't improved, unfortunately.
Image Image
Alex
 
Posts: 2125
Joined: Wed Jun 23, 2010 4:55 pm
Location: Austria

Re: Accurate latency compensation when recording soft synth

Postby Unknown Crewman » Sat Jun 11, 2016 6:03 pm

Hi,

I agree that a synth app itself comes with at least inaudible latency, but I would expect a delay, when just playing, as well as for the recording.

Sync is ok, at least there's no audible issue, if just playing those synth apps by MIDI tracks, but there is audible _negative_ delay, when playing the recorded audio tracks. They are not delayed, they are to early.

Recording is done by Audiobus, with a period size of 512 frames. IAA doesn't work.

[Synth] --> [no effect] --> [Music Studio]

When playing the audio tracks, it's usually done without Audiobus, at what ever period size Music Studio should use, however, the issue also appears, when playing with Audiobus. MIDI tracks playing Music Studio's sampler aren't in sync with the audio tracks of synth app recordings, while MIDI tracks playing Music Studio's sampler and MIDI tracks playing synth apps are in sync.

Perhaps it's unrelated, anyway, 512 frames period size / 44100 Hz SR * 2 nperiod ≈ 23 ms output latency and my impression is, that adding 0.02 s silence at the beginning of those audio tracks, is the best solution available by Music Studio to work around the issue.

IIUC Audiobus compensates system input latency, "for system audio inputs, Audiobus already compensates for the reported hardware input latency", https://developer.audiob.us/doc/_receiv ... ml#Latency , but it doesn't affect audio signals from synth apps, at least it shouldn't.

Regards,
Ralf
Unknown Crewman
 
Posts: 21
Joined: Sat Mar 14, 2015 4:18 pm

Re: Accurate latency compensation when recording soft synth

Postby Alex » Sat Jun 11, 2016 6:57 pm

Ah, now I know what you mean! This is a known bug, in some configurations Music Studio starts audio recording too late, but it places the audio region where it should have started. The result is that the audio track seems to play back too early. In other words, the first few ms are missing from the audio file.

Until we find a fix for this bug, there are 2 workarounds:
1. Start audio recordings 1 bar earlier, then cut the beginning of the audio file so that it starts when you started playing, and move the audio region to the right position.
2. Use IAA instruments instead of recording other apps via Audiobus.
Image Image
Alex
 
Posts: 2125
Joined: Wed Jun 23, 2010 4:55 pm
Location: Austria

Re: Accurate latency compensation when recording soft synth

Postby Unknown Crewman » Sat Jun 11, 2016 11:00 pm

Hi,

a possible issue with cut and move or just move, could be, that a note on event could trigger an envelope or LFO start of a synth, but not necessarily an audio signal already is audible or visible. If you cut were the audio signal becomes audible or visible, it might be at a point, that doesn't allow to move the recording exact. However, since I recorded already with more than just one bar of silence, I can test, if moving is closer to the wanted sync, than the 20ms silence I added. At maximal zoom in, there are landmarks within the recordings, that are the starting points of notes, while the beginning of the audio track could be vague, IOW the first audio signal of an audio track might not fit to the available quantisation. I not only wonder, if the grid's resolution is graduated fine enough, but also if the displayed waveform is accurate enough to adjust the audio tracks.

Visually the audio tracks are minimal to early, but the audible effect is disgusting. Moving them either by adding 20 ms silence or by using the grid to move them to the right, they are visually more delayed, than they were to early before, but it sounds better. Moving one grid dot to the right is closer to the note on event, than the 20 ms are, for 3 of 4 tracks. Visually the difference is not equal for all recorded synth. For one track moving it two dot points to the right makes it visually fit exactly to the MIDI quantisation.

I'll remove the 20ms delayed tracks and keep the moved tracks, but there still seem to be audible show stoppers.

I counted 48 available grid dots for 1/4 bar, so at 90 bpm one grid dot is close to 14 ms. This seems to be fine enough to adjust some tracks, but still could be too coarse to adjust other tracks. After hours of tests, it's hard to have any musical feeling for a conclusion.

IAA seems not to work properly, OTOH a quick test done with Arturia iSEM right now was fine, unfortunately not all needed synth provide IAA. I can't record my real vintage synth with the iPAD, I only have a RME card for my PC and just MOBILE IN and MIDI Mobilizer II for the iPAD, so I don't want to give any available virtual synth a miss. I wonder, if there's a cheap ADAT capable audio interface available for the iPAD, that at least provide 1 MIDI IO. OTOH I fear MIDI jitter for external gear and apart from this the missing latency compensation.

Regards,
Ralf
Unknown Crewman
 
Posts: 21
Joined: Sat Mar 14, 2015 4:18 pm

Re: Accurate latency compensation when recording soft synth

Postby Unknown Crewman » Sun Jun 12, 2016 8:30 pm

Hi,

it's jitter, increasing the longer the track is, up to around 30 ms. You could also call it an increasing drift of around 30 ms, with additional few ms jitter. Even cutting and moving each note wouldn't work for legato played notes. The only work around is to add and cut silence as long as it becomes less disgusting for important parts.
Just cutting away silence at the beginning and moving the first note to the wanted position, doesn't fix anything. This bug renders Music Studio useless, for usage with some important synth apps.

Regards,
Ralf
Unknown Crewman
 
Posts: 21
Joined: Sat Mar 14, 2015 4:18 pm

Re: Accurate latency compensation when recording soft synth

Postby Alex » Sun Jun 12, 2016 10:53 pm

Jitter in audio tracks? That's new to me, we tested with 1h long audio recordings and the timing was fine. However, for MIDI tracks, jitter of max. one buffer length (usually 5ms) can occur.

I counted 48 available grid dots for 1/4 bar, so at 90 bpm one grid dot is close to 14 ms

Right, Music Studio's resolution is 1/192 note. We are aware that it's not good high enough and we aim to improve it next year. Until then, I only use the audio editor for editing, since its resolution is 1 frame. Tap the audio editor's LCD to switch the ruler to bars/beats, which makes it easy to cut a file to the beat with millisecond accuracy.
Image Image
Alex
 
Posts: 2125
Joined: Wed Jun 23, 2010 4:55 pm
Location: Austria

Re: Accurate latency compensation when recording soft synth

Postby Unknown Crewman » Sun Oct 09, 2016 6:43 pm

The jitter appears when recording audio tracks from MIDI tracks, so the cause is MIDI, but the jitter gets recorded and there is a fluctuation, bad sync, too.

It would be nice, if you would enable email notification for forum replies ;).
Unknown Crewman
 
Posts: 21
Joined: Sat Mar 14, 2015 4:18 pm


Return to Feature requests

Who is online

Users browsing this forum: No registered users and 2 guests

cron