Topic: Improve performance with swap file

My computer is always running Pianoteq VST in the background, so that my keyboard is available immediately when I need it (like a real piano).

First off, I know that it's recommended to disable the swap file altogether when running a DAW, but since my computer is not 100% dedicated to music I do need this swap file when running other memory-intensive tasks. I'm sure many Pianoteq users are in this situation.

I do have a lot of RAM so it's usually not a problem as the swap file doesn't actually get used, but unfortunately if I run a lot of programs before two Pianoteq sessions, it sometimes happens that Windows moves part of the memory used by Pianoteq to the swap file. In these situations when I return to Pianoteq there are some crackles at first, which is not a big deal. But the bigger issue is that even after the initial crackles are over and the playback seems smooth, from time to time very nasty crackles appear. It usually happens when I play a rather extreme note, or a note with an unusual velocity. And even if you play for several minutes, some of these crackles will appear from time to time. The only effective solution is to entirely reload Pianoteq (which can be a hassle if you have modified some settings and have to save them to a temporary preset just to reload it).

I can only assume that it is because some tiny samples or precalculated data are required for those notes, and because these cache misses are not predicted they incur a huge latency, hence the crackle. I have no idea how much RAM this precalculated data encompasses, but if it's not a huge amount it would be very helpful to either:
1. tell the OS never to swap the allocated memory (pro: reliable, con: very low-level)
2. refresh the precalculated data periodically (con: might affect performance if not implemented carefully)
3. include a manual reload button (con: less efficient than 1 and 2, needs user interaction)
4. automatically perform a reload if unexpected crackles are detected (pro: easy, con: less efficient than 1 and 2)

Thanks for listening!

Re: Improve performance with swap file

pergol wrote:

The only effective solution is to entirely reload Pianoteq (which can be a hassle if you have modified some settings and have to save them to a temporary preset just to reload it).

Actually Pianoteq remembers your last changes, even if you don't save them to a preset.  When you restart it, it's all still there.  PT has so many nice touches like that.

Re: Improve performance with swap file

I've found that when I'm playing a midi file with many events (notes, pedal controls, etc), a reboot of my computer helps.

And as ReBased said, when Pianoteq is reloaded, all settings from the last session are there - a great feature.

Glenn

__________________________
Procrastination Week has been postponed.  Again.

Re: Improve performance with swap file

Pianoteq is mainly not sample-based (meaning it's not really RAM dependant), so doing things with your swap file isn't really gonna help. 99% of sound is calculated in real-time, whereas some small samples are fully loaded in RAM (pedal noise, short attack hammer samples, etc.) and used for playback, so that's just how it is.

Hard work and guts!

Re: Improve performance with swap file

ReBased: I'm using the VST version, which doesn't remember any changes.

EvilDragon: Just because it doesn't consume a lot of RAM doesn't mean the swap file cannot be a problem: if playing a certain note at a certain velocity requires reading even one single byte from memory and if that part of memory was moved to the swap file by the OS, playing the note will force the OS to freeze Pianoteq while it is reading the swap file. Even reading a small amount of data from a hard disk requires a lot of time (> 10 ms) because the read head has to physically change position, so this means Pianoteq won't be able to render any sound for a long while, which causes a crackle as the soundcard's buffers are not filled in time.

On the plus side, since as you point out Pianoteq doesn't consume a lot of RAM the problem should be easy to fix.

Last edited by pergol (23-12-2010 20:01)

Re: Improve performance with swap file

Pergol - I do not know what operating system you are using, but I think in Windows VISTA and Windows 7, at least, it is possible to use an external memory card or a thumb drive to hold the swap file instead of the hard drive.  Other operating systems or versions of Windows (i.e. Windows XP) might/might not have this capability, but I am not certain.  I have never tried this and have not researched it much (other than a quick search showing me this link: http://en.wikipedia.org/wiki/ReadyBoost), but if this capability is possible with your system, it might allow your computer to read the swap file faster and maybe it would improve your situation.  I do not know if it would be fast enough to make a real difference with the issue you have brought up, but it might be worth considering. 

I have thought it might be interesting to get one of these cards and plug it into the 5 in 1 card reader of my laptop to see if there was a noticeable speed increase, but have never gotten around to trying it.  If it was effective, I could just leave it in my computer all of the time since I don't use this card reading device very often.  Of course, when I did need to use the reader, I probably would have to reconfigure my computer before removing the card or the computer could crash, perhaps spectacularly.