Dave Goeb / audiomoc |
Audio Visualization using LEGO. A Guide to creating LEGO MOCs that move to the music. ©20010921 David H. Goeb (last updated 21.10.02)
Audio Visualization using LEGO. DHG2001 Table of Contents 0. Introduction and Example 1. Building 2. Trouble at the Mill 3. Porting to other Operating Systems and players 4. Refs and Links 15 Sec AVI of Club POC-MOC Section 0: Intro and Example 0.a: Introduction Well now making audio directed robotic creations is dead easy too. This guide covers all the steps needed to build your own Robotic Audio Visualization Systems out of LEGO. I have provided a plugin for use with Apples Freeware Audio-Media Player iTunes and rough help on porting for other operating systems and audio players. The following example diagrams and photos should illustrate all the major components and interactions you need however there are some points that left for the sub-sections to explain in detail. This is the first draft and has some parts missing and grammer problems creep in might, stay tooned for updates.Email me for plugins now that Apple has gone PAY 0.b: Example The example is a simple dioramma of Club POC-MOC in downtown Tanbricton. It has three major elements that are controlled by the RCX
When in use the iTunes plugin sends the center audio level via the IR-Tower. The Message is received by the RCX and the NQC program (4.d) and makes changes to the Output ports based on the message. Section 1: Building 1.a: Building hints Keep Tower in visual sight of the RCX. Get Wall-Wart power supplies for both the tower and RCX or you will buy many many batteries. Thrashing and Wandering is an issue as is cables getting tangled. 1.b: Some suggested projects Lasers lissajoux display, Vu meters, dancing mecha, Merry-Go-Round... 1.c: Some Example Dios (click thumb for more pictures) Section 2: Trouble shooting Q. Why is there so little in this guide? A. Fisrt daft(sic). I will be updating the page as I make it up, Create it Yeah thats it Create It. Q. What can I do when it just jerks about kind of random? A. Smooth out the speed transitions in the Code or add an extra gear pair. If RCX-Language has Float command try setting it rather than going to full out to next power level. Q. I keep missing messages! A. Make one task that just eats messages and updates settings for your movement tasks. If you use Wait or Delay commands you may miss out on messages during the delay. Q. It just destroyed my House/Car/Computer/Dog what are you going to do!!! A. ADZE-EES KNOW LIE-AH-BILLY-TEASE!! Especially if you keep playing Garbage(Push it) and it finally jumps up and spray paints the living room black, so dont come crying to me. Section 3: Porting to other OSs and Audio-Players In most cases you should be able to find the plugin-SDK for your Fav player. In writing the plug in there are a number of points that you may want to keep in mind; The IR Tower is a 2400.8.2.odd device and can be thought of as a Infrared Modem. The Packing of the Data is described detail at this link. Try to limit the number of times you send messages or risk overloading. You may be able to implement faster methods if you use one of the RCX2RCX protocals. (4.a) Opening and Closing the port each time you Send is not a bad thing. Some players do not send all their clean up messages in some cases(bombing). Play Safe. Even if you do not have the ability to create plugins for the player you like you may still be able to intercept the audio stream. Then process and send to the serial port via Perl RCX.pm or other code library. Others: xplsisnjasp XMM Plugin A great generic control plugin with source for linux. Section 4: Links, References and Appendices 4.a: Links Usual disclaimers that no one mentioned has their copyrights infringed etc. Apple (iTunes, OS9) LEGO (LEGO products) Lugnet (Helpful friends) RCX Info (RCX Internal info) RCX info (More RCX info) Audio (Therory Info) VJ stuff (links resources software etc) Audio Programming(resource) iTunes plugin (RealBasic plugin) Fun (resource) Info (resource) Info(resource) 4.b: Refs Dave Baums Difinitive Guide To LEGO MIDSTORMS. Baum D.,Apress LEGO MINDSTORMS Robotics, Knudsen J.B.,OReilly Engineering Formulas 7thEd, Gieck K. & Gieck R., McGraw-Hill A Programmers Guide to Sound, Kientzle T.,Addison Wesely 4.c: DHG-Visual Plugin Keyboard mini-reference Email me for the plugins. All the DHG-Plugins(classic OS 9) have RCX output (See each plugins Docs for additional key assignemnts). opt Tt toggles Target from RCX or GENERIC . Generic mode does not send IR-TOWER Packet Header and Xsum just the Value; opt Mm toggles sending Mode to Mono or Stereo . Mono sends 0..127 level value . Stereo sends Left as 0..127 and Right as 128+0..127(hi bit set) opt Pp Sets port attached to IR-Tower for Modem or Printer. opt Ss Starts and Stops sending. 4.d: Example NQC Code for Dioramma // LightShow Test 2 20010927 DHG // Test the Plugin at Club Poc-Moc // ---Expects Mono RCX Message Mode // ---External Setup // Output A: Dual Lamp brick(attached for Forward Blink) // Output B: Motor and Rotating Fiberoptic lamp // Output C: Single Lamp int mess; // The message int wind; // Wind down counter task main() { // Rev yer engines mess = 0; wind = 100; ClearMessage(); // reset while (true){ do { wind--; mess = Message(); ClearMessage(); if (wind < 0) { Off(OUT_A); Off(OUT_B);Off(OUT_C);}; // if (wind < 0) { Float(OUT_A); Float(OUT_B); Float(OUT_C);}; } until(mess !=0); wind = 100; if (mess>10) { if (mess < 40) { SetDirection(OUT_B,OUT_FWD); SetPower(OUT_B,mess/32+3); On(OUT_B); SetPower(OUT_A,mess/32+3); On(OUT_A); } else { SetDirection(OUT_B,OUT_REV); SetPower(OUT_B,mess/32+3); On(OUT_B); SetPower(OUT_C,mess/32+3); On(OUT_C); } } else { if (mess > 2) { SetDirection(OUT_B,OUT_REV); SetPower(OUT_B,mess/2+2); On(OUT_B); // Wait(3); Float(OUT_B); } else { Off(OUT_A); Off(OUT_B); Off(OUT_C); } } } } |
Primary content in this document is © Dave Goeb. All other text, images, or trademarks in this document are the intellectual property of their respective owners. |
|
©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR |