# Using Tidal to control modular synths with CV

**URL:** <https://uzu.lurk.org/t/using-tidal-to-control-modular-synths-with-cv/863>\
**Category:** TidalCycles\
**Tags:** resources\
**Created:** [16 May 2020 07:36 UTC](https://uzu.lurk.org/t/using-tidal-to-control-modular-synths-with-cv/863 "2020-05-16T07:36:12Z")\
**Posts on this page:** 1\
**Showing post:** 45

<div class="post-metadata">

**Author:** ![colevscode](https://uzu.lurk.org/user_avatar/uzu.lurk.org/colevscode/32/2190_2.png) [@colevscode](https://uzu.lurk.org/u/colevscode)\
**Post date:** [19 January 2023 03:37 UTC](https://uzu.lurk.org/t/using-tidal-to-control-modular-synths-with-cv/863/45 "2023-01-19T03:37:36Z")

</div>

Thanks @julian, I'm getting closer using your advice.

I set up an Ndef in SC that outputs a continuous level:

```haskell
Ndef(\cvDef, { | freq = 440, lag=0.01 |
	var lagFreq = Lag.kr(freq, lagTime: lag);
	LinLin.ar( log2(lagFreq/440), -1, 9, 0, 1);
}).play(0);

```

The params to `LinLin` are calibrated for my external oscillator's 1v/oct range. Outputting 0-1 from this Ndef results in a 0-10v signal through my ES-9 audio interface.

Then I'm able to control it through this synth:

```haskell
~dirt.soundLibrary.addSynth(\cv, (play: {
	Ndef(\cvDef).wakeUp; // make sure the Ndef runs
	Ndef(\cvDef).set(\freq, ~freq);
})
);

```

And in tidal:

```haskell
d1 $ n "a6 a5" # s "cv" 

```

Result:

![Screen Shot 2023-01-18 at 7.24.12 PM](https://club.tidalcycles.org/uploads/default/original/2X/9/957d7ad5a613fb0202e3ae247ebf8c94bb8ad7fc.png)

It's nice also that I can get true portamento that can also be patterned, via the `Lag` ugen.

The part I'm hung up on is routing the Ndef's output buffer to the dirt synth somehow so it's not just always playing. However, this is just a nice-to-have since the CV will be gated by a signal on a separate channel. I may look into writing a module to emit `Ndef(\cvDef).start` and `.stop` commands.

I tried using the `playInside` functionality but couldn't get it to work. See [How to add a synth with `dirt.soundLibrary.addSynth` and playInside](https://club.tidalcycles.org/t/how-to-add-a-synth-with-dirt-soundlibrary-addsynth-and-playinside/4506/1).

---

_[View the full topic](https://uzu.lurk.org/t/using-tidal-to-control-modular-synths-with-cv/863)._
