Walking Productions

Intro to Physical Computing Journal

Shawn Van Every (sve204 at nyu dot edu), Fall 2002

Dec. 10, 2002

For my final project, I created a two touch-screen midi controller. It is fairly generic, not necessarily meant to control sound, although in demonstration that is what it does. The code is currently written so that the left hand screen maps to pitch (x-axis on touch), pitch-bend (x-axis on drag) and velocity (y-axis). The right hand screen maps to program change (x-axis).

The biggest issue that I had with the touch-screens is that the x and y values do not seem to be independent from each other. As the x value rises the y does as well. Many attempts have been made following others advise (generally relating to grounding the screen) to fix this problem but unfortunately I haven't had any success. I think that should I use this controller in another project (likely) that I will replace the cheap surplus touch-screens with some more expensive modern ones.

BasicX Code: finalchipcode.txt

Demonstration Movie 1
Demonstration Movie 2
Demonstration Movie 3
Demonstration Movie 4
Demonstration Movie 5

For Detailed information on touch-screen usage with the BX-24 visit Brian, Geraldine and David's Technical Research Project Page

Nov. 19, 2002

Hysteresis Code Example (very very rough): hysteresis.txt

Nov. 18, 2002

Continuation of serial communication, this time 2 way from BX to Java and back. A couple of tweaks in the code from the last time; fixing up the calibration routines and such. Still needs some work but here are the files for reference.

ChipProgram2.txt (BasicX)

Nov. 17, 2002

- Technical Research Project -

Electroluminescent Wire (ElWire)

Nov. 7, 2002

Just finished getting the BX to communicate with a simple Java program running on my laptop. It is the start of a larger project idea that may turn into my final project (assuming my culture jammer (see below) is too complex). Since there really is no way to adequately display this project on the web I am just going to post the source. Of note are the auto calibration and re-calibration routines in the BasicX code as well as the serial data sending. In the Java the noteworthy items are the custom JPanel with overriden paintComponent and the serial communications (which use the Java Communications API from Sun, not in the JDK).

ChipProgram.txt (BasicX)

Oct. 27, 2002

- Midterm Journal Entry -

After 7 weeks of classes in physical computing (and ITP) I feel as though now is as good of a time as any to put forth some concepts for projects that have been brewing in my consciousness. As of recent I have been thinking of a device that is a combination of interests held well before starting this semester with newly acquired knowledge gained through pcomp classes and outside research.

What is it, you might ask. Well, it is a "RF Appropriation Engine", a "Culture Jammer", a "Sonic Stealer", a self contained radio frequency to looping sound device. I am interested in working in the tradition of Negativland (http://www.negativland.com/)and EBN (http://www.guerrillanews.com/ebn/). This device will be created with intent of appropriating content from the airwaves and recontextualizing it. Perhaps this device will find it's way into live performance and dj space.

Using readily available components, this device will enable the user to tune into any of a series of publicly available radio frequencies, from Police and Fire through the AM dial and possibly further. When a frequency is encountered that the user feels compelled to utilize they can then press the record button and record a small (actual size to be determined) segment of audio off of the frequency. Once recording is finished they may then play this sample back which will loop indefinitely. The speed of the loop is determined by the tempo knob (a POT). The frequency tuning is performed via the Tune and Fine knobs (POTs), the record, stop and play functions are buttons located on the top of the unit. Two knobs (POTs) are available for volume control, one for the monitoring output (the frequency the device is tuned to) and the other for the output of the looped sample. Additionally a LED numeric readout of the current frequency will be displayed on the unit.

Equipment List and Schematics coming soon......

Next installment: Programmable Tattoo's... Stay Tuned!

Misc Links:
Surplus Supplies: http://www.sciplus.com/
Josh Nimoy- PlaySound mechanism of BX-24: http://stage.itp.tsoa.nyu.edu/~jn429/playsound/
Hibbico- R/C Products: http://www.hobbico.com/
Edmund Scientific's- Science and Engineering Supplies and Kits: http://www.scientificsonline.com/
More to come....

Oct. 25, 2002

Here are the pictures of my pcomp midterm. It is a dual beat loop with variable tempo and frequency. It also utilizes multi-tasking on the BX-24.

Here is the code.

Option Explicit

'Board Setup Constants
Private Const speakerPin1 As Byte = 13
Private Const speakerPin2 As Byte = 14
Private Const adcPin1 As Byte = 15
Private Const adcPin2 As Byte = 16
Private Const adcPin3 As Byte = 17
Private Const adcPin4 As Byte = 18

'Misc Constants
'Private Const readADCSleep As Single = 0.02 'Sleep seconds for ReadADC Sub
Private Const beatDuration As Integer = 1 'Beat duration in millisecs

'Global Vars
Private adcPin1Value As Integer 'Speaker1 Freq
Private adcPin2Value As Single 'Speaker1 Tempo
Private adcPin3Value As Integer 'Speaker2 Freq
Private adcPin4Value As Single 'Speaker2 Tempo

'Memory Allocation
' 400 bytes available for all of the program..
Private playBeat1Memory(1 to 100) As Byte 'Set aside 100 bytes of memory
Private playBeat2Memory(1 to 100) As Byte 'Set aside 100 bytes of memory

'Main Subroutine
Public Sub Main()
	'Always start with a delay
	Call delay(0.5)
	'Tell me I am running
	'debug.print "Program Running"
	'Make sure speakers work
	'freqout speakerPin1,1400,1400,200
	'freqout speakerPin2,1400,1400,200
	call ReadADCPins()
	callTask "PlayBeat1", playBeat1Memory
	callTask "PlayBeat2", playBeat2Memory
	         'debug.print "Loop Running"      
	         call ReadADCPins()
	         'Give up the processor for 200 milliseconds
	         call sleep(0.2)
End Sub

Private Sub ReadADCPins()
'Get all of the ADC values         
adcPin1Value = intRanger(0,1027,1,5000,getADC(adcPin1)) 'Speaker1 Freq
adcPin2Value = sngRanger(0.0,1027.0,0.1,2.0,CSng(getADC(adcPin2))) 'Speaker1 Tempo
adcPin3Value = intRanger(0,1027,1,5000,getADC(adcPin3)) 'Speaker2 Freq
adcPin4Value = sngRanger(0.0,1027.0,0.1,2.0,CSng(getADC(adcPin4))) 'Speaker2 Tempo

'Print Values out
'debug.print "Freq: " ; cStr(adcPin1Value)
'debug.print "Tempo: " ; cStr(adcPin2Value)

'Is this task running or do I need to set aside memory?
'debug.print "ReadADCPins running"
End Sub

Public Sub PlayBeat1()
                 freqout speakerPin1,adcPin1Value,adcPin1Value,beatDuration
                 'Is this task running
                 'debug.print "PlayBeat1 running"      
                 call delay(adcPin2Value)
End Sub

Public Sub PlayBeat2()
                 freqout speakerPin2,adcPin3Value,adcPin3Value,beatDuration
                 'Is this task running
                 'debug.print "PlayBeat2 running"
                 call delay(adcPin4Value)
End Sub

Function intRanger(byVal originalMin as integer, byVal originalMax as integer, byVal newMin as integer, byVal newMax as integer, byVal currentValue as integer) as integer
	dim zeroRefOriginalMax as long
	dim zeroRefNewMax as long
	dim zeroRefCurVal as long
	' Check for out of range currentValues
	if (currentValue < originalMin) then
	         currentValue = originalMin
	end if
	if (currentValue > originalMax) then
	         currentValue = originalMax
	end if
	' Zero Refference the values
	zeroRefOriginalMax = clng(originalMax - originalMin)
	zeroRefNewMax = clng(newMax - newMin)
	zeroRefCurVal = clng(currentValue - originalMin)
	' Check for negative values and 0 max ranges
	if ( (zeroRefNewMax < 1) OR (zeroRefOriginalMax < 1) OR (originalMin < 0) OR (originalMax < 1) OR (newMin < 0) OR (newMax < 1) OR (currentValue < 0)  ) then
	         intRanger = 0
	         Exit Function
	end if
	intRanger = cint( ( (zeroRefCurVal * zeroRefNewMax) \ (zeroRefOriginalMax) ) + clng(newMin) )
End Function

Function sngRanger(byVal originalMin as single, byVal originalMax as single, byVal newMin as single, byVal newMax as single, byVal currentValue as single) as single
	dim zeroRefOriginalMax as single
	dim zeroRefNewMax as single
	dim zeroRefCurVal as single
	' Check for out of range currentValues
	if (currentValue < originalMin) then
	         currentValue = originalMin
	end if
	if (currentValue > originalMax) then
	         currentValue = originalMax
	end if
	' Zero Refference the values
	zeroRefOriginalMax = originalMax - originalMin
	zeroRefNewMax = newMax - newMin
	zeroRefCurVal = currentValue - originalMin
	' ************FIX THIS**************
	' Check for negative values and 0 max ranges
	'if ( (zeroRefNewMax = 0.0) OR (zeroRefOriginalMax = 0.0) OR (originalMin = 0.0) OR (originalMax 0.0) OR (newMin = 0.0) OR (newMax = 0.0) OR (currentValue = 0.0)  ) then
	' sngRanger = 0.0
	' Exit Function
	'end if
	sngRanger =  ( (zeroRefCurVal * zeroRefNewMax) / (zeroRefOriginalMax) ) + csng(newMin) 
End Function

Oct. 17, 2002

Art Links Analysis
I choose: The Thimbletron, a thimble-based hand MIDI controller. http://evolution-control.com/thimbletron.html

While the website is interesting and demonstrates the item in pictures and a employs a bit of history (along with some imaginings) it doesn't get into the technical details. I will keep digging around for them.

First impressions are that it is a very interesting new interface, using something that people do all the time, tapping (to music) to actually make the music rather than just in responding to the music.

Utilizes software from Operation Re-Information (O.R.I.) http://www.reinformation.com that is currently in beta: BackToBasics. Not exactly sure what it is supposed to do since it doesn't seem to be working but it appears to be a sequencer using a custom created sound bank to play with.

The music created by evolution control committee (ecc) seems to be satirical using heavily sampled material along the lines of negativeland (URL) and ebn (URL). Good stuff.

One notable thing they did was to publish music utilizing napster "bombs", intentionally mislabeling their song as something popular at the time so as to get distribution through unsuspecting music traders.

Technical Details and Guesses: Thimbles are place on fingers (wearing gloves so body electromagnetic emission don't mess everything up) and wired to a chip (something that can drive midi messages and interface with a laptop, could be a bx-24). The chip is interfaced with a laptop running the midi syntheses software discussed above.

Late, Oct. 15, 2002

MidTerm Idea: A Beat Machine

  • Use knobs to control pitch and beat frequency of metronomes
  • How many beats?
  • Limited by the capabilities of the BX-24
  • What is the mapping?
  • BPM, Frequency and Duration
  • Multiple speakers - stereo?
  • Get voltage/wattage correct w/transistor/opamp or use Piezo buzzers. (See below)
  • Wire & solder up knobs bought on Canal St. to 10k pots
  • Create case for project using leftover Plexiglass
  • Write BasicX program using multitasking (threads)
  • Diagram of working amplified speaker setup (using NPN transistor) for midterm:

    This speaker doesn't melt. It is rated at .8 Watts (which I learned is supposed to be the MAX amount of power it can handle). Here is how I calculated what it is theoretically getting (which is too high):
    V = I * R therefore I = V / R
    W = V * I therefore W = V^2 / R
    5V coming from power supply, 10 ohm resistor and 8 ohm built into speaker, 18 ohms resistance
    W = (5^2) / 18 =~ 1.4 Watts (supposedly too much for the speaker but it isn't fried yet).

    After failure after failure trying to use the Op-Amp purchased at RadioShack (it needs much more power than I have available, (18 Volts), it was suggested that a transistor (such as above could be used instead). After some trial and error (melting speakers, see below) it does work!!!

    Early on Oct. 15, 2002

    An NPN Transistor Diagram:

    Correct usage of an NPN Transistor w/ Motor and Alternate Power Supply:

    Diagrams created to help understand how diode's function (in which direction the current flows):

    Oct. 14, 2002

    Using a transistor or how to fry a motor using a 9 Volt battery:

    Not only did I almost fry the motor in this setup, I was experimenting with amplifying a speaker and was completely successful in melting the speaker. Moral of the story, learn how to calculate WATTS, VOLTS, CURRENT and such before connecting higher voltage power supplies. At least the diode was facing the right direction

    Oct. 5, 2002 11:00 PM

    Found chapters 1 and 2 of Chris Crawford's book, Understanding Interactivity (http://www.erasmatazz.com/book.html) to be very worthwhile. It is the first time that I have read something that describes interactivity and it's richness without inspiring my disagreement on 50% of it.... I wrote to him expressing my desire to purchase the book, hopefully he will get back to me soon with the most effective way to do so.

    Oct. 4, 2002 8:00 PM

    Just arrived back at ITP from a somewhat eventful trip to RadioShack (Broadway and 9th St.). Apparently this RadioShack is open much later than the one in my neighborhood. I also discovered, on what is my 4th or 5th trip there, that they have many more components than I realized. Across the isle from the draw based component organizer they have the breadboards and project boxes along with various components (infrared and photocell sensors and battery holders are of particular interested). The events that took place had more to do with the insistence of the staff to try to sell me a new cell phone plan (which I happen to need) and a DirecTV system (which I most certainly do not need). Leaving me alone was apparently not an option.

    So, What did I get:

  • 12VDC Piezo Buzzer
  • 8-Oh Mini Speaker
  • 1458 Dual Op-Amp (Part No. 276-038)
  • Why, you might ask:
    Well, the Piezo buzzer is apparently an oscillator-less sound making system that will work with 5V power no problem (in essence, it can be powered by the BX-24 chip and the Audio frequency can be set by the BX’s Freqout command).

    The mini speaker is an attempt at the same albeit more complex. Apparently I need to use a transistor (which I have no clue about yet) or an Op-Amp (which I bought but don’t know anything about either) to get enough power to the speaker from the BX-24 chip.

    Ahh.. After looking at the RadioShack website (http://www.radioshack.com); I have learned that an Op Amp is an Operational Amplifier which I think means that it amplifies the Voltage to a higher voltage for components that require it.

    Here is a page that goes into quite a bit of depth regarding Op-Amps: http://ourworld.compuserve.com/homepages/Bill_Bowden/opamp.htm
    I will have to look it over during my experimentation.

    Oct. 4, 2002 7:00 PM

    I just finished building my project for Week 4, tracking changes with variables. I attempted to create a compositional mechanism (button recorder to sound player). As is shown in the picture below, the BX-24 is wired with a momentary button (black push button), a light to indicate recording (yellow led), a light to indicate playback (green led) and a sound generator (which is borrowed).

    When the board is powered, the mechanism is in the record state. Currently 10 pushes of the button will be timed, recorded and played back.

    Some problems with the system are as follows (I will address these if I have time before class):

  • Recording starts from the moment of power on. This creates a big delay in playback if button pushing is not immediate. Recording should start with a single push of the button.
  • Playback does not loop.
  • There is no mechanism to start again without cycling the power. (How are others doing these “reset” buttons?)
  • The BX-24 is not powerful enough to power the speaker/buzzer that I have (unfortunately it can not be oscillated either). I will have to look into other buzzer/speaker solutions (see later today).

    Here is the code that I wrote today:

    Option Explicit
    Public delayArray(1 to 10) As Single
    Public Const delayArraySize As Integer = 10
    'Can you make a growable array in basic?  
    'If I make it bigger, how does the user indicate being finished?
    Public Const beatLength As Single = 0.25 'Not actually being used right now
    'Need to alter the duration of the freqouts
    'Not sure how I would get the actual beat length yet
    'Change these per board setup
    Private Const recordSwitchPin As Byte = 11
    Private Const playLightPin As Byte = 15
    Private Const recordLightPin As Byte = 14
    Private Const recordButtonPin As Byte = 12
    Private Const playBuzzerPin As Byte = 13
    Public Sub Main()
    	debug.print "Program Running"
    	Call delay(0.5)
    	'Playing with freqout instead of just putPin
    	'call putPin(playBuzzerPin,1)
    	freqout 13,220,220,3000 'Just saying "I am on"
    	'debug.print "Buzzer should be going"
    	'call delay(3.0)
    	'debug.print "Buzzer should stop"
    	'call putPin(playBuzzerPin,0)
    	' Main routine
    	' if (getPin(recordSwitchPin) = 1) then
    		 call RecordArray()
    	' else
    		 call PlayArray()
    	' end if
    End Sub
    public Sub RecordArray()
    	Dim startTime As Single
    	Dim currentTime As Single
    	Dim arrayCounter As Integer 'array counter var
    	arrayCounter = 0 
    	call putPin(recordLightPin,1)
    	startTime = Timer
    	do while (arrayCounter < delayArraySize)
    		if (getPin(recordButtonPin) = 1) then
    			arrayCounter = arrayCounter + 1
    			call putPin(recordLightPin,0)
    			currentTime = Timer
    			delayArray(arrayCounter) = currentTime - startTime
    			startTime = Timer
    			call delay(beatLength)
    			call putPin(recordLightPin,1)
    		end if         
    	call putPin(recordLightPin,0)
    End Sub
    Public Sub PlayArray()
    	Dim arrayCounter As Integer
    	arrayCounter = 0
    	call putPin(playLightPin,1)
    	do while (arrayCounter < delayArraySize)
    		arrayCounter = arrayCounter + 1
    		call delay(delayArray(arrayCounter))
    		call putPin(playBuzzerPin,1)
    		call putPin(playLightPin,0)
    		call delay(beatLength)
    		call putPin(playLightPin,1)
    		freqout 13,2000,2000,500
    		'call putPin(playBuzzerPin,0)
    	call putPin(playLightPin,0)
    End Sub

    As you can see, it is considerably more complex that previous code examples. I learned quite a bit today regarding BasicX, including Timer and Freqout functions as well as Array manipulation and Constant declarations.

    Oct 4, 2002 3:00 PM

    Fantastic resource, those plastics stores on Canal. Interesting materials include styrofoam, all types of plastics and more. I think I would rather work with plastics than with wood or metal. Need to get good at using epoxy.

    [Later Note: Styrofoam may create excessive amounts of static electricity, might be best to stay away from its use. Again, not sure but I heard someone refer to such and it makes sense.]

    Oct. 4, 2002 11:00 AM

    Yeah! My Jameco order arrived (two days after order).
    Can’t wait to try out the LED panels.

    From the ITP P.Comp List, An electrical symbol font for doing schematics: http://notebook.beradio.com/ar/radio_electronic_symbols_true/

    Oct. 2, 2002 12:00 PM

    Just finished placing an order off of the Jameco.com site. Some two color LEDs, 100 220 Ohm resisters (the pcomp lab is out), two different kinds of LED arrays and my very own wire cutter/stripper tool (the one from K-Mart just didn’t cut it, pun intended).

    Did much research on building a LCD projector. My concept is not to build an LCD projector but to create a way to project RGB values from an array LEDs. In a sense, to simulate is a very rudimentary fashion a LCD projector. This idea is somewhat of a culmination of some things I recently read about a German group that created something called Blinkenlights (http://www.blinkenlights.de/) and a past desire to actually build an LCD projector.

    Some highlights of the research are the following URLs:

  • http://www.audiovisualizers.com/madlab/lcd_proj.htm - Diagrams, plans, compiled information
  • http://www.diyaudio.com/forums/showthread.php?threadid=281 - Great thread on a web based discussion group. Fantastic information regarding Super Bright LEDs which seem to be the way to do this (without the LCD screen, using the LED’s themselves as the display, perhaps with colored filters). I will have to do some more research and start building soon.

    Super Bright LED Retailers:

  • http://www.bgmicro.com/lmad.htm
  • http://www.partsexpress.com/pe/show...ectGroup_ID=554

    LED “Wall” Examples:

  • http://www.projektor-beamer.de/rueckprojektion/alfresco.htm
  • http://www.vidiwall.philips.com

    Oct. 1, 2002 3:00 PM

    Option Explicit
    Public Sub Main()
    	debug.print "Program Running"
    	call delay(0.5)
    	call MySub1(13, 16, 11)
    End Sub
    Public Sub MySub1(ByVal startPin as Byte, ByVal endPin as Byte, ByVal switchPin as Byte)
             debug.print "Subroutine Running"
             Dim counter as Integer
             counter = 0
             Dim pinCounter as Byte
             pinCounter = startPin
             Dim switchState as Byte
    	         'counter = counter + 1
    	         'debug.print "Loop: "; CStr(counter)
    	         'if (getPin(switchPin) = 1) then         
    	          ' call putPin(pinCounter, 1)
    	                 'debug.print CStr(pinCounter); " is on"
    	         ' call putPin(pinCounter, 0)
    	                 'debug.print CStr(pinCounter); " is off"
    	         'end if
    	         'A more efficient way to do the same
    	         switchState = getPin(switchPin)
    	         call putPin(pinCounter, switchState)         
    	         if (pinCounter >= endPin) then
    	                 pinCounter = startPin
    	                 pinCounter = pinCounter + 1
    	         end if
    End Sub

    Some Day in September 2002

    Hey look ma, it can be battery powered!

    Some Day in September 2002

    Oh my… Thank you Todd. After multiple days futzing with my BX-24 and switches it works

    My first attempt, apparently not a circuit, the BX-24 does not complete the circuit, it only senses the power in the switch. In other words, it is not a ground!

    Almost there, this one is a short circuit, no resistor

    Ah ha!, create a circuit as you normally would, just make sure the BX-24 is involved

    The below code never worked. Due to the problems with the switch described above, nonetheless here it is for reference:

    First BX-24 Project code (Meant to respond to a switch being turned on and off):

    Sub Main()
    	debug.print "Application Running!"
    	call delay(0.5)  ' start  program with a half-second delay 
    	call mySub()     ' call my subroutine            
    End Sub
    Sub mySub()
    	debug.print "Running My Subroutine!"
    	'call putPin(25,0)
    	'call putPin(26,0)
    	'call putPin(27,0)
    	Dim i as Byte
    		i = getPin(17)
    		debug.print CStr(i)
    		if i = 1 then
    			call putPin(15,0) ' it doesnt reset itself			
    			call putPin(13,1)
    			call delay(0.25)
    			call putPin(13,0)
    			call delay(0.25)
    			call putPin(13,0) ' for some reason you need to stop it?
    			call putPin(15,1)
         	end if
    End Sub

    Some Day in September 2002

    Just finished reading Bill Buxton's Less Is More essay. While the essay presented some interesting concepts and ideas that seem to be true, I disagree with his overly general thesis that divergence should be the dominant model in PC design. First off, I believe that it is incorrect to state that PC's are the dominant mode of computing at this time. Many devices that exist and are used in daily life are in fact computers. Bill gives the example of the camera as a computer, while this a good start it should be continued to list such items as televisions, cars, microwaves, airconditioners, on so forth. It is precisely these devices that have singular purposes with i/o mechanism suited to them that he is wishing for. They already exist!. As for the PC itself, yes, it has been static, it's functions have increased though it's usability has not. While his argument towards single purpose devices that emulate existing devices (such as internet radio, Kerbango) is compelling, the market has proven that it is not ready to accept such as of yet. Kerbango itself is gone, Palm has been given an ultimatum by the market to expand into portable generalist devices or die.. Consumers purchase single use devices that they have experience with pre-computer, post computer devices, digital devices are purchased somewhat according to what they can do. In an era where our children can run circles around us, when nuroens are formed around computers where brains are trained to interface with a keyboard and mouse, his arguments fall apart, his foundations lye broken. A new argument is needed.