i feel so stupid right now but i can't manage to do the simplest thing with my salt and pd.
here's an ultra simple example patch and it explains what my problem currently is:

alt text

i want to control the frequency of the bandpass filter with either the knob on my salt or incoming cv (cv2 i guess here). the adc~ 4 stands for the cv2 in, am i correct? the range of it is 0 - 1 and therefore i need to multiply it to get to the desired frequency, but the pd tells me that a signal outlet can't connect to a nonsignal inlet. ok, so i don't understand this, how do i convert the adc~ into control values?

    qree the range of it is 0 - 1 and therefore i need to multiply it to get to the desired frequency, but the pd tells me that a signal outlet can't connect to a nonsignal inlet.

    that's because [adc~] works at audio-rate, but the middle inlet of [bp~] works at message-rate. A typical way switch from audio-rate to message is something like

    [adc~ 4]
    |
    | [bang~]
    |/
    [snapshot~]
    \
      \
        [* 120]
        |
        [mtof]
        |
    [bp~ 8 5]

    bang~ here outputs a bang every audio block and it tells snapshot~ to take a snapshot of the incoming audio-rate signal once every audio block (16 samples on Bela). The (optional) *120 ->[mtof] here performs logarithmic scaling on the input across 10 octaves (effectively scaling the input to a 1V/oct) [I think!!]

    Note: each of the pots on Salt acts as offset to the corresponding CV input. So, if you have nothing plugged in, you will be able to swipe the pot across the input range and read values 0 to 1 in Pd. The full-scale input is 10Vpp. If you plug a CV in, you'd use the pot as an offset, so if the input that comes in is 0 to 5V, swiping the pot will determine whether you read in Pd 0 to 0.5 , 0.1 to 0.6 ... or 0.5 to 1.0 .

      giuliomoro thank you very much, everything works now!
      about that 1v/oct scaling... if i want pitch cv outputs of a pd patch, what's the conversion between frequency and 1v/oct? is it /120?

      As discussed above, Salt's input have a 10V range and the PD range is 0 to 1. In V/oct, we expect that to correspond to 10 octaves (120 MIDI notes), so using [* 120]---[mtof] we obtain a frequency value that spans 10 octaves.

      Salt's outputs are -5V to 5V, with a value of 0 corresponding to -5V and a value of 1 corresponding to 5V*. This means that again the interval 0 to 1 in Pd corresponds to 10V range (though with a -5V offset). In your patch, you may deal with frequencies (in Hz). Before sending it out, convert it to MIDI pitch with [ftom]. Divide its output by 120 and you will get your output value. Depending on where your frequencies are centered, you may have to add an offset to ensure that the output in Pd is between 0 and 1.

      * this is only theoretical. In practice the value is slightly off and should be calibrated. One relatively straightforward way of calibrating it is to use a final scaling factor before sending out the output from your Pd patch.

        6 days later

        giuliomoro
        As someone who just ran into weird problems, this stuff is confusing to me:

        So, if I connect CV input to CV output, they will not be same values?

        And examples that came with bela, midi to cv conversion was [midi value / 127], however that is wrong as I just witnessed. Midi note 40 will be 0.314, but when I run this into my modules, they will start to recieve cv only when the value is over 0.5.

        Also I do not understand pot offsets:
        If I have maximum cv value (gate) coming in, what does the pot do?

        BTW other way to make cv to signal connections is to use:
        [inlet~]
        |
        [env~]
        |
        [dbtorms]
        |
        [outlet]

          radiowaves So, if I connect CV input to CV output, they will not be same values?

          it depends on the value of the corresponding pot. If it is at its midpoint, they should be almost exactly the same values, minus the scaling I mentioned above.

          radiowaves And examples that came with bela, midi to cv conversion was [midi value / 127], however that is wrong as I just witnessed. Midi note 40 will be 0.314, but when I run this into my modules, they will start to recieve cv only when the value is over 0.5.

          that example is aimed at converting [ctlin] / [ctlout] to CV. The range of ctlin/ctlout is 0 to 127, so by dividing /multiplying by 127 it gets remapped to 0 to 1, which is the in/out range of Bela's I/O. This is one reasonable approach (remap the full scale of MIDI to the full scale of Bela's I/O), but it's also an arbitrary one. There are other options that work better for a specific application.

          You seem to want to be using it for MIDI notes and V/oct mapping, which requires to go through [mtof] etc as explained above.

          radiowaves but when I run this into my modules, they will start to receive cv only when the value is over 0.5.

          This may be an unrelated issue. I mentioned above that Bela's outputs are -5V to +5V. As you describe it, your other modules only start reacting when the output value in Pd is 0.5 or more, that corresponds to 0V or more. So it may be that these modules only respond to positive voltages and consider the negative ones to be the same as 0V.

          radiowaves Also I do not understand pot offsets:
          If I have maximum cv value (gate) coming in, what does the pot do?

          It depends on the voltages of the gate. Assume the gate is 0V when low and 5V when high. Then you'd expect to read a difference of 0.5 between the reading when it's low and the reading when it's high (assuming the input is not clipping). This is what you'd get:
          - with the pot at the min, you read 0 when the gate is low and you read 0.5 when the gate is high.
          - with the pot at the midpoint, you read 0.5 when the gate is low and you read 1 when the gate is high
          - with the pot at the max, you alway read 1 (because the input is clipping)
          [I think: I may be getting this backwards]

          Note that when you have a gate signal input, you'd better use the digital inputs, which are always 0:5V.

          radiowaves [inlet~]
          |
          [env~]
          |
          [dbtorms]
          |
          [outlet]

          I'd discourage this, I think it's more CPU intensive (or at least more spikey in CPU usage) than the one suggested above.

          Wow, thank you for so quick reply!
          You are saying that cv input and pot value are summed together.
          I always thought cv was only positive voltages. What you are saying I can run audio out from cv outputs of Salt?
          Still confusing, since in pd, audio is -1 to 1, but bela cv outs are 0 to 1 but scaled to audio ac voltages -5 +5?

          I tried to test the pots acting behaviour, but I am getting mixed results. On one occasion when I turn the pot 7, audio coming in from channel right got amplified, although it was multiplied by 0 before. Even if it wasn't, the pot should not have any effect on it, but it does.
          alt text

          I also get a lot of dropouts, especially when making midi dumps to midi out.

            radiowaves I always thought cv was only positive voltages

            There was a site http://redstripedown.net/spec.html that would outline common Eurorack voltage ranges, but apparently it's down now.

            radiowaves What you are saying I can run audio out from cv outputs of Salt?

            Yes you could, though they are a bit more noisy than the audio outs. Similarly you could use the CV ins for audio input (same caveat about noise).

            radiowaves Still confusing, since in pd, audio is -1 to 1, but bela cv outs are 0 to 1 but scaled to audio ac voltages -5 +5?

            Fair point. We kept the Pd range to be 0 to 1 on the CV in/out for compatibility with the rest of the Bela world where it is 0 to 1.

            radiowaves On one occasion when I turn the pot 7, audio coming in from channel right got amplified, although it was multiplied by 0 before. Even if it wasn't, the pot should not have any effect on it, but it does.

            Hmm that would be a weird behaviour. I can't tell what's going on from the patch you sent as I don't know where the signals are coming from. Maybe you want to try connecting [adc~ 1] (l-audio-in), [adc~ 2] (r-audio-in), [adc~ 9] (cv-7-in) and [dac~2] (r-audio-out) and try again? Note that the two audio inputs are half-normalled together, i.e.: when there is nothing plugged into the R input, the L signal will go to both.