Friday, August 21, 2020

Noise! Lunetta Lunchbox--Done at Last!

Welcome back to the land of.....

 I started this Lunetta build maybe 18 months ago..... 

Finally done:


BLAH BLAH! JUST LINK THE SOUND SAMPLE!

if you want to hear the finished Lunetta synth, in action, soundcloud sound clip is here.

Boy Howdy! this started with a board swap with Reverselandfill.org (there is a newer version of Reverselandfill's NOISE! module, V8, here). The NOISE! Osc is a CMOS based chaotic sound generator, and right out of the box is a very cool build.... 

V6 of Noise!--older design, now it's up to V8

I built the original "stock" NOISE! module something like 16 months ago--it's a finished module--orig post is here:


But can never leave anything alone, so after discussing with Martijn, I created a not-for-sale PCB based on his original design, but sized to fit a smaller (non Frac) enclosure. Following that was a quad digital pot board controlled by Arduino (post here), a 4051 based mux board (again Arduinoized, post here), and a dual VCA board (post here).  I even used 3D printing to create hardware to mount the "stacks" (here)--3D printing was totally new for me. 


All that was left to finish this off was to create a power supply and a PCB to have blinky LEDS and to things power on--since there was leftover space on this latter PCB, I threw a 555 VCO on there. Why not?

Here's the psup, based on the usual PAIA linear design you find in fracs.


PSUP was quickly off to china for PCB fab; back, built.

The first Psup built kept blowing up (I mean BANG!!! and smoke, total destruction) the diodes used for rectification. I pretty much sucked every part off the board looking for the short but never found it, so I  built another. Of course: Second one, almost all the same parts, same everything, worked.

Wow--That Diode Blew up Real Good!


Why did the 2nd one work? No, not the missing reg. It was something else.


OK with the power supply temporarily not exploding, I next found that all the stacks combined drew about 150mA on the + rail and about 30mA on the - side. There were at least 2 instances of the + rail being dropped to 8V or 5V for the Arduinos. This meant that the 7815 regulator I was using got very, very hot, even with a decent sized heatsink attached. 

I didn't want the damn lunchbox thing to melt, so, what to do?  

At digikey I found this part:



I figure this part was designed for engineering amateurs and general bozos like me, who design linear power supplies and ignore any sort of heat loading. Very nice!

It's almost a magic part: a switching regulator that's a direct drop in for a linear regulator--with 92% efficiency, something like that? so no heat! and after putting that in (it was a direct replacement size wise for the 7815) the heat problem was gone.  

New problem though--powering everything on, the + rail would sometimes refuse to come online. After a few power ons and offs, it would come up. Strange!

Probably some filter cap issue downstream, but, whatever; I never figured this out, but just flicking the master power switch off and on a few times before using the lunchbox in the studio didn't seem like a big deal; I thought of it as an old motorcycle that doesn't always start the first time, right?

Last thing to build was a "jacks board" to hold things like the power switches, power rail LEDS and so on--since I had some space I threw a 555 VCO on there, but it could have been anything, here it is waiting to be mounted to the power supply.

"Every Project needs a 555"


I then got out the Antique rocket ship/jr. scifi lunchbox I bought on Ebay a few months ago--perfect graphics and patina for a Lunetta synth right?

OK, I dropped in all the boards etc. Good news: The 3D printing came out OK, it provided a tight enough fit that I didn't need to cut up the lunchbox to screw anything in, it's all just a press fit in there, and so far seems to be good enough.

 

Last thing to do is get it in the studio and make sure it all works. It does! Joy! No smoke!  No Fire! Bizarre sounds!

The synth is odd craziness as you suspect, but overall I think it's mostly good for atonal beep-beep-beep non repeating sort of stuff. Think of an alarm clock you seriously want to throw off a cliff? 

On the demo it's about 80% audio out from the lunchbox, but I also have the lunchbox providing chaotic CV to things like a Rings module. Like the original NOISE! it seems good for both audio and CV.

As far as posting allo the schemos etc etc--well, there is a ton of PDFs, eagle files etc etc., I will just make a giant ZIP of all of it and post it soon. UPDATE: 8-22-20. Eagle files and other "as built" docs are now posted.  Go to my website here. I will try to add scan and add PDFs down the road.

Many thanks and big shout out to Martijn Verhallen of reverselandfill--thanks for the support and encouragement.

Wow--can't believe it's done.  

Enuf! There are bad fires right now in not so sunny California, so there are even more fumes to not breathe--don't breathe 'em. Hold your breath. 

Friday, August 14, 2020

LFO from 2003: Repair--Is Electronics Stupidity a Competitive Advantage?

 Let's get in the time machine and go back to the bad old days. I was just getting into AudioDIwhY. And I knew even less about audio electronic design and fab then than I do now.  

But out of the early days of my AudioDIWHY quest came a few modules I still use today and like a lot--one which is an LFO I conjured up from different dribs and drabs I found on the web circa 2003:


spiffy new front panel from FPE.....


As with a lot of my remaining 2003-2005 era modules: in August 2020 this one was showing its age; the original front panel had faded and was hard to read, and one of the switches had become sticky. It was built (poorly!) on perf. But I still liked the way it LFO'd and was using it all the time. It was time for a 20,000 mile tune up......


Yo! hand cut and drilled out of sheet aluminum; the legends were water slide decals.
 

I used Front Panel Express for a new front panel; easy! This should be easy! For the screwy switch I took a photo so as to replace it w/ correct wiring but after that the LFO didn't work; very nice.


Whatever....I went to my cache of documents to find the schematic for this puppy and guess what--NO SCHEMATIC FOR THIS LFO. Very nice!  

I think I remember how I built this: I found fragments of various LFO circuits on line, combined them into something that seemed at the time to make sense, and then tweaked components and values on the bench until I came up with something I liked. 

Who needs a schematic?

It's helpful when the gizmo doesn't work! To fix the circuit, I had to reverse engineer the mofo; tricky because the wiring and layout on the perf was full spaghetti western.

Still not sure I got the drawing 100% right? 



OK, some of that makes sense but some of it is--strange. Why use trimmers for TM1 and 2? Why use a 5K trimmer for TM3?  At the very least, now I'd put 50K in for TM3, which won't change things, but save a bit of stress on power supply for this circuit. But at this point I am not messing w/ any of it.  I might fab up a PCB based on the schematic above someday to see how and if it works. 

As long as the LFO was on the lift: The module also had a power cable that was too short, I remember making this by hand out of crimping tools. 

 
I replaced that with what I've been using for the past few years: expando and a factory 4 conductor, PAIA Frac-friendly power cable, much fancier and less likely to get tangled:


But some of the crap-stuff was left in there: The grounds for the output jacks are 3x bare wire. Why? No idea. I guess I mostly just didn't know what I was doing.


If you've made it this far, no doubt you are wondering: why am I even writing about this? To a large degree this week's work was a simple repair and front panel replacement, and isn't noteworthy.  

Besides, we hopefully all get "better" as we do pursue a hobby more and more so yes, I can go back to earlier work and think--wow, that design choice was really stoopid!

Instead, what I've been mulling over: back in 2003, since I had no idea what I was doing at all, I sat at the bench and screwed around with perf, plugged in components and listened, plugged in another part and listened, went back and swapped in B for A, and on and on. Some of the component choices I ended up with still baffle me, but, whatever. What I got back in the hit-r-miss days was almost always something I really liked, and this LFO is one of those. To wit: The BIAS offset values are, to my ears, exactly where they should be, the frequency control range is as well. Sure, this LFO is only triangle and square, but fine, that's what I need 90% of the time. 

If I designed an LFO now I'd add all sorts of other goodies--variable waveforms, LEDs, CV control of frequency, blah blah and yet I'd wager this LFO is still where I'd go when I needed some quick LFO. 

So the lesson here, I think, is that the days of just goofing around, getting stupid, cobble and mod, and not worrying about "getting it right" should continue--always. To put it another way: getting it right in terms of sound is more important than getting it right and should never be overlooked.  

Monday, August 10, 2020

Noob 3D Printing--Monoprice Voxel 3D setup--For an Electronics Lab? But (audioDI) WHY, Voxel, WHY?

Hello again. I love Youtuber/DIY dude Andreas Speiss--perhaps not enough to propose, but still, I am very fond of him, and try to watch all his vids.  

Blame Andreas on this post--because this diWHY quest starts entirely with the vid here. Go to about 1:02....In my lab I had all the essential tools mentioned but not a 3D printer. I fully agree with all of A.S.'s other essential tools, so why don't I have a 3D printer?  Um....Because I couldn't really see what I'd use one for.  

But then Covid hits, I am bored out of my squash, and I even have some time to learn new things. My trip to Spain is cancelled, that money is in my pocket, so I figure why not: buy a 3D printer, learn how to use it, and decide what to use it for later. 

Confusing times, eh?

Lots of research followed and the printer that, as of writing this post, gets the nod as "best for 3D printing newbies" is this one:"Monoprice Voxel 3D:"

But is the Voxel really called a IIIP? Is IIIP anywhere in literature, the web, etc?  Can you search for IIIP and learn about it? Uh--no!


SOLD! I paid about $420USD for this, delivered, not super cheap, but from the endless reviews it's a good spend: this printer has a lot of time- and sanity-saving features, many only available on printers that cost a lot more: touch screen, self leveling ability, Ethernet and WiFi,  you get the fresh idear.

It also has a reputation for the default settings producing useful output--and not a puddle of goo. Yeh!


The printer showed up quick, and then, getting it set up was easy; there was a lot more packing material to remove than the quick setup guide showed, but, that's OK. Using the same quick start guide, it was easy to load up PLA filament, heat up the nozzle, and print out the sample cube--which came preloaded in the printer's memory--call up this test object using the touch screen panel and tell it to print--GO A'S!

Righto.....and here is what I got first time around for my cube:


(Um.............Not a cube....) 

Drat! This is supposed to be the easiest, most idiot-proof 3D printer around and I can't even print a cube. Very nice. What now?  I figured I'd better read the manual, since the quick start guide might be a bit too quick?  The manual can be downloaded here, and says I needed to calibrate the print nozzle first before printing (not mentioned in the quick guide!)  Did that and I ended up getting what is below, on the right:



Success! I joyfully sent this pix around to my family as well as my psychiatrist girlfriend, who seemed happy for my victory over goo but perhaps puzzled and maybe even a tiny bit concerned.

OK now that I can print the sample it's time to draw up something right? What 3D CAD software to use? I have messed around with extruding things using Photoshop, but not real 3D CAD. There are many choices for this--and I had to learn one. Tinkercad is popular--but since I have long owned Eagle CAD, I get a free license for Fusion 360, which seemed like a heck of a deal. (Whack! Take that, all you guys at the geek meetups telling me to switch to Kicad! )

I downloaded Fusion 360 months ago and started to mess with it but it made zero sense. Maybe time to try again? 

As always--youtube to the rescue. I found a most-excellent tutorial here.  Parts I II and III took me through the basics, and after I was done with the 3 vids I could conjure up simple shapes and get them realized in 3D:  



Time to print: Turns out you need a "slicer" to turn the 3D output (".stl") into a digital format almost all 3D printers eat ("gcode").  The program almost everyone uses for doing this conversion--it's free and it kicks butt--is called CURA. I downloaded that and turned the stl into gcode and guess what? The Voxel didn't eat the gcode file I presented to it!

Went through the manual again--nothing. Why won't gcode--or even stl, which supposedly the printer eats--work? Went through a bunch of reddit forums and other stuff--nothing.   

I finally found the answer in the vid here: The Monoprice Voxel 3D doesn't like gcode, it uses something else; so to make the voxel work you have to use the FlashPrint slicer on the Monoprice website (here--go to the bottom of the page).  Also Cura has no way I could find to talk to the Voxel 3D printer using Ethernet--i.e., there are no details about a "print" command from the Cura slicer--but the Voxel FlashPrint slicer has hooks for that, which solves another poorly documented and critical issue: how I send 3D jobs to the printer using Ethernet.

Indeed, I stumbled around and cursed a lot on this Cura vs. Flashprint conundrum. But, joy! once I found the right slicing software, and got it going on my PC, things got very easy. 

Now it's print time. So--Um--really! What am I going to make? Guess it's time to figure that out.

Motorizing the pursuit: If you've been following this blog, I have been working for over a year on a Lunetta synth based on Reverselandfill's most excellent Noise! chaotic oscillator.  I have gone winchester mystery house, coming up with a bunch of boards to modify the lunetta madness. Posts about the Noise! build are here , here, and here (as well as here ). Will it ever get finished? Who knows??? 

It's time to put all 8 PCBs into a case, so why not 3D up some feet for the project's PCB "stacks"? Here we go:







INDEED. I used 5 minute epoxy to glue the 4-40 nuts into the feet. I could have designed 4-40 threads the CAD  design but I didn't know how strong or brittle that would be, and it's good to know that epoxy, metal, and PLA like one another--1001 uses.




Yep, screws right on. Seems to work! Victory!

Onward! I have decided that perhaps I love 3D printing.....like the Teensy Audio, this acquition will change how I do DIwhY and the (extremely underground) hits keep coming.

Moving on--time to finish the Noise! synth. Next week I hope? Maybe, maybe not.

Time to wrap it up: 3D printing is supposedly toxic, hopefully less than covid. so as always don't breathe the fumes, but really, you should check out the Voxel if you're thinking of getting into 3D printing--wow, what a gizmo.



Monday, July 27, 2020

Teensy Audio Shield: Little Audio Board, Big Audio Fun

Welcome back my friends to the blog that never ends. 

If you're a audio geek like me and have been sheltered in place for the past frigging 50 years, perhaps your entertainment values have changed? To wit: the $35 I would have blown on a foreign movie date with my psychiatrist girlfriend remains unspent.

So let's have fun with that $35USD--i.e., audio DIWHY geek fun--and at the same time we'll get small.

Digital Audio--super powerful MPU--stereo headphone jack and amp--tons of free example sketches--stereo analog I/O on board--all for $35 USD? Are you frigging NUTS?  No, it's true!  All hail Stoffregen and Coon!

TEENSY!

I started down the Teensy rabbit hole while researching I2S (more on I2S in upcoming posts; in a nutshell it's a common digital protocol for sending audio data between devices). I wanted to get my hands dirty with I2S but feared chasing digital synch issues, PC crashes, horrible aliasing, and general fear and loathing. These were things I had to contend with during the many years I worked in audio for film post--and this is supposed to be fun, so, nope, let's not go there again.

Ditch the dubbers, elmo: During my quest for I2S without issue I found the vid here: Teensy Audio. Wow! For digital audio fans it has everything already built in: I2S, A to D, D to A, an SD card reader, the codecs you'll need, an affordable MPU with some effects already preprogrammed in a comprehensive library, even a 3.5" amplified stereo handphone jack--again: are you kidding--plug it in an go right? 

But is it all too easy? I needed to find out.

I bought a teensy 4.0 direct from the manufacturer, pjrc.com, along with their audio shield or hat or whatever you call it, which arrived neatly packaged and boxed a few days later.

My goal was to get the Teensy 4 working, program it from the Arduino IDE, run the audio examples, then record the examples and post them online--there are many vids about this technology, but I could find few that clearly showed how this little spud really sounds when put to the test.

The legendary Teensy Shield. Wait--no legends next to the pins? Why not? Sadly the silks are on the other side of the shield--not useful. I guess you can't have everything for $35?


STACK EM UP RAWHIDE

I bought the version without pins. What else am I doing these days to pass the time?

Which meant: solder all the pins and get the shield stuck on the MPU. But still have the shield removable as needed down the road.

I looked around the Interweb for the best practice for this MPU to shield connect and to my astonishment couldn't find it. Time to roll my own? How hard could this be?

Here is what I came up with:

Needed: the teensy 4, the audio shield for it, soldering rig + solder wick; male to male breakaway header pins and male to female breakaway header pins.









Step One: install male/male pins to the teensy, as you would with any MPU:



Step Two: This is important!! Use solder wick to get rid of any extra solder that ended up on the top side of the Teensy. The shield has to lay flush, so you want to make sure this solder job is completely tidy and minimal without "solder Hersheys kisses" getting in the way.




Step Three: solder the M/females headers to the bottom of the shield:

Step Four: mate 'em up.

SIMPLE RIGHT?  You will end up with something like what you see below, but, check your work! I consider myself pretty OK with fab, but I had undersoldered a couple of pins after wicking; thus the shield didn't initially work when it came time to breadboard. But! if I used too much solder the audio shield wouldn't sit flush with the MPU and the audio would cut in and out. Yep, this takes some pretty careful soldering.


Next, I needed analog breakouts:  here is what I came up with. The 3.5" jacks board was left over from another project.....

But wait! We are not done with the Teensy hardware.

The audio board has provisions for a flash (non-volative storage) or RAM (read/write; loses data at power off) chip.  The latter assists in getting longer (1500ms) delay times from the board, which is what I want--information about these chips can be found toward the bottom of the page here.

I ended up buying ram chips direct from Microchip and soldering one on.  It would have been easier to do this before the headers were installed, but whatever. I got it done.



Thank goodness for scotch tape....

Not the neatest SMD solder job ever, but hey, it works.

Next, I needed some pots n' switches to goose the analogRead() statements in the sample sketches.

The many online tutorials (e.g.: here) use breadboarded parts for this, but I hate breadboarding, so I built this out of perf, which I like only a bit better:



Now let's breadboard the Teensy + shield and wire it up to a DAW using USB:


And set up a rig for testing, screwing with the code, etc. which goes like this:

The IKEA steak knife on the left is the unofficial "reboot your MPU tool" for Teensy Audio. Otherwise you can't easily get to the really small reboot switch, and, you're gonna need to get to this switch from time to time.

UPLOADING CODE

Yep with all the hardware up and running it's time to get the example sketches onto the Teensy....

This proved to be a tiny bit trickier for me vs. the hardware part.

The teensy USB setup is not like what I've seen elsewhere. Yes, you use the same USB cabling, the same Arduino IDE, the same laptop and the rest of it, but you also need special software from PJRC called their "loader" to get the Teensy to eat sketches of any stripe.

I tried to get the loader and Ardunio IDE working on Fedora Linux--that's where I do most all of my coding-- and couldn't get it to work after about 2 evenings of trying.  No, Captain Ubuntu, I didn't try compiling from source code which probably would have worked--sorry cap, that would have been too easy.

I went to Mac OS-X Sierra and everything worked right away, but with one strange detail--after you power cycle things, for the first upload from OSX to the Teensy, you (often?) have to press the tiny white button on the teensy itself to initiate the upload. (see the steak knife in the photo above--yep, that's why it's there). Note that this momentary switch is a bit obscured by the shield--sorry.

The Teensie then can eat the sketch from the IDE.

After that it all works--no more need to hit the white button, until the next time you power cycle things. Then you have to hit the tiny button again--but just once.

This really stumped me for a bit.

Also: to have the serial I/O (you know, Serial.begin(); etc etc), you have to choose the Teensy USB port within Arduino IDE; but you don't have to do that to program the device.  OK.....


THE TEENSY AUDIO DESIGN TOOL

Something that got me really interested about the Teensie is its web based GUI.  PJRC has a web UI to assist coding your own effects and audio widgets that they call the "audio design tool". Take a look at that here.

My goodness! You can chain things together, create feedback loops, and even rename the objects, sorta like a small web version of Reaktor. Then hit the EXPORT button and the Arduino sketch object instantiation is done for you--copy the code into your sketch. And!!! you can take an existing Teensy Audio sketch, such as code in the PJRC provided examples, import the sketch into a blank web UI, and the UI will create the Reaktor-like object flow for your perusal.

It all works! Now, that is really cool.

But wait--proving once again there are still mosquitos in paradise: the GUI is extremely helpful but it won't write all your code for you.  In fact if you just plunk the auto-generated code into a sketch and expect to hear sound, forget it. You won't.

For instance: using the TA UI tool, I created this very simple stereo mixer:

DO NOT FORGET! the SGTL5000_1 object on the left, or your sketch won't work!

And then EXPORTED it to a sketch.....all code you see at the top of the sketch was pre-rolled.

But to get this to work, I had to create the code you see in setup{} and loop{}--the GUI only created the objects and #include statements you see at the top of the sketch.

Fortunately between the examples sketches, information you get from PJRCs documentation, and what you might glean from what seems like a gazillion youtube "howto" vids, you get a feel for what you need to code reasonably fast.

/////////////SIMPLE TEENSY STEREO MIXER/////////////////////

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputI2S            i2s1;           //xy=244,74
AudioMixer4              mixer2;         //xy=369,169
AudioMixer4              mixer1;         //xy=374,35
AudioOutputI2S           i2s2;           //xy=506,72
AudioConnection          patchCord1(i2s1, 0, mixer1, 0);
AudioConnection          patchCord2(i2s1, 1, mixer2, 0);
AudioConnection          patchCord3(mixer2, 0, i2s2, 1);
AudioConnection          patchCord4(mixer1, 0, i2s2, 0);
AudioControlSGTL5000     sgtl5000_1;     //xy=90,51
// GUItool: end automatically generated code

// COOL, BUT I HAD TO CODE SETUP{} AND LOOP{} BY HAND:

void setup() {

   //you need this or no audio!
   AudioMemory(8);

  //and this!!!
  sgtl5000_1.enable();

}

void loop() {

//Mixer properties
// mixer(x,y)
// x is mixer input, so for us, 0
//y is gain:  
//0 = no audio
//1 = unity
// >1 gain
//goes to 32000+, that's some serious damn gain!

mixer2.gain(0, 1);
mixer1.gain(0, 1);
}

SHUT UP AND LINK THE SOUND FILE!

OK, it's here.  the sound demo is as bare bones as I could make it--there are no attempts to synch the delay to the beat of the loop for instance. My goal here is remind myself six months from now how this thing sounds....that's it.

You can also get a zipped copy of the sketches used (most of the examples were modified slightly to fit my I/O setup) here.

The gear used for the demo recording: OSX mac running Ableton 10 suite; Apologee Duet ADDA; the Teensy; unbalanced out to Rane SM82 with unbalanced loop sends to a Tascam SS-R200.

In other words, as simple as I can make this.

 The chorus/flange is gritty and I didn't like its sound much; tweaking the example sketch--I feel I tried a lot of things--didn't get me much improvement. 

For the other FX, I hear hiss and noise--some of the noise isn't teensy's fault I think; I could have spent more time optimizing levels to get rid of some of the noise, but overall I needed to get this done as simply and quickly as I could, so there you go.

Overall, I thought the reverb, filters, delays, etc., were pretty damn good--definitely good enough to put in series with other audio effects someone might dream up--need five 12db/octave bandpass filters in parallel for a specialized EQ?  Use a teensy audio--boom, done, here it is.


TO TEENSY OR NOT TO TEENSY? TO TEENSY!

Or: what did I think?  Ha!  It's a blog so I can say anything I want right?

The Teensy Audio's chorus/flange implementation was a bit weak, and I have a few minor gripes about how the hardware is laid out (such as silks, see above) but beyond that, this is one of the greatest, if not the #1 GREATEST,  DIY/Maker audio development products I've ever seen. It could cost 3x as much and arguably still be a great deal, but for $35USD? Again: Are you kidding me?

Using stock or slightly modified sketches you can quickly create some reasonably good effects like reverb and delay, and with some imagination, creative coding, and tweaking, who knows what someone might come up with. There are just tons of creative possibilities here.

I felt after a bit of a learning curve I started to pick the coding up pretty fast.

And of course I haven't even touched on a lot of the other things this device can do--synthesizer module sims, audio analysis, and a lot more.

Overall: I figure PJRC put a butt ton of work into this--with great passion--and it shows. PJRC should win the nobel prize--they have my nomination anyway--yes, This teensy>audio thing is that good. If you are into MPUs, DIY and audio, run, don't walk, and get this thing.

For me, it's beyond hours of fun--Teensy Audio is going to change things. Yow!




Noise! Lunetta Lunchbox--Done at Last!

Welcome back to the land of.....  I started this Lunetta build maybe 18 months ago.....  Finally done: BLAH BLAH! JUST LINK THE SOUND SAMPLE...