I tried train and replaced the noise input with a soundfile. Sample and hold was actually what I thought would be a good start, but the sound which came out did not correspond to the sound input. Maybe I have to set the frequency range.
I've never done it in Max, but you can do it in any DAW super easily to test if that path is worth exploring further. The compressor attack/decay/ratio will have a massive impact on the sound as that will control each 'grain'.
Vocoder and/or Cross synthesis are methods worth looking at for your purpose. There is an (old) example called "cross-dog" somewhere in the Max examples hierarchy that you should take a look at. There is also a vocoder patch somewhere too. Use your ambient source as the carrier, and a drum loop or rhythm pattern as the modulator
Probably easier to go the other way, i.e. gating the sound, with the gate being opened/closed by your rhythm track, using some kind of thresholding to trigger the gate. I probably have something somewhere...
I think built a Pluggo years ago that used Midi note-on's to trigger a gate, back when that gated pad sound was a pre-requisite to all trance music ;-)
I meant 'the other way round' meaning as opposed to compression, btw. Here's a very quick n' dirty gating example.
And yes, convolution is the other classic method for imposing the rhythm of one sound onto the timbre of the other - or vice versa,
thanks for the patch. It seems to have the right parameter control, but I can't get a good sound out of it. Attack, sustain, release would be good to be controlled. When you use your patch do you still hear the original sound input?