Friday, August 18, 2017

From VR to 3D printing with Google Blocks

Oculus Rift + Google Blocks + 3D Printer


There was some discussion that Google Blocks, which is sort of a 3d MacPaint if you will (or if you understand me, if you remember that far back, etc.) is not suitable for generating files to 3d Print.  In fact, it is relatively trivial.

Once you click the save icon in your scene, a folder with a randomly generated name will be created in the Blocks directory in your Documents directory.  Inside that folder you will find two files named Model ... one is a .gltf file and the other is a .obj file.

I use Slic3r to prepare 3d objects for printing, and have usually used .stl files (from OpenScad, not that it matters) but Slic3r is perfectly happy to open a .obj file as well.

I have only printed a couple of objects, but I can verify that it is doable.  If you are interested in trying it yourself, I will only make a couple of suggestions.  For the base of your object, if you want one, it is best to use the grid option in Blocks to be sure that the object you choose (I used a cube to start, then tweaked it to suit) is oriented such that it can be made to sit flat.  In Slic3r I found it necessary to do a 90º rotation around the X axis, after importing the object.

You may also find that the object starts out super tiny, and you need to enlarge it quite a bit before printing.  I have an object that looked reasonably large in the Virtual world, but I needed to enlarge it 30,000% and it still printed out small enough for me to hold in my hand and enclose in my fist (not comfortably though, there are a lot of corners from the cubes I built it with).  It was so tiny to start with that I could not see the grid that Slic3r generates to orient you.  The grid lines were further apart than the size of my screen ...

Why should I care?

I thought it was pretty cool, but maybe you feel differently?  Putting on a headset, entering a virtual world, using tracking devices in your hands to select and manipulate virtual tools, tools that enable you to construct complex shapes ... all that is cool enough.  However, to then take off the headset, run a few more tools, set up your printer, and in a few hours (or several hours, depending of course on the size of the model) you will have a real thing that is a pretty close copy of what you built virtually.  It certainly feels more like living in the 21st century than a lot of other things I do every day.

A small gripe

It bothers me a bit, as a certified Apple Fan Boy (though a somewhat disgruntled one), that I have to use hardware from Facebook (they bough Oculus of course), and software from Google, running on a Microsoft Operating system to do this.  I do run Slic3r on my MacBook Air (it sits near the the 3d printer, and the built in SD card reader is convenient) but it does seem Apple has some catching up to do, at least in this arena.

Two objects

Monday, June 26, 2017

Drummer from Another Mother -- Moog DFAM

Experience and Object

They say that it is better to buy experiences than objects, because they are more meaningful, and ultimately make you happier.  But what if you could buy an experience that granted you an object?  And what if that object in turn could enable you to create new experiences? How great would that be? This experience and object start with


it, which is done in two four hour workshops.  A MoogFest Engineering pass gets you a VIP pass to the festival, and also access to the workshops during which you are able to put together an unreleased synthesizer.  Last year it was the Brother From Another Mother, to accompany Moog's commercially available Mother32 syntheisizer.  This year it was a Drum synth/sequencer, called the Drummer From Another Mother, or DFAM.

When I say put together, I should be more clear.  If you have done other DIY projects that include putting in resistors and capacitors, trimming leads, mounting sockets for Opamps and so on, this is not that.  The board is already populated with all electronic components, which is just as well, as there are a lot of them, all surface mount.

The work you do is soldering the jacks, switches, pots, and headers.  Then mounting the panel to the board, and affixing the various nuts, washers, and knobs.  It is not a tremendous amount of work, especially if you are handy with a soldering iron.  Even if you are not, as a couple people in my group were not, the staff on hand will help you through it.  Speaking of which, the 


were excellent.  I think they were all Moog employees.  Steve, who also designed the DFAM, took the leading role, demonstrating the device, going over the various features of it, and even at the end giving us a bit of a tour of the schematic.  He also told us about how it began years ago as a Word doc, which did not completely describe what became the DFAM, but did include several important bits, including a feature I love, the bipolar EG amount knobs for the VCO and VCF.  There were other folks who helped out at different times also, from bringing more solder when it was needed, to giving advice on the easiest way to get things mounted.

At the end of the workshop we all wired our DFAMs together to make a giant 20 strong electronic drum orchestra.  Steve coordinated us into different groups, I think I was a snare or a tam.  Anyway, the result was pretty spectacular.

I did not record that, but I have used the DFAM for a couple of


including one created because my flight back from Durham was canceled.  I had the chance to work with it in an airport hotel a bit. since I had brought my laptop and an audio interface with me.  This is what I came up with: DFAM in NC.

Since adding it to my studio I have done a lot of recording with it, but I've only put one more thing online, this youtube video: DFAM and Vortex.  The Vortex by the way is a real thing, an effects box made by lexicon in the 90s.  I got mine super cheap from Music Go Round.  I think it was cheap in part because the previous owner had somehow managed to partially destroy the rack ears.  How is that even possible? Anyway, I have a sort of love for that device, it is so bizarre and the "morph" function is quite unusual.

I think between the two demos above, you can get some idea of what the machine is capable of, though I did not even scratch the surface of what you can do with some patch cables, and some other gear.  It definitely plays well with others. You can find a number of other videos online.

I could go on and on, I suppose but in 


I will just say that I booked an Engineer ticket for Moogfest 2018 within days of getting home.  Looking forward to another great festival, and another cool gadget.

Friday, December 16, 2016


I've been playing around a bit with SNOBOL.  I heard once that you should never bother learning a new programming unless it changes the way you think (oh here it is Perlis epigram 19):
  • 19: A language that doesn't affect the way you think about programming, is not worth knowing.

SNOBOL definitely changes the way you think.  It is based on pattern matching, and side effects that occur during matches, or attempted matches.  Blank space is not just significant (a la Python) it is an actual operator: concatenation.  SNOBOL has procedure definitions, and the procedures can be recursive, but it doesn't really have the notion of a procedure body.  You define the name, the arguments, local variables, and the entry point (all but the name are optional).

If you don't put a jump at the end of the definition then it will happily start executing the "body" of the code, and may give you an error, since of course the arguments will all be null, and you were maybe relying on something being there. 

There are no do or for or while loops, but every statement can have an unconditional or (up to two) conditional gotos appended.  Since there are no actual procedure bodies, you can have bits of code shared by multiple procedures (e.g. error returns).  There can be jumps from all over into that code, but of course RETURN will still return from the current procedure. Take that Dijkstra!

I/O is greatly simplified by the use of variables that can take their value from input, or which when set send their value to the output.  For example, Hello World looks like this:

 OUTPUT = 'Hello World'

I can't think of another language with that combination of very high level and very low level features, but when you realize that it dates from about 1969, it makes a a bit more sense.

What got me playing with it?  I recently picked up a copy of a book entitled "Programming Languages, A Grand Tour" (edited by Ellis Horowitz) at a Goodwill store in Albuquerque.  It is an anthology of articles on programming languages, from the early 80s.  Lots of great things in it, including the article by Backus in which introduced the phrase "Von Neumann bottleneck".

The first article in the book is by P. Wegner, titled "Programming Languages -- The First 25 Years" and contains a list of 30 milestones.  To give you some idea, M1 is the Von Neumann's EDVAC report, M5 is FORTRAN, M12 is LISP and M26 is Structured Programming.  SNOBOL is M13.  That reminded me I'd seen a book on SNOBOL at a friends house back in the 70s, and ....

Another point of interest in the book is an early paper on C. It mentions the disadvantages of having printf in a library rather than in the language.  Essentially the problem is that if you change the type of a variable you have to change the %d or what have you to match it, whereas if printf were in the language it could "know" the type, and adjust itself.  This was, I think, part of the motivation for adding cout to C++.  The (much newer) Go programming language fixes this by adding reflection, if I understand that correctly.  SNOBOL however had solved this long before: OUTPUT does something sensible with whatever value you provide it.

Wednesday, November 09, 2016

A #NeverTrump'er reacts to his election

Not that I tweet so often, but I did tweet against Trump several times, using the #NeverTrump hashtag.  Why?  I agreed with him that the country was going the wrong way.  Agreed that Obama had left large swathes of the country behind.  Agreed we need a change.  However, I wanted a Free Market Conservative.  Lower taxes, less regulation, less government intrusion in our daily lives.

Trump promised some of that, but mixed it with protectionism, cronyism, and a buffoonish manner.  When he promised something I don't like (Trade war) I believed him.  When he promised things I do like (Conservative Supreme Court appointments) I didn't believe him.

Like most people, as I watched the returns last night I was expecting to see a quick and painless victory for Hilary Clinton.  Well, maybe not painless ...

Instead, the map refused to turn blue.  Early on, a solid wall of red states went up the middle, symbolically dividing the country in two.  Then the red began to spread, first East, then West.  Ohio?  North Carolina?  Florida?  What was happening?

It seemed just and right that the red states all cohered, as if rebuking my interpretation of division. No, this is what the country is, they said.  Lonely Illinois and New York are the outliers, not us.  It got later and later, I repeatedly resolved to turn it off, but I could not.  Finally when Podesta told the Democrats in the Javits center to go home and get some sleep, I thought "good idea".

Except, I couldn't sleep.  It was clear Trump had won.  Was I happy?  I was happy that Clinton had lost.  I thought it would have been a terrible precedent for her to influence peddle her way into the White House.  The Clinton Global Initiative may have been entirely legal (though we will see) but it was ugly.  It stank.  To use a charity to launder millions of dollars of bribery is disgusting.  To get away with it? Worse.  To become President on the back of it?  Intolerable.

And the emails.  People say it like, you know, everyone has emails, sometimes you delete them, no biggie.  I disagreed.  Had lunch yesterday with a friend who served in the Navy.  Told me he'd spoken to other servicemen about her server, and the way she handled email.  They were disgusted.  Would have been crucified if they'd been as careless as that.

Have you seen “The Imitation Game”?  I've been reading the book it is based on.  “Alan Turing: The Enigma”, by Andrew Hodges.  No spoiler, this is not in the movie: the Germans were reading our codes.  In Bletchley Park, they were working like crazy to break the Naval Enigma to find out where the U-boats were.  The convoys would then be re-routed to avoid them.

Bletchley started seeing that messages were being sent to the subs redirecting them to the convoy’s new position.  Fortunately the allies were not as blind to the possibility of codes being broken as the Germans were, so we changed the weak convoy codes.  However, in the months before we did, the convoy losses were horrific.  Thousands died because of the laxity, the unwillingness to take information security seriously.

Now it is true, that while our nation is currently “at war” in a sense, this is hardly WWII.  On the other hand, the lost convoys sailed more than seventy years ago; these are lessons we should have learned then and never forgotten.  To neglect them is criminal.

So I was not sad she lost.

As for President Trump?  I am praying that he does a good job. What else can I do?

Tuesday, March 08, 2016

Skylake Hackintosh

My "Early 2008" Mac Pro was getting a bit long in the tooth.  Given that it was seven years old, it was actually running pretty well, it had been upgraded to 10Gig of Ram, a 480G PCI based SSD boot drive, and an NVIDIA 750 ti graphics card.  I'd even taken out the 2.8 Ghz Xeons it came with, and put in 3.2 GHz ones.  When it was new, that was a $1600 option, but you can get the correct parts on Ebay now for about $90.00.

The SSD kept it going for a bunch of years, that is the key upgrade on an old machine.  The RAM helped of course, and the Video Card makes a difference, especially with Lightroom 6 now being GPU optimized.  However, the upgrade to the 3.2 Ghz processors was a definite mixed blessing.  The 15% speed improvement is actually noticeable, but the TDP on the processors went from 80 watts to 150 watts, meaning an additional 140 watt draw when they were going full bore.  It was enough that I could tell when a Lightroom slider was not one of the ones that used the GPU, because if I started tweaking one, the fans would start to roar.  Pretty ridiculous.

So I thought about getting a newer machine, but the latest Mac Pro came out two years ago, and doesn't have room for the hard drives in the 2008, or the Video Card I got for it.  Arguably the machines, expensive as they are, are a good deal.  If you look at the going rate for the video cards in the NMP, especially the high end ones, it looks like you are getting over $1000 off by buying them in the NMP, and they throw in the rest of the computer for free.

However, it was not clear to me that I really needed $6000 worth of Video Card, even at the $4000 bargain price.  Also, they came out two years ago, and the best deal you can get from Apple is 15% off on a refurbished model.  That didn't sit well with me.

 I spent a while trying to figure out if there would be a new new Mac Pro (nNMP?) any time soon, but Apple is notoriously tight lipped.  The scuttlebutt seems to be based on when the correct Broadwell Xeon parts will be available, which should be later this year, since Apple is likely to skip Haswell altogether.  Unfortunately, the usual tick-tock Intel schedule was badly disrupted when they shifted to 14nm, and Broadwell is really late.  In fact, Broadwell was followed very quickly by the 'tock', Skylake, which also comes with a new chipset, the 170.  The 170 has a number of cool features, including support for DDR4 RAM.

At any rate, I decided to build the following machine:
ASUS ROG Maximus VIII Hero Motherboard
Intel i5-6600 CPU
Cooler Master Hyper 212 EVO
EVGA 750W Gold PSU
G.SKILL Ripsaws V 16GB RAM
Samsung SM951 SSD (512Gb)
Syba Firewire card
realtek chipset Ethernet card
Fractal Design R5 Case

I already had:
2x Sandisk Extreme Pro 960 GB SSD  (for Lightroom library)
EVGA Geforce 750ti
LG Bluray/DVD burner

I got the i5-6600 Skylake instead of the i7-6700k because at the time I built it, the overclockable 6700k was selling at about $440, instead of the MSRP of $350.  The 6600 was available at list, and since it has a TDP of only 65W, as compared to the 95W of the 6700, it seemed the better choice for a "cool" and "quiet" build.  Overclocking is definitely not compatible with cool or quiet.  However, even with the lesser processor,  performance is more than adequate, the system benchmarks better than a 4 core Mac Pro 2013 (the low end of the new round ones).

The Fractal case, and the Hyper 212 EVO were also specced for quiet.  Both are very well reviewed, and my experience matches that.  I did have a problem with case, but Fractal design sent me a replacement side panel that fits perfectly.  The 6600 comes with an Intel cooler, but some of the reviews complained it was noisy, so it was replaced by the 212 EVO.  The Z170 motherboard is arguably overkill, but it supports the high speed RAM, and should be reliable, as it is overbuilt.  The PSU is also overkill, but it seems cheap insurance for longer system life, and since it doesn't run the builtin fan until it reaches 45C (which it never has) it is another contributor to quiet operation.  You do have to be sure to set it for ECO mode, or it will run the fan all the time.

It also seemed a good idea to get a modular PSU, this was my first build, and modular PSUs are supposed to be easier.  This one certainly was not a problem, even with the several disks (not listed) that I also put in.  If I do get a higher powered GPU (when Pascal arrives later this year?) I will easily be a able to power it as well.

Putting it together was pretty easy.  Getting it to boot up as a Mac was a bit harder, but the good people at tonymacx86.com helped a lot.  They still are not recommending Skylake builds, only Haswell or Broadwell, but it really was not that bad.  It took me a while to get iMessage working, I had to follow this recipe from Reddit. Until I did, it kept telling me that such-and-such number was not registered with iMessage, when I knew perfectly well that they were.  I still have problems with sleep, but since some of the software I use doesn't like sleep (looking at you Kyma!), that is not such a problem.

P.S. If you have read all this, you might wonder why I put it up.  I was encouraged to do so by a scientist friend at LANL, I guess computer builds have to be interesting to somebody, right?  He, by the way, is very happy with his NMP.  The only thing I envy him is that the case on this thing is really big ...

Tuesday, November 03, 2015

Midi Patchbay 64 bit version

I decided to rebuild Midi Patchbay as a 64 bit app, and for good measure, put it in the Mac App store.  The rebuild wasn't too difficult, just a few changes to some old code.  Then a bit of messing about in Xcode, and with the icons, and it passes validation.

One difference is that it doesn't seem to be able to talk to the Jack server anymore.  This may be an oddity of my system, or perhaps it is because of the sandboxing.  I don't know!

It seems to take a long time to come up the first time you run it, after that it is quicker.

In any case, I was having some strange Midi issues on my system, and thought that perhaps it might be because this app was only 32 bit.  It seems unlikely that it really was a problem though, the Dropbox mac app is only 32 bit, and they don't seem too concerned about it.

If you find it useful, let me know.

Thursday, January 01, 2015

A Federalist Settlement for Nebraska and Oklahoma v Colorado

It seems to me that there is a simple and fair settlement to be made in this case, one that will preserve Colorado's right to determine for its citizens what they should be allowed to consume, while not treading on the rights of Nebraska and Oklahoma to make different rules.

Upon application from the Attorney General of another State to the Attorney General of Colorado making such a request, the Attorney General of Colorado will issue regulations prohibiting sale of Marijuana to citizens of the requesting state.

It is already a requirement to present ID to purchase Marijuana in Colorado, so the added burden of checking which state issued the ID (or the address on the ID) is not a great one.  While this doesn't do everything possible to ameliorate the effects of legal pot on neighboring states, it addresses what must be the largest problem, that citizens of other states will simply show up, legally buy it, then bring it home.

Commercial smuggling is another matter, but the quantities involved are (my experience with enforcing Marijuana laws is basically limited to a single case I presented to a Brooklyn Grand Jury, but that is another story) generally much larger than what is permitted to be sold in Colorado, so one hopes that in the interest of reaching a settlement, Nebraska and Oklahoma will not demand an end to all legal sales in Colorado.

If we take seriously the "laboratories of Democracy" theory of Federalism, it isn't too much of a stretch to ask that states limit themselves to experimenting on their own citizens, to the extent practicable.

Suits between states were much more common before the Federalization of pollution laws. In a system of increased Federalism, there will unfortunately be increased conflicts between states, as they naturally chose differently in various areas.  I don't claim to have a universally applicable framework for resolving such disputes, but I hope this is a good initial sketch.

(In case you have no idea what any of this is about, see: the Supreme Court filing.)