Tags: posts polarity-music

Getting Started With Plug Data: A Tutorial on Pure Data Patching

Tutorial | Oct 26, 2022

In this video, I introduced Plug Data, a plugin wrapper around Pure Data. I showed how to use it to create an oscillator and an amplifier and how to use the Node In module to control the oscillator with a MIDI keyboard. I also showed how to use the help page for each module and how to save the patch.

You can watch the Video on Youtube - support me on Patreon

Questions & Answers

Maybe you dont watch the video, here are some important takeaways:

What exactly is Plug Data?

Plug Data is a plug-in wrapper around pure data that allows for patching using a wide range of tools. It takes pure data and creates a new interface for it, holds it in juice, and adds third-party libraries like ELSE and Cyclone, making it easier for users to make patches.

How do I download Plug Data?

To download Plug Data, you can go to the Releases page on GitHub and download the latest stable patch. Alternatively, you can also use the latest nightly build found in the Actions tab. It will be a zip file with an installer, which can be installed on your system as a VST3 plug-in.

How do I use Plug Data?

To use Plug Data, you can create a new patch, lay out modules on the grid, and then use the empty objects, numbers, and messages to begin adding components to the patch. You can also use the presentation mode to change the values of numbers and audio signals, and you can use the DAC tilt module to output the audio signal to the DAW.

Transcription

This is what im talking about in this video. The text is transcribed by AI, so it might not be perfect. If you find any mistakes, please let me know.
You can also click on the timestamps to jump to the right part of the video, which should be helpful.

[00:00.000] Hey, folks, welcome back to another video.
[00:02.080] Today, I want to introduce you to a new project
[00:04.480] called Plug Data.
[00:06.320] This is the GitHub page.
[00:07.640] The link is in the description below if you want to try it out.
[00:10.800] And this one is a plug-in wrapper around pure data
[00:14.680] to allow patching in a wide selection of doors,
[00:17.720] which means it takes pure data, creates a new interface for it,
[00:24.240] hold it in juice, and adds also third-party libraries
[00:29.680] to it like ELSE and Cyclone.
[00:32.120] So we have widgets available in here.
[00:35.080] And it also has a dark mode, which is really helpful.
[00:39.120] And the patcher itself is very nice to use,
[00:43.520] compared at least to the raw pure data patcher.
[00:48.040] And it's all available as a plug-in inside your door
[00:51.960] or inside of Bitwig Studio.
[00:54.200] So you can go down to the pure metal raw stuff
[00:58.840] inside your door with this plug-in, which is really, really nice.
[01:03.360] It's also completely compatible with pure data patches.
[01:06.760] So when you find some pure data patches on the net,
[01:09.280] you can use that or just implement it in this plug-in
[01:12.400] if you want to.
[01:15.160] If you want to download this, you can go here to the Releases page
[01:19.120] to download the latest stable patch.
[01:23.680] Or you can use, like I do, or like I did here with the Actions tab,
[01:29.080] just use the latest nightly build.
[01:32.480] You can see it's currently building here.
[01:35.160] I used this one here, I think, 18 hours ago.
[01:39.120] Just click on that.
[01:41.400] Also, the green check mark shows you
[01:43.080] that the build was successful.
[01:46.440] And then you can scroll down here into the artifacts,
[01:50.040] and you can download here the zip files for Win64 or Linux or Mac OS X.
[01:58.120] When you download this, it's basically just a zip file in there.
[02:01.720] There is an installer.
[02:03.760] When you install it on your system,
[02:05.680] then it's available inside your door, hopefully, as VST3 plug-in.
[02:12.160] And you can search for it with plug data, as you can see here.
[02:16.840] It's a VST3.
[02:18.880] And then it's available inside your door,
[02:22.600] like an instrument or like a VST effect.
[02:26.280] In here, you can start to patch things.
[02:29.200] And I want to show you a small patch, how you can start,
[02:35.440] and how it works, how basically, yeah, what you can do with it.
[02:42.080] So in here, we create a new patch,
[02:44.240] and you can see there's a grid where we can lay out certain modules.
[02:48.920] It's exactly like the Poly-Grid or Note Grid,
[02:51.440] in a sense, but it's much more lower abstraction than a grid.
[02:58.880] So here, in there, we can create a new object.
[03:01.840] And usually, you want to use an empty object, maybe a number or message.
[03:07.280] But there's, of course, more stuff here.
[03:09.200] For instance, like high-level abstract widgets like an oscilloscope here,
[03:13.920] which we probably want to use to show or to see what's going on.
[03:19.440] So let's create an oscillator.
[03:21.480] And to create an oscillator, we need an empty object.
[03:24.840] And we can also use your control and one.
[03:27.080] And I think the shortcuts are basically the same as in MaxDSP.
[03:31.120] So in here, we just hold control and one and create this new empty object.
[03:35.800] And you can see there's a cursor flashing.
[03:38.280] And it awaits something we can type in.
[03:41.080] So we type in OSC for oscillator.
[03:44.600] And there's also here auto completion.
[03:46.600] So we can use the arrow keys to go down to OSC tilt.
[03:52.960] And tilt basically means that the output of this module is a signal.
[03:58.520] And blue means the output is data, a data signal.
[04:04.520] And orange means also it's an audio signal.
[04:08.600] So orange audio signal, blue data signal, right?
[04:12.680] Also, the tilt is very important.
[04:14.480] You need to input that just to return.
[04:17.400] And you can see we have now here a new module.
[04:21.480] Maybe let's zoom in here a bit more so you can see it better.
[04:27.240] Just for the screen recording here.
[04:32.440] OK, you also can see we have here an orange input and orange output,
[04:37.240] which means it inputs an audio signal.
[04:39.920] And you can also output an audio signal.
[04:42.120] Also, the oscilloscope here takes an audio signal as an input.
[04:47.040] So we can connect these two.
[04:48.960] There's nothing going on here because we haven't made any inputs here to the oscillator.
[04:57.080] So now we need to change the frequency of this oscillator.
[05:01.920] And it takes your frequency value in hertz.
[05:04.280] So what we need is a number.
[05:05.560] So control and three, and we create a number box and we can connect these two.
[05:12.240] And to increase this number, we need to go to presentation mode.
[05:16.280] And presentation mode are available when you hit control and hold control like this.
[05:24.160] Or when you use this lock symbol down on the left side here,
[05:30.800] you can switch to permanent lock mode or permanent presentation mode.
[05:36.280] But if you want to just change the number instead of moving this around,
[05:40.080] so you click and hold and you can move it.
[05:41.880] But if you want to change the number, you just hold control
[05:46.200] and can increase the number maybe to 50 hertz.
[05:53.880] And you can see here the wave unfolding in the oscilloscope.
[06:00.080] And the wave here has maximum volume.
[06:03.040] As you can see, it's already clipping here.
[06:05.520] So we need to change the volume or the gain or the amplitude, whatever you want to call it.
[06:10.480] So we can do this with an operation.
[06:12.760] And the operation is called multiplication.
[06:15.800] So we introduce a new object here, an empty object with control and one.
[06:21.680] And you want to multiply something here.
[06:24.280] And we also want to change the audio signals.
[06:28.560] We need to tilt.
[06:31.520] We take this and then we hold shift while we are tracking this.
[06:36.000] Hold shift, move this in between here.
[06:38.240] You can see it snaps in between.
[06:41.720] And it cuts here the signal already, which is pretty nice to do.
[06:47.360] And we have now this operation here in between the output of the oscillator
[06:51.080] and the input of the oscilloscope.
[06:54.240] So now this one takes your second input, which is probably our volume value.
[07:01.080] So we need a number.
[07:02.480] We take this number here, hit control and D to duplicate this.
[07:06.240] And we can take the output of this to the input of this operation.
[07:10.720] Now we can go to presentation mode with control and increase here the volume.
[07:16.040] So you can see it goes up.
[07:18.320] But we never want to go higher than one.
[07:23.440] Probably because one is the maximum value of the internal calculations or whatever.
[07:34.720] So there is no db or anything like that.
[07:38.160] One is the maximum, zero is the minimum.
[07:41.720] We can select this box and go to the inspector on the right side
[07:45.440] and can choose a minimum value of zero and the maximum value of one.
[07:52.440] So maybe we go to zero dot nine, so not maximum one.
[07:59.240] So we can increase this here only to zero point one.
[08:03.360] And we can't go lower than zero.
[08:08.200] Just for safety purposes.
[08:10.680] So now that we have this, we also want to output this maybe to our DAW.
[08:18.320] So we can hear actually something.
[08:20.840] And to do that, we need a new module.
[08:23.760] So we use control and one.
[08:26.800] And this module is called DAC tilt.
[08:29.800] Of course, we want to output our input audio signal.
[08:34.520] And it's probably the shortcut for digital audio conversion or something like this.
[08:40.440] And it takes two inputs here.
[08:42.200] And this is of course our audio signal.
[08:46.680] Now we can increase the volume and the frequency.
[09:04.680] Nice.
[09:07.680] So that's all good.
[09:09.280] And we can hear already something in the DAW.
[09:11.840] But we want to also change maybe the frequency with our keyboard
[09:15.840] and maybe want to increase the volume when we press a key.
[09:18.840] And when we release a key, we want to decrease the volume.
[09:23.200] And we can also do that in here.
[09:26.120] And I'll show you just how to do that.
[09:28.240] We need new, we guessed it, a new module.
[09:31.720] So we hit control one for an empty object.
[09:35.000] And this one is called node in.
[09:38.200] And this one gives us three new signals, data signals.
[09:42.640] This one here is the node number.
[09:45.000] This one is the MIDI velocity.
[09:47.160] And this one is the MIDI channel port.
[09:50.240] So just for the information, if you want help about some of these modules,
[09:56.240] you can do that by just holding Alt on your keyboard
[10:00.040] and click on one of these modules here.
[10:03.480] And it opens up this kind of tab.
[10:06.760] Yeah, it's a tab with a sub-patch.
[10:10.000] And it shows you what the node in can do.
[10:12.280] You've got also some examples here,
[10:15.840] how to use it with different other modules, a lot of text.
[10:19.360] So it's a nice little help page you can use.
[10:22.680] And you can also just copy stuff out of this edge
[10:29.240] or this help page and can use it in your own current main patch.
[10:34.800] So this was a crash here.
[10:36.600] And this happens, yeah, it's basically not released yet.
[10:45.080] Maybe I want to increase this here.
[10:48.520] Let me see.
[10:52.160] Yeah, let's use that.
[10:55.880] Yeah, so this is how you open up the help page.
[10:58.560] So we can also do this here for the oscilloscope.
[11:00.440] So just hold Alt, click on it,
[11:02.760] and then you can see what's going on
[11:05.200] and how you use it with different combination of modules.
[11:10.440] You can also see this oscilloscope
[11:12.040] is part of the else library.
[11:14.120] So it's not pure data, a native pure data module, right?
[11:20.120] OK, so now we can create here or we
[11:24.880] have an oscillator playing with a frequency,
[11:27.720] with a set frequency.
[11:29.240] And you can also change the loudness.
[11:33.400] We want to use here now a MIDI on node in.
[11:38.800] Node in gets us three inputs.
[11:42.120] So the node number is not compatible with the frequency.
[11:46.240] The node number is a different kind of unit.
[11:50.800] So we have to convert the node number, the MIDI node number,
[11:54.960] to a frequency.
[11:56.720] We can do this with a module called mTOP, MIDI2 frequency
[12:06.640] conversion.
[12:08.200] We can go in here just with the node number,
[12:10.920] and then you get a frequency out of it.
[12:12.680] So we connect these two.
[12:14.360] And now when we place something on the keyboard,
[12:17.360] it's actually armed.
[12:18.600] Yeah, nice.
[12:20.000] When you place something on the keyboard,
[12:21.440] you can see the frequency is changing.
[12:24.120] Maybe increase here the volume.
[12:26.880] OK, so this works.
[12:38.760] To switch on the volume, when we press something on the keyboard,
[12:45.040] we can utilize here the velocity output.
[12:49.240] And the velocity is a value between 0 and 127.
[12:53.640] That's the MIDI standard.
[12:56.200] And when we go into here, you can see this one, the volume,
[13:00.800] is between 0 and 1, or 0 and 0.9.
[13:07.320] And the velocity is between 0 and 127.
[13:11.360] So we have to do some kind of conversion here
[13:13.840] to actually scale this a bit down.
[13:16.960] And we can do this with just the division.
[13:19.440] So we use a new module and say divide everything by 100.
[13:26.720] So 127, which is the maximum velocity value, becomes 1.27.
[13:33.960] Maybe we can divide this here by 127.
[13:38.440] It would be fine.
[13:39.800] And just hook this up here in between.
[13:44.440] And now you can press a key on the keyboard
[13:49.400] and also the velocity changes the volume slightly.
[14:04.760] So this kind of works.
[14:07.840] What you want to do now is probably
[14:09.360] to implement some kind of envelope.
[14:12.040] But I don't want to do that in this video.
[14:14.120] I just want to give you a rough idea how this kind of plug-in
[14:18.400] works, how pure data works, and what you can do with it.
[14:23.120] So we have your node in.
[14:25.440] So we get the MIDI data.
[14:26.800] We convert MIDI data to frequencies.
[14:28.760] We have an oscillator here working.
[14:31.160] The oscillator goes to an amplifier.
[14:33.920] The amplifier changes volume based on our velocity.
[14:38.440] And then we go out to the door.
[14:39.880] And we have also an oscilloscope here showing what's going on.
[14:44.720] So that's how it works.
[14:47.720] You can save this, of course, with your project.
[14:50.240] Everything in here will be saved with your project.
[14:53.480] And also, when it crashes, you can probably load up
[14:59.560] your last saved state.
[15:01.920] And also, saving is pretty easy.
[15:03.760] Just hit this button and say just tutorial.
[15:12.040] And it's saved.
[15:14.280] There are also things like sub patches.
[15:17.080] Three can create fancy envelopes, multi-stage envelope
[15:21.520] generators, or whatever you want to create.
[15:24.520] And then save it as a sub patch.
[15:26.680] And then load or bring this in here into your main patch
[15:31.720] and use it there without using or creating all that stuff
[15:36.120] every time from scratch.
[15:38.440] And there are also a lot of third-party libraries that
[15:42.840] give you stuff like this.
[15:44.520] But I want to show you how you use pure data here
[15:49.720] with the raw modules, more or less,
[15:51.840] or how this kind of stuff works.
[15:54.240] So that's it.
[15:56.360] Give it a try.
[15:57.120] The link is in the description below.
[15:58.560] If you have questions, please leave it in the comments.
[16:02.440] Leave a like if you like the video.
[16:04.360] Subscribe to the channel.
[16:05.800] Thanks for watching.
[16:06.840] And I'll see you in the next video.
[16:09.560] Bye.