fiddle~ (or sigmund~) in multiple M4L devices causes glitchy output
Hi all, I'm building a simple frequency analyzer M4L device using Volker Böhm's 64-bit version of fiddle~ (found here: https://cycling74.com/forums/fiddle-64-bit-version). I've noticed that when I load more than one instance of this device, each one on its own track, the frequency output of all of the fiddle~ objects in the Live set gets glitchy. It seems to alternate between 0, numbers in the tens-of-thousands, and accurate values. This behaviour stops as soon as the set goes back to having only one fiddle~ object in it.
The problem doesn't happen when multiple fiddle~s are loaded in a regular Max patch. It also doesn't occur if multiple fiddle~s are present in a single M4L device. It doesn't even happen if multiple devices are loaded on the same track.
Even weirder: let's say you have a single track, (1), with two M4L devices containing fiddle~, (1a) and (1b). Then you add a second track, (2), with another device containing fiddle~, (2a). At this point, (1a) and (2a) will be glitchy, but (1b) will be fine. If you then add a second fiddle~ device (2b) to track (2), (1b) will become glitchy. From this, it seems as if the M4L devices in corresponding slots across multiple tracks are affecting each other.
To see if the placement/ordering in the effects rack is what determines this, I created two tracks with fiddle~ devices, and then placed a Live Audio Effect (EQ Eight) before the fiddle~ device on one of the tracks. The glitchiness still happened. Adding a blank MaxForLive effect before the fiddle~ device also didn't prevent the glitches. In other words, it doesn't seem like the absolute position of the fiddle~ devices in the effects racks has to be the same across multiple tracks for this to happen. Rather, it seems like the first instance of fiddle~ device on one track will cause all the first instances of fiddle~ on other tracks to glitch out, the second instance will mess up all the second instances, etc., regardless of other effects/devices on the track.
Hopefully this convoluted account clarifies more than it obscures! It's very strange behaviour.
In case it helps, I'm attaching an M4L device containing fiddle~ and one containing sigmund~ (see below), as well as a Live 10 set where the behaviour is visible.
I have no idea if Volker is still around, or if anyone else with Max object development chops is able to take a look at this, but the source for the 64-bit version is here: https://github.com/v7b1/fiddle_64bit_version .
Edit: I just tested with sigmund~, and it's having the same problem. I added a gate~ to my test device, and found that sigmund~ and fiddle~ both glitch out even if the devices in the other tracks aren't receiving a signal.
If you're tracking a monophonic signal, would the native [retune~ @pitchdetection 1] do the job?
Hi Jean-Francois! Unfortunately [retune~] seems to have difficulty accurately reporting the frequency of a sine wave - in my experiments using [cycle~] as an input, it tracks accurately bet the frequency between about 95 Hz and 875 Hz, but outside that range it's inaccurate. [fzero~] has a slightly better range, but still only tracks a sine input accurately up to about 4.5 KHz. [fiddle~] seems to have much better accuracy with sine inputs, but unfortunately this weird M4L issue makes it unusable for me at the moment.
I can report exactly the same behaviors/conclusions for fiddle & retune.
Strange fiddle bug...
If anyone has a clue...
In Max/MSP 7 and 8, you can use built-in objects for tracking pitch and amplitude effectively. The pitch~
object handles pitch tracking, while peakamp~
and live.gain~
can track amplitude—just make sure to use the right outlet for live.gain~
. Increasing the buffer size can improve stability, and you can reduce the audio buffer resolution by setting an argument to around 50ms, which should work well. Plus, you can route data from a single instance of your feature analysis setup to multiple patches. also, as stated by fp, fzero~may be a decent approach to handle this
Enjoy your lemonade!
Thx for your suggestions. Did you read the first message of this thread?
I know all these objects and solutions you propose and tried it without success. You know I'm not new to Max...
[Pitch~] is not native but maybe you thought to [fzero~] that is definitely promising. I'll give it a try once again.
I was sticking to [fiddle~] because it gives the best results for my needs. I wanted to use several instances of the same M4L plugin but I know how to (and I will) make a special plugin with poly~.
Changing buffers doesn't change anything to this bug. We don't use it inside Max but Ableton. The bug appears only in that context.
Here I just want to know if somebody has any clue to solve this particular bug of fiddle~
Cheers