I use [f0.drunk] and [f0.rand]. I was hoping that floating point drunk and rand or urn would be incorporated into Max, but until then, I highly recommend checking out Fredrik Olofsson's externals and abstractions:
For drunk I would use lp.zzz or lp.pfff or lp.pvvv or one of the other colored noise objects.
Drunk is a Brownian motion in the integer domain. Lp.pfff is Brownian motion in the real (floating point) domain.
Lp.pfff and lp.sss are in the Litter Starter Pack, the other Litter Power objects are in the Pro Bundle. URIs below.
For urn--Litter Power also has a more 'powerful' version (lp.ernie), but it is also in the integer domain. To be honest, the basic urn model doesn't make sense in the floating point domain. The urn model is that of a finite number of discrete possible "events". Any floating point domain is (approximately) infinite. So could you be more precise about what you want? If what you're after is a choice of several discrete floating point values, then you can combine ernie (or urn) with a trigger object. See patch below.
Thanks all! Great suggestions. Duh, not sure why I didn't just think of dividing. But it is strange that such a common object wouldn't have a float version included or accept them. Is there some clear benefit to that (other than some processing overhead, I suppose)? Just curious...
> Thanks all! Great suggestions. Duh, not sure why I didn't just think of dividing. But it is strange that such a common object wouldn't have a float version included or accept them. Is there some clear benefit to that (other than some processing overhead, I suppose)? Just curious...
Historically, Max was MIDI-oriented, and hence integer-oriented. Also, when Max was first developed, integers were significantly faster than floats on the CPUs available.
It's still not clear what you want from a "float urn". The animal doesn't make sense. Unless you can specify what you're after (which is probably not really a float urn) there's not going to be any headway.
In a similar vein, the way drunk implements Brownian motion is inherently integer-oriented. When I began work on Brownian noise for Litter Power, I actually built a plug-and-play float replacement following the model used by drunk, but found that it didn't work well. When I researched the literature about Brownian noise and related topics, I discovered algorithms that provide more satisfactory results, but were universes away from the range/step size model used by drunk.
If you can get what you want by simply dividing drunk's output by an arbitrary factor, let me go into rabbinic mode and ask what would the benefit be of building a "float drunk"? Aside from the image of an inebriated cherub wobbling erratically with well-oiled wings, which does admit a certain charm.
OK Peter, I do see your point about [urn] as a float. For application at the moment, the specifics about the 'random' number aren't all that relevant-- Forget the [urn] thing and let's just say [random]. All I want to do is generate some random number within a given range to feed to [line] and then to [phasor~] for gain values-- Hence the need for floats. Your objects look great at first glance (need to glance again) and Chris' solution of dividing is just fine. I just figured it might be a fairly common need, and was surprised it wasn't 'officially' incorporated into Max.