Off the back of comments on one of the answers to this question: How do room layouts affect tuning?
So, I know the short answer is "It depends on the instrument", but ideally I'd like to know a few rules and enough reasoning behind them so that I can understand the physics and theory to generalise further. I'm talking "short term" temperature changes, and the scenario is: you've rehearsed in a cold and empty auditorium (some people wore gloves), now the audience has show up and the room is noticeably warmer (they're fanning themselves with their programmes - it's hot!). What characteristics of your instrument dictate whether you need to sharpen up or flatten down and why?
Context: I'm a flute/piccolo player and have played mostly in wind bands, sometimes in orchestras. I know that my instrument is generally flat when cold and that the band usually "warms up" before tuning. I also know that if we haven't been playing for a while in a cold room, some wind players might blow warm air through their instruments before playing.
Previously, I'd assumed it was to do with the instrument dimensions. I assumed that for a flute, warm metal expands inwards (as well as outwards), the tube narrows and the pitch goes up. For some reason I'd never considered that the heat would cause it to lengthen, too, and that this increase in length would cause a (fractional!) decrease in pitch. Turns out I was wrong about the metal. This calculator suggests that the tube would actually only get bigger, so my theory about the metal expanding and somehow sharpening the pitch is wrong.
Comments on this question: How do room layouts affect tuning? imply that what is really affecting the tuning is the speed of sound changing in warm air. This makes sense since:
v (speed) = f (frequency) times w (wavelength)
If speed goes up, either frequency or wavelength (or both?) must also go up. And warm air with less molecule density will propagate sound faster. And air is probably easier to warm than metal (although air in a warm metal tube will stay warmer than air in a cold metal tube). But I am also aware of the counter example in the comments where a loudspeaker set to produce a 440Hz signal will produce that sound regardless of the surrounding air/medium. And I'm also aware (from the comments) that string instruments going flat in warmer temperatures makes sense - the string material lengthens, tension decreases, flatter notes.
So, part of my question is really is there some relationship between the material that vibrates to cause the sound and temperature and pitch? Is speed of sound in warm air only relevant when the sound is caused by a vibrating column of air? Or is it still relevant for the violins, just that the dominant factor there is the loss of tension?