Metafetish

Mac S&M

Mac S&M (Flickr Slideshow, Flash Required, No-Flash Needed Set Here)

I know a lot of people love their Macs. They love their Macs a lot.

However, some people love their Macs, and know how to fulfill the needs of the machine. Luckily, these people also post pictures of it to Flickr. Warning: Those not into slot close-ups and laptop lock S&M might find this set hard to handle.

This photo set is either awesome in a horribly strange way, or strange in a horribly awesome way. Or both.

BeepSex: TranceVibrator Patch for Max/MSP

BeepSex: TranceVibrator Patch for Max/MSP

Since we don't have enough project series going yet, it's time to add another one to the pile. Beepsex is all about audio triggered sex. Be it software (as it is in this case) or hardware, we're taking our usual role as mcgyver-respecting potheads and sound is our new bong making material. Except, you know, we do the sex stuff, so it's only illegal in some southern states.

In this round of BeepSex, we hook up the Rez TranceVibrator to Max/MSP, the visual audio/video programming environment. Using this patch, you can set any Max object that outputs an integer value to feed into the TranceVibrator speed control. Making music that will only be appreciated by drugged up kids or bedroom hermited monitor tanned geeks has never been so sex filled!

We recommend listening to Ganucheau while reading this article.

Beepsex - Trancevibrator patch for Max/MSP

BeepSex: TranceVibrator Patch for Max/MSP

Thanks to Ganucheau for poking me into playing with this in the first place.

Update 2013-05-25: Most of the code listed in this article now lives on my github, http://github.com/qdot/np_trancevibe. For drivers, use libtrancevibe: http://github.com/qdot/libtrancevibe. Links to old code are left intact in article but will most likely not work.

Beepy Shit

Mmmmm lordy, do I love the beepy shit. Most of the music I listen to these days can be defined as such. I've moved beyond instruments, beyond vocals, to the point where I can be completely happy listening to something that most people would mistake for a broken CD player being fisted by angry robots. It's with that interest in mind that I'm starting up the BeepSex portion of Slashdong.

Now, I'm assuming many of the readers of this page are familiar with techno, electronica, glitch, IDM, or whatever the hell else you want to call it. If not, welcome to the world of good music, you fucking luddite. Put that neandrathal acoustic guitar away and pick up a sequencer, 'cause you're on the bullet train to modern elitest, obscure, inaccessible music!

Seriously, if you aren't familiar with types of electronic music and actually care to read up, the best place to go is Ishkur's Guide to Electronic Music. It's a nice overview of all of the hojillion genres available in electronic music today. Most of the sarcastic comments in these entries will refer to the Glitch and IDM genres, as that's what I know more than you about.

Autechre button-pushing performing.

So, why have a section of a sex tech website dedicated to audio software interfacing? Simple. Ever been to an IDM show? Boring as shit, ain't it? One, maybe two guys, a ton of laptops and racks, and zero performance value. Everyone nods asynchronously to what THEY believe is the proper time signature (music quality is judged by the number of head-nodding patterns observed in the audience, more is better, as it shows that there are multiple interpretations of the white noise music happening), possibly some side to side movement of the performers. Add a turntable and DJ to the mix, and it's fucking christmas for those of us brave enough to leave our bedrooms and mailing list arguments long enough to go to a tiny, tiny, tiny room to see the show.

In other words, the majority of electronic shows blow. Bigtime.

BeepSex is an attempt to add a little bit of physical feedback to the music. During the original SeXBox articles period, we got quite a few emails from couples saying they enjoyed spending time together playing video games after building the SeXBox. Now, those significant others unfortunate enough to love someone who sits in front of a computer monitor for hours at a time fucking with waveforms when they could just as easily open their computer and kick it repeatedly while in close vicinity of a tape recorder can now be physically part of the grueling composition process.

Max/What?

I usually answer the question "What is Max/MSP, anyways?" with the answer "The shit. Totally."

Most people don't seem to like this answer very much.

Max/MSP is actually two things, so let's break it up.

Max is a visual programming language, created in 1986 as an environment for producing interactive music environments. In 1991, it was picked up by Opcode, and in 2000 changed hands to Cycling '74, who still owns it today.

The basic of Max are very, very simple. You have objects, and patch cables. Put the objects together, put patch cables in between them, and suddenly they can communicate to each other.

For example, the picture above is a very, very simple Max patch. The top object is a button. Whenever that button is pressed, it sends a "Bang" message across the patch cable to the Random object. When the Random object receives a Bang message, it generates a number between 0 and the argument given to it, in this case, 100. It then sends that number over the line to the Print object. The Print object prints the input received on the line to the Max Print Window. Eureka, we have a working Max Patch!

As you can see, programming in Max is very intuitive. No crazy syntax to remember (though value spread orders can get crazy, as they are dependant on the location of the object in the patch workspace), pictures you can drag instead of big boring text windows. Of course, what we just showed is rather simple. Actually, stupidly simple.

Real Max patches tend to look more like this (click the picture to see the fullsize version). That hurts my head.

So what does this have to do with music? That's where the MSP part comes in. MSP is a set of patches for audio construction and performance. Combined with the integrated MIDI functionality of Max, users can create mixers, software synths, and many other horribly complex things that boring violin players like me don't grok. There's also a patch set called Jitter that provides video manipulation patches. All of these patches can be used together to create complex audio/visual performance environments.

One of the great things about Max is the fact that you can load in External Objects. Using a freely available C SDK, you can write your own objects to insert directly into the Max workspace, meaning the development environment is almost infinitely extensible. And extend it we will!

Anyways, we'll let the artists make the pinko commie shit, we're here to engineer. Let's get to work.

Porting the TranceVibe to C

Our goal is to get a Windows Max object that will control a Rez TranceVibrator (Sorry Mac users, I swear I'll create a Mac version of the patch the second I get time to develop C TranceVibe code for the Mac). In a later article, we'll have it control a SexBox, but since there's a higher chance of people that playing with Max/MSP owning a Rez TranceVibrator, we're concentrating on that for the moment.

From the information in the earlier Rez TranceVibrator article here on Slashdong, we have C# source code and a driver DLL available. Since the DLL is in C, that means that C# is using basically the same calls a C program would to get to the juicy parts of the DLL. Yay for cross-language reusability!

You can skip this paragraph if you've already got your TranceVibrator working on your machine. Pick up the Trance Sharp Alpha utility. This has the INF and DLL file you'll need to use to install your TranceVibrator. Next, follow the instructions here on how to install the drivers for your TranceVibrator. Finally, assuming you've got the .Net Framework installed, run the TranceSharp program and make sure things vibrate.

Porting this to C is pretty simple. In fact, I'll just go ahead and list the source code here.

To compile the program, you'll need to link it with the uusbd.lib library in order to have the USB communications functions available. You can pick up the uusbd SDK by clicking here. To run the program, you'll need to have the uusbd DLL in either the same directory as the executable or in one of the designated DLL library paths.

TranceVibeC Source Code

The TranceVibrator wants a number between 0 and 255 to set the motor power with. So, for those of you that don't read C, this program takes a number from the command line, and feeds it to the TranceVibrator. If no number is passed, it just turns the TranceVibrator off. Please note that there's a ton of interesting and fun ways to crash the program, so don't go expecting to use it for everything, it's just a quick example to get this working in C.

Writing the Max/MSP Patch

Now that we have this working as a simple C program, we can start porting to the Max patch format. To do this, I gutted the plussz demo project that came with the Max/MSP SDK, divided up the code that we used in the prior program to get the TranceVibrator running, and pasted it to the proper functions in the patch code.

MaxTrance Patch Source Code

MaxTrance Patch Binaries

So, there's the code. Instead of taking our value from the command line input, we now take it from the bang event sent from whatever object is connected to the input of the MaxTrance event. Lots more work than just getting it from the command line, but it'll also be a lot cooler in the end, too. :)

Connecting it All Together

Ok, now that we have the patch together, we need to add it to Max and set up a control environment. We put the .mxe file into the patches directory of the Max/MSP install, and then select "Install" from the File menu. Select the new patch in the install file dialog, and you're ready to go!

Here's a picture of the demo patch we used.

This is just a slider bar with the output connected to a print statement and the MaxTrance object. Every time the bar is changed, it sends a Bang event over the output, which prints the value of the slider bar, and sets the motor speed of the TranceVibrator.

That's it! Max/MSP is now a sex toy controller.

Towards More Entertaining Beepy Shit Shows

There is now no excuse for there to be boring musical performances. You can hook sex toys up to this shit, for christ sake, so just hire some porn model to get on stage and offset your geeky, knob twiddling ass with some hawt sex0rz. It doesn't matter if you play the shittiest speedcore ever heard by man, I can guarentee people will show up, they just may not remember the performance for the 1000bpm earfuck you think is music.

Oh yeah, and if someone could tell me where to pick up the "l33t ae trickz" patch, that'd be awesome.

How Shit Works - Drawing Power from USB Ports

How Shit Works: Drawing Power from USB Ports

By LZ

Art by Hato Suzume

The design of a proper USB port on a host device like a PCs or a laptop computer can source at least 500mA, or five "unit loads" per USB socket (please don't ask your toshiba laptop to do this, it goes into a horrible state, and starts throwing alerts to the use controller). The specifications define a term called a "unit load", "one unit load" is in fact 100mA. Therefore a standard port can supply up to five unit loads.

The same goes for Self-powered USB hubs, they too can supply five unit loads. However, if you choose to use a Bus-powered (no external power supply) USB hub, you can guaranteed to supply only 1 unit load (100mA).

Further, the spec states - see Figure 1 - that a minimum available voltage from a USB host or powered hub at the peripheral end of the cable is 4.5V, while the minimum voltage from a USB bus-powered hub is 4.35V. So, as you can see, you must be careful with your designs.

Figure 1. USB Voltage Drops (from Universal Serial Bus Specification Rev 2.0)

Once connected, all USB devices must identify themselves to the host. This is called "enumeration." Now here is where things get interesting... All devices that plug into a USB port must start out drawing no more than one unit load, in other words 100mA. After handshaking with the host communicator, the device can determine if it can take/deliver the full five unit loads (500mA). In the identification process, the host determines the power needs of the USB devices and gives, or denies, the OK for the device to increase its load from 100mA maximum to 500mA maximum.

Okay, by now you must be saying to me, what the shit? Here goes... further reading of the spec allowed me to discover this, and communications with several designer that "skirt the rules" allows us to determine how implementations and actual practice generally diverges from the specifications or how undefined parts of the spec take shape. These are some of the observed USB characteristics that may not be obvious, yet can influence your designs.

  • USB ports do NOT limit current. Though the USB spec provides details about how much current a USB port must supply, there are limits that we can push a whale through on how much it might supply. Though the upper limit specifies that the current never exceed 5A, a wise designer should not rely on that. In any case, a USB port can never be counted on to limit its output current to 500mA, or any amount near that. In fact, output current from a port often exceeds several Amps since multi-port systems (like PCs) frequently have only one protection device for all ports in the system. The protection device is set above the TOTAL power rating of all the ports. So a four-port system may supply over 2A from one port if the other ports are not loaded. Furthermore, while some PCs use 10-20% accurate IC-based protection, other will use much less accurate poly-fuses (fuses that reset themselves) that will not trip until the load is 100% or more above the rating. Do the simple math ... 4 amps is maybe the protection limit.
  • USB Ports rarely (never) turn off power: This one has got to be my favourite, tweak your setting in the power management of the BIOS or your operating system, no matter what your system documentation says, there always seems to be power available as long as you are plugged into the wall. The USB spec is not at all specific about this, but it is sometimes believed that USB power may be disconnected as a result of failed enumeration, or other software or firmware problems. In actual practice, no USB host shuts off USB power for anything other that an electrical fault (like a short). There may an exception to this statement, but I have yet to see it. Laptop and motherboard makers are barely willing to pay for fault protection, let alone smart power switching. So no matter what dialog takes place (or does not take place) between a USB peripheral and host, 5V (at either 500mA or 100mA, or even maybe 2A or more) will be available. This is born out by the appearance in the market of USB powered reading lights, coffee mug warmers, and other similar items that have no communication capability. They may not be "compliant," but they do function.

How Shit Works: Drawing Power from USB Ports

How Shit Works: Drawing Power from USB Ports

First off, I'd like to welcome our newest contributor, LZ! I look forward to having someone writing for us that's way, way better at this stuff than I am. :) Now then, onto the article, our first original content in 3+ months.

Ever since the inception of the USB spec in 1995, USB has quickly become the leading connection mechanism for mass marketed PC peripherals. One of the advantages is the fact that products can draw power directly from the port instead of having to rely on an outside source. In this article, we explain the specifications and limits of drawing power from USB, as well as revealing some of the "off the spec" secrets USB Designers use.

If you're wondering what the hell this has to do with sex toys, go to your local sex shop and look around. USB powered toys are becoming quite common these days, since the power output is more than enough to drive a decent vibration motor.