for my keyboard instrument, i'm using envelopes to control volumes.
i was generating those with [line] objects, but i noticed crackling/fast clicking sounds with short rise and fall times, like stepping noises instead of a smooth curve.

without actually knowing what i was doing, (or why, exactly) 🙂 i played around with block sizes to try and remedy the issue, because it sounded like an audio/logic conflict. you know, with audio tasks 'pushing back' computational logic over time. but maybe that's way too simplistic.
all to no avail.

in the end, i seem to have cleaned everything up nicely by running the envelopes from a [line~] object instead.
can anyone explain to me, in layman's terms, why this would make such a huge difference?

a non tilde (~ ) object like line will generate a stream of messages while a line~ object generates an "audio" stream. for an adsr (to control an audio signal) line~ or vline~ is much better since you modulate an audio signal with an audio signal.

okay, that much makes sense, thanks!
and is the difference between the two the speed of the stream then? as in: line~ sends out at 44100hz?
or is it rather the 'kind' of message?
trying to learn for the future here, so i'd like to understand what i'm doing..

    Remork

    think of a ~ signal as a continuous stream (output is processed every block, so all 16 samples by default BELA settings, but you can still have 16 different values in that block) so basically able to change at samplerate. (you can upsample and downsample parts of patches to change that) a message is more like an event. you set a message to the number 2 and it is sent out. the next tick that object won't output the number 2 anymore.

    afaik there is no message rate in PD, you can generate very fast changing messages, even in zero logical time. for example counting to 255 with an until object in zero time...

      lokki think of a ~ signal as a continuous stream

      hmm. that's exactly why i was using [line] as opposed to [line~].. i didn't think i needed to burden the processor with a continuous stream of what is mostly the same number.
      but then that does seem to matter when it does have to change, so i'll roll with it.
      still not sure if i completely understand why this was happening, but that's more to do with my brain than with your explanation 🙂

        Remork

        line might produce a steppier result when fed with the same input as line~ but you should be able to change the output rate of line, look at the help file. i am not at my pc atm, so cannot check. generally it is not advisable to mix messages and signals in PD, and for many objects this simply does not work! hence the two cable types. there are of course exceptions to this as you already explored 🙂

        i am also not sure that line~ is much heavier then line on the CPU.

          aha! the "grain rate". i never even set that. 🙂
          and afaict, line~ doesn't load the CPU any more than line.. my patch keeps on floating at around 26%. if there is any difference, it sure as hell won't be much.

          cheers for the help!

          lokki generally it is not advisable to mix messages and signals in PD

          and i'll take that one to heart in the future. lesson learned!

          One issue with [line]'s output is that, regardless of how small the grain size, it won't be sample-by-sample, and if it was, it would be extremely more expensive than [line~]. One of the reasons why this is the case is that messages come with computational overhead. As it is not sample-by-sample, it will always have some larger jumps in its output than those that [line~] can achieve, which in turn means that it may generate more audible clicks than [line~]. Ultimately, I would use [line~] every time I am scaling or more in general controlling audio signals.

            giuliomoro regardless of how small the grain size, it won't be sample-by-sample, and if it was, it would be extremely more expensive than [line~]

            well, that seemed very counterintuitive to me, for some reason. don't know why. but what do i know? 🙂

            giuliomoro Ultimately, I would use [line~] every time I am scaling or more in general controlling audio signals.

            i'll definitely remember that! it all runs very smoothly now, very happy.
            i also improved my (potentiometer) analog read hysteresis method last night, with more stability and greater resolution to boot. it's by no means perfect, but it does seem more efficient than before. will share later.