On The Inside

On The Inside

Friday, November 20, 2015

Technics 1200s, the Last Repair

If you DJ, and you play with vinyl, then you've probably had to deal with the annoying repair of the RCA cables that are permanently attached. I've repaired these numerous times for friends. Recently, my own 1200's started developing cable problems that can't be fixed by just wiggling the cable a little bit :)

I don't enjoy this type of repair, and I don't think that it should be necessary, so I decided to just modify my decks to not have to deal with this ever again. In the process, I switched my decks to self grounding via the signal connector. This is a potential safety and noise issue, but with how we're using decks these days, I'm not convinced that either are really relevant. That said, I like to live dangerously, "you" shouldn't do this without consulting your lawyer, your city or county building codes, an electrician, your grandmother, a priest, and perhaps a fortune teller just to be on the safe side.

Basically, I'm going to add some jacks to my turntables so that I can just use any set of RCA cables, and in the process, I'm going to eliminate the ground wire.  If you take your decks apart, you will find the tonearm area underneath a steel cover. It's removed here, and I have the new cover with the jacks and wires soldered in place.

The steel cover could be modified, but I think that this is neater.
I used a scrap piece of PC-Board material to make the replacment cover, and drilled a couple of holes to mount the RCA jacks. Pay attention to the positioning, you don't want to bump into the circuit board or any of the tonearm metal. The lines on the plate were to help me position the holes. The circle is drawn with the plate and bottom cover in place.

In the next picture you can see the plate bolted into place. Remember kids, red is right, everything else is left. You want to mark them to avoid strange phasing issues later when you're using two decks. It doesn't really matter much otherwise. 

With the back cover in place, I hope that you can appreciate the wisdom of taking the time to mark the opening.  It's working perfectly, no more dropouts or mysterious hum in the middle of a session.  Cables may still go bad, but now it won't take the better part of an afternoon to repair them, just unplug, toss, and replace.

Tuesday, October 27, 2015

Reaktor 6, Faking Blocks with "Mocks"

Fig 1. Simple "Mocks" VCA that will work with Blocks.
Reaktor 6 blocks sure seem to be getting a lot of attention. Interestingly, users who haven't done much building in the past are viewing blocks as a gateway into understanding the internals of Reaktor. The idea of building just one part of a synth seems less daunting than the idea of building an entire synth.

On the one hand, the general idea is  true. Because you don't have to build the entire synth, just a block, then there's less to learn and you can focus on just that one thing. On the other hand, blocks are painfully complicated for the Reaktor newcomer, so building proper "blocks" is not really a good place to start learning. That said, you don't have to build proper blocks to combine blocks with your own creations. They're just instruments with audio ins and outs. If you don't mind a few compromises, then it's possible to make blocks-like modules that work with blocks.

A Trivial Example


Suppose that you wanted to build a VCA from scratch in Reaktor. Well, at a very basic level, it's trivial, it's nothing more than a multiply. You can certainly just put this in an instrument and use it with blocks, it will work fine.

Figure 1 shows what the structure of such an exceedingly simple VCA might look like. I call the instruments described in this post "Mocks, short for Mock Blocks. They look like a block, they act like a block, they are compatible with blocks from the user's perspective, but they're not blocks according to Native Instruments.

Fig 2. Mocks Silly VCA in a simple synth.

I've added the stacked size macro to force it to block size and the text module to give it a nice blocks-ish front panel look. It's a bit silly, but it works. It might look something like Figure 2 in your blocks synth. Here I've used  a background lifted from the Bento Box VCA. While you're at it, no point in going halfway in the looks department, it's easy enough to add the icon image so that the structure is even pleasant to look at. Granted, there isn't much value to putting a multiplication inside an empty U/I, this is just a trivial example,
Fig 3.  Structure of the simple synth shown in Figure 2.
So, sure, the idea of using blocks to understand synth parts is perfectly valid. You don't have to create a block just to learn how to create a part of a synth in Reaktor. Just make sure to scale the inputs and outputs appropriately. Some are going to present more of a challenge than others, but learning how to interface the two worlds will provide good motivation for learning more details of building with Reaktor without the daunting experience of starting from ground zero.

While there is a lot to be said for adhering to the blocks "standard", building blocks with primary process macros, or even, as I did above, with no macro at all, still leads you to an instrument that can work. Even some of NI's "blocks" use primary process macros. The "Note in" is an obvious example, but the Monark oscillator wraps the core macro inside a primary macro. My guess is that's an early block and they decided later to go with core process blocks, but, it is still an example and uses primary to generate a random seed.

Fig 4: Top level of a Mocks Mixer
Personally, I think that the two best features of blocks are the introduction of "separation of concerns" into the Reaktor builder mindset and the introduction of standard sizes for instruments. I've been building my stuff like this for a while, but having it sanctioned by NI means that others will follow suit. I suspect that the current incarnation of blocks is some intermediate step in the evolution of Reaktor and that at some point in the future having instruments with non-core process blocks will break some feature, e.g., maybe you won't be able to take advantage of multicore if you aren't using true blocks. For the present, it really doesn't break very much to have non-core process blocks, as long as one takes care of the inputs and outputs properly.

A Better Example

Here's the mixer from my poly nano ensemble from the user library. Note that I don't call this a block, and I didn't upload it as a block, but you can believe that I use it as a block. You don't need core to make a simple un-modulated mixer and this breaks absolutely nothing and works exactly as you expect with any blocks patch that you build.

Fig 5. Process macro of Mocks Mixer from Poly Nano
 There are no modulation inputs and, thus, no expectation of audio rate modulation. Note, that doesn't mean that you couldn't incorporate modulation inputs, but they're certainly quick and dirty to create if you don't have to think about modulation. Inside the process macro is exactly what you would expect, a couple of primary mixer modules with level inputs scaled to work with a linear knob.

Fig 6. Mocks Mixer panel macro.
The panel macro is shown in Figure 6. and it just contains all of the nice blocks U/I bits that make them pleasant to look at. At the top level there is the stacked macro that forces the size and the text that gives you the logo. I should have named it "module name", but I did this quickly.
Knobs are kind of a pain in blocks because you have to include several images layers to build up the look.The knob shadow, for example, isn't in the knob filmstrip. Even with a Mocks block I still want to have a nice looking panel and so I create macros for knobs so that it makes them easy to move around. By selecting the macro in the structure, you can move all of its contents around in the panel view. 
Fig 7. Knob macro from mixer panel.
 The inside of the panel macro can be seen in Figure 7. As discussed above with the simple VCA, none of the separation of concerns or encapsulation is really necessary to make this work with blocks, it just makes it easier to reuse the parts of it in other instruments. Adding modulation is not difficult, but, you want to pay attention to event rate vs audio rate signals. I'm going to use a simple example from the factory library that already has an audio rate modulation input.



An Example With Modulation

Fig. 8. Factory "filter" module from the library.

There are several filters and oscillators in the factory library. At first you might think, why would I care, blocks has plenty of choices. This is true, but, the blocks that come with Reaktor are CPU hogs. Often you might have a need for a filter that won't be pushed to the limit and so the value of fancy new technology is just wasted in extra CPU cycles. Or, simply, perhaps you prefer the filter response curve that's displayed in the factory macro. I'm going to use the State Variable macro that is in the library under filters, it's just called, "filter." Figure 8. shows what this macro looks like as shipped from the factory.
Fig. 9. Mocks SVF
The standard macro is fine, but it won't fit well with blocks. It's easy enough to rearrange the panel elements and change the knob images so that it looks something like Figure 9. I changed the list for filter type to a menu. To allow control of the modulation input, I added a single knob to the panel macro and connected it to a terminal as before. I've added a background and the 3U stacked macro to the instrument so that it is blocks compatible, visually speaking.
Since the modulation input to the macro is already an audio rate input, there is no reason that we can't use this directly with Blocks. The only thing that we need to do is to provide scaling. Now, if we were committed, we could actually create a true block out of this macro since it is core at its core (you knew that was coming). But, I don't always need or want all of that U/I. The big win comes from the consistent size and the slightly larger knobs and panel elements. To control the modulation amount, we only need to add a simple VCA, like above, between the ModA input and the mC modulation input to the macro. That's really all that you need to control modulation, all of the rest of the stuff in the Blocks U/I is to show you pretty modulation rings, flashing lights, and mouseover values. Yes, they're useful, no, they're not essential, yes they consume CPU!

Fig. 10. SVF Modulation input. 

That's it, now this can be used with other Blocks just as you would use any other Blocks filter. Will it sound as good? In a word, no! But it is useful, and it's not incompatible with Blocks

Fig. 11. Mocks SVF added to the simple synth from above.
Blocks make building up synth patches fast in Reaktor 6. Many of the factory blocks use relatively new technology which is why they sound so good, so it's understandable that people are excited about building blocks. If you want to create actual blocks that can be uploaded to the user library and shared with other blocks users, then you should take the time to read the NI blocks document and download the template. On the other hand, blocks are not the only way to create modular instruments in Reaktor. There have been many different efforts over the years and it isn't necessary to throw out the old baby with the dirty bathwater. In some cases, such as the mixer above, the "core" advantage to sound quality is slim to none. Consequently, it makes sense to resuse a lot of what already exists alongside the new technology. These older macros and instruments can not only be combined with blocks, but, their contents can be given a face lift to make them easy to use with blocks.


Thursday, October 8, 2015

Reaktor 6 Blocks - Multi BreakPoint EG

I'm really enjoying a lot about Reaktor 6. The new Blocks format is, on the one hand limiting because they are monophonic, is still a lot of fun and great for rapid instrument prototyping. They do remind me a lot of working with the Nord Modular.

In Reaktor 5 one could do reasonably rapid prototyping with one of two macro collections provided by NI. Both the building blocks collection and the classic modular collection of macros behaved similarly to blocks, they just aren't quite as sexy looking, or sounding.

Since blocks are new, there's still a lot of room for improvement in the diversity of available tools. For example, there were some very flexible and complex tools in the aforementioned collections. One that comes immediately to mind is Erik Weigand's multi breakpoint envelope.

I converted this macro to blocks format, which wasn't too bad since most of the heavy lifting in Erik's macro is done in a core cell. However, it's no small task to get all of the bits of the new user interface elements lined up, something that I wish NI would work on improving.

I've added modulatable time scale and shape factor, added switchable velocity sensitivity, and change the color scheme to be similar to the bento blocks. 

It's free for Reaktor users and you can get it in NI's User Library. Please feel free to leave any comments or feedback, bugs, issues, feature requests, either in a comment here, the user library, or in NI's Reaktor forum.

Sunday, August 30, 2015

Getting Started with High Level Plugin Design: Synthmaker/Flowstone, Synthedit, Max for Live, or Reaktor?

A lot of people are interested in getting started with synthesizer programming but are unsure about how to get started. I'm a computer scientist by training and have no problems using low level languages like C or C++. However, even for the experienced, that can be time consuming. For the initial high level prototyping, I tend to still prototype in Reaktor.  I don't think that there's a better choice for this kind of work. If you want to consider some basic idea for a plugin, you can probably find the pieces of that idea already in the library. You can also integrate various testing tools into the prototype environment itself. If you choose to start with Reaktor, then I think that the most direct comparison and simplest transition is to Synthedit. You will find the environments similar on a basic level. An advantage of Synthedit is that building externals is fairly straightforward.  This combination gives you a fairly nice path as follows:

1) Develop ideas using high level prototyping in Reaktor
2) Build prototype of fixed idea in Synthedit
3) Build externals for each of the components in your synthedit prototype.
4) Merge previous externals into a single synthedit "synth/effect" external.
5) Transition to SDK using your synthedit synth/effect external as a starting point.

You could skip right to step 2, but, I find Reaktor so much more immediate and complete, that I find early stage prototyping less annoying in Reaktor. You will also find that Reaktor is fantastic just to have as an effect and synth plugin. Really, for anyone that creates music and wants to go down this path, I think Reaktor is THE starting point. The reason that you don't skip right to step 4 from 2 is that the existing modules in Synthedit allow you to add your C/C++ code one module at a time. For example, if you're building a synth, after you get it working fairly close to your goal, maybe you want to build a specific filter. You can develop this module while keeping all of the standard Synthedit modules in place. You can release this at any time, of course, choosing to incrementally develop more and more of your synth in C/C++. When you have the core developed, you can then transition to a cross platform version of your synth.

Synthmaker: I like synthmaker, it has become Flowstone. Synthmaker/Flowstone will get you to a nice looking plugin much faster than synthedit. You can have something to upload and give away with a weekend's worth of work.  Underneath the hood, however, it's quite a bit more complicated and it doesn't have the nice path that synthedit does to creating a C++ plugin. That said, it has a very nice DSP language that you can use to code up blocks and I've found this helpful for algorithm experimentation. It's often much more immediate at a low level than Reaktor because you don't have to drag a bunch of blocks around in order to add two numbers. Is it worth the price of entry?  For most people, I don't think so. On the other hand, If you don't want to learn C++, you do want to create 3d modeled looking synths with a minimal of effort, and you are willing to accept the stock controls, synthmaker is the fastest way to get to a good looking windows plugin.  If you want to go beyond that, you should measure its utility by asking whether what it does well is worth it to you for some part of your process. If you want to get the basic feel of Synthmaker, then you can get SynthMakerCM from most issues of computer music magazine. It has many demo-ish limitations, but, it's cheap and you can see what it can do at a basic level. IIRC, you can generate a VST with SynthmakerCM as long as you don't mind the UI having a SynthMakerCM logo on the front.

Max: I love MFL (max for live) primarily because it allows me to build user interfaces that work in the live environment. If you already own and use live and want to upgrade to suite, then this is probably worth the investment. There are quite a few practical elements in the MFL library so it's not bad for that first prototype, but, it doesn't translate as well to synthedit as Reaktor does as there are quite a few work/thought-flow differences.  If you have full blown Max there is a feature similar to synthmaker called GEN that allows you to write modules in a terse DSP like language. I tend to prefer Max+Gen, as opposed to SynthMaker, for this kind of experimentation now, but this doesn't come with MFL and I don't know if you can buy just the Gen license to add to MFL. In any case, it's an expensive route and I think Max has quirks that are in some ways more difficult to master than Reaktor/Synthedit; granted, some things are decidedly easier.  Max does allow you to use externals so it can be a bridge to coding your own fully C/C++ plugins, although for me, it's not quite as straightforward as Synthedit.

Pd: Pd is just open source max with a lot less of some stuff and some more of other stuff. If you think that you might get on with Max or MFL, download Pd first, it's free.

tl;dr: Reaktor is the place to start, Synthedit provides the most straightforward natural path from "Reaktor idea" to "C++ plugin." SynthMaker provides the shortest path to released plugin that looks good, but it doesn't provide a natural path to C/C++. Max/MFL/Pd are cut from the same cloth, they have a different thought/work flow, some say higher learning curve, MFL is a natural fit for Live users and these tools provide some path to C++ plugin development, but it's not as straightforward as Reaktor+Synthedit.

Wednesday, May 20, 2015

On Filter Response

In a previous installment I showed a filter pulled from a CB radio. I've been battling with the filter impedance thing for some time now and can't seem to get a good method to reliably determine filter impedance. Here's my simple test set with two series pots and a couple of fifty ohm shunts.

So, you're supposed to adjust input and output for the best filter shape. Yeah, that's easier said than done.

I have found the process of trying to determine filter impedance empirically without the aid of expensive test equipment frustrating to say the least. This little diversion started because I wanted to measure the impedance of several filters that are in my junkbox, in particular, this nice little filter that came out of a Sears Roadtalker 40.

The way that this is supposed to work is that you put the filter into the jig, attach the input side to your sweep generator or noise source, the output side goes to your scope or spectrum analyzer, and you adjust the input and output knobs alternately until the ripple in the passband is minimized.

Great, that sounds easy-peasy!

Well, the devil is in the details. First, if we use the noise method, at least with the gear that I have, it is challenging to see the passband ripple in the noise, Ok, no problem, I'll use the sweep method. I have a couple of different sweepable generators, one of them should get the job done, right?

Generator #1

It's a BK-Precision 4040A. I'll say this, choosing the word "precision" as a part of your brand name is a stroke of marketing genius. Unfortunately, I don't think that the engineering department got the memo.  It's not useless, but I'm not really sure for which application the sweep function is intended. There is no sweep output so you cannot use the sweep generator to drive the X input of your scope in XY mode. If you do use the sweep function, it's very touchy and extremely wide, too wide, in fact, for adjusting a crystal filter. It does have a voltage control input which would be awesome if the start and end controls scaled an external ramp input, but  no, it's an unscaled input that is virtually useless without taking the time to put together a scaling jig.  The manual states that the input takes 0-10V ± 1V for a 100:1 frequency change. Great, plus or minus ten percent of the input range, that must be some of that precision.  Ok, enough bagging on the BK, mine was a craigslist find, it still gets some use. Speaking of bagging on the BK, you can order a handy tote! Ok, for real, enough bagging on the BK.

I also have an old HP signal generator, the ubiquitous and somewhat infamous 8601A. I say infamous because they are so well known for blowing their output amplifiers, which are made of unobtanium, that someone has re-engineered a replacement. Unfortunately for me, I think that 1) my output amplifier is blown, and 2) that the $90 cost is too high for me to justify repairing this old girl.

This lovely example is much cleaner looking than mine and also has the RF and aux outs routed to the front like any sane person would expect. Ok, I can see the value of having the cables out of the way for fixed applications, but that wasn't going to work for me.

First things first, a bit of testing. Sweep output hooked up to the X input, scope in XY mode, blanking out put hooked up to the blanking input, check!  I forgot to snap a picture, but, the blanking is reversed, the retrace is bright, and the sweep is dim.

I wired up a quick inverter using a 741 and connected it in line with the blanking signal.

This gave me a relatively nice looking sweep signal and I could get good blanking just by tweaking the intensity control of the scope. 

It's not quite that bright in reality, I used a long exposure on my camera to get a good trace picture. However, you can clearly see that the retrace (the falling edge of the ramp) is much dimmer than the sweep trace. The flat portions at the ends of the sweep cause the sweep to be fixed for a period of time at the start and end of each sweep. This makes it easier to setup the scope and signal generator.

Although the op amp worked well, there is no bipolar power supply that's easy to use in the 8601. I could make a simple zener supply from the +26 and -6 volt supply rails, but there isn't a lot of room in this thing so I decided to simplify the design. The op amp does a proper inversion around the ground point, but strictly speaking, that wasn't necessary, I just needed a change in the polarity of the blanking signal. So I replaced the op amp with a simple inverter made from a PNP transistor so that I could power it directly with the negative supply rail referenced to ground.  While I was at it, I put the generator on the repair bench to move the connectors around to the front. That way I could use the holes in the back for a new blanking output and a switch to disable it when I didn't want to use the sweep generator with my scope. It's a lot less hassle to reach back and flip a switch than it is to move both the scope and the generator just to connect a cable.

Here's the little inverter, built on a bit of perfboard, ready to be tucked into  the back.  The green wire is the inverted blanking output and the other three wireds are input, ground, and negative power. On the right you can see it tuked into the top of the 8601; it's the yellow blob just to the left of the transformer.

The original outputs on the back came with a nice label plate that just flipped over and added my own labels.

 Here's the output of the ramp, the original blanking signal, and the inverted blanking signal. You can see that the blanking signal is now inverted.  Yes, I should have kept the PNP in its linear region so that I preserved the nice ramps on the blanking signal, but it's not that critical and I was able to just throw the switch together with resistors that were just lying on the bench, literally. I have no idea what's causing the small spurs, I thought that it might have been my circuit, so I took it out, but they didn't go away. In any case, it's a blanking signal, it's hardly critical.

With blanking fixed and the jacks moved around to the front of the generator, I installed it back onto my bench ready to do some more testing. The output of the generator isn't quite according to hoyle. It looks reasonably clean on the scope, but, it appears to be low and the highest output position doesn't increase the signal at all. I suspect, as I stated earlier, my output amp has problems, but, for now, it's feeding a fairly clean and adjustable signal to the output, so, I'll proceed anyway.

My first attempt used my Boonton microwattmeter as a detector. It's old and crusty, but it works. I have no idea how accurate it is, however, as I don't have anything that is precise enough and reliable enough with which to check its calibration.  In any case, it's too slow to be useful in this context. To get a reasonable trace you have to run the sweep speed faster than the Boonton can reasonably follow.

I switched gears and grabbed an RF probe that I hacked together some time back for some reason. This is not a work of art by any means and was constructed without much thought, somewhat blindly, from an old handbook.  
The resistor tacked onto the 1/2 watt was not in the original build. After reading more detail I learned that the value of the resistor was based on the 10 megaohm input impedance of most VTVMs of the day. My scope has a one megaohm input impedance so I tacked a resistor in parallel to create the approximately correct voltage divider circuit. It helped, but I also read that these are really designed for a relatively low impedance drive circuit and I suspected that it was loading down the filter and my scope was already at its highest sensitivity. Further, it did not give a log output which would give me a better picture of the filter's response.  Finally, I never liked the housing choice for a probe, it was made to be quick and I would prefer to have an RF probe in a more probe like enclosure. So, I removed the simple circuit. Upon doing so I found a cold solder connection from the diode to ground, that might have been the cause of some of the nose, no matter, I was sticking to my plan.

I built a log detector using an MC13136, which is a receiver on a chip. Yes, it's a bit of a waste, but it's a through hole part that I have a few of which meant that I could whip it up quickly on proto-board.

The TO-92 part to the right is an LM78L05 which provides a regulated five volts for the log amp. To the right you can see a 1N4004 in series with the positive power terminal. This serves to drop the input voltage a small amount and to provide reverse polarity protection, something that might happen with such a casual power input. The two resistors at the top right are 100 ohm resistors in parallel, so, yes, this has a 50 ohm input impedance, but, it also has a wide range.

Does this yield an improvement? Yes, it does, but, it's still fiddly. At least now I can see something of a filter shape and adjusting the input and output pots does not completely kill my signal. It is not really effective at coming close to the impedance of higher impedance filters. I have one with a known impedance of 3.9k and as best as I can get with this setup is, larger than a few hundred ohms. 

My best result was with a Yaesu filter believed to have a 200 ohm impedance, my adjustment showed about 150 ohms. As for the filter that is the subject of this post, it remains a source of frustration.

What I've concluded however, is that old analaog equipment with voltage controlled sweep is not ideal for this kind of measurement. The controls themselves must interact; to get a wider image on the scope you either have to adjust the sweep, or, the X gain of the scope, either choice moves the bandpass in the image on the scope.  The precision required here is really only in two dimensions; first, you need precision in frequency, and second, you need precision in measurement of the resistors. The latter is independent of the test fixture, while the former is much more easily controlled in the digital domain.

The goal is to be able to repeat these measurements easily;  in the next installation I will move forward with a DIY simple scalar network analyzer based on the AD9850.