week 8 more on Observation #2_POGO-DJ

Week 7 MIDI is the coolest thing EVER!!!!!! .............................................ok thats an exageration...

Here is my two pots controlling max via serial box, with the knobs on there and the addition of a midi connection. It works great, one knob controls pitch(frequency) the other controls velocity(volume). This box sends a MIDI note every 10 milliseconds. These note/velocity pairs can be used as continuous controllers in Max/MSP. This week i haven't been able to get my USB Midi interface to work with my PC. When i get back to my apartment one of these days i will hook things up on an Apple machine (plug-in-play USB, damn i like it when things just work right...) then you will get to see a nice max patch where im controlling something cool with the knobs, and maybe i will add a button...

 

 

Week 6 yoo bechya. this here wet weather makes for some productive lab time oh eh.

Below is a picture of the max patch i used today. the two pots connected to Max via the pic chip an serial, control frequency and amplitude of a software generated band limited square wave.

Here is the Max Text file for this patch. (this should work on a Mac or PC)

max v2;
#N vpatcher 14 59 226 675;
#P origin 58 0;
#P user ezdac~ 29 559 73 592 0;
#P user meter~ 81 458 113 542 100 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user gain~ 29 457 44 64 158 0 1.071519 7.94321 10.;
#P window setfont "Sans Serif" 18.;
#P newex 29 364 41 9109522 mtof;
#P newex 29 418 48 9109522 rect~;
#P number 29 202 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 101 305 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 29 305 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 15 55 615 455;
#P outlet 134 369 15 0;
#P outlet 85 365 15 0;
#P inlet 88 60 15 0;
#P window setfont "Sans Serif" 18.;
#P number 491 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 446 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 401 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 356 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 311 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 266 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 221 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 176 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 127 179 36 9109522 t b i;
#P number 84 103 93 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 131 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 86 335 42 18 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 86 293 416 9109522 gate 10;
#P newex 86 181 28 9109522 t 1;
#N counter;
#X flags 0 0;
#P newobj 86 226 67 9109522 counter;
#P newex 86 140 65 9109522 sel 144;
#P connect 16 0 6 0;
#P connect 4 0 17 0;
#P connect 6 0 0 0;
#P connect 0 0 2 0;
#P connect 7 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P connect 0 1 7 0;
#P connect 2 0 1 3;
#P connect 3 1 5 0;
#P connect 5 0 18 0;
#P connect 3 2 8 0;
#P connect 3 3 9 0;
#P connect 3 4 10 0;
#P connect 3 5 11 0;
#P connect 3 6 12 0;
#P connect 3 7 13 0;
#P connect 3 8 14 0;
#P connect 3 9 15 0;
#P fasten 7 1 3 1 158 280 155 280 497 280;
#P pop;
#P newobj 29 239 82 9109522 p likeMidi;
#P toggle 29 48 15 0;
#P newex 29 163 110 9109522 serial a 9600;
#P newex 29 86 77 9109522 metro 10;
#P connect 2 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 6 0;
#P connect 6 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 8 0;
#P connect 8 0 7 0;
#P connect 7 0 9 0;
#P fasten 5 0 9 0 106 450 34 450;
#P connect 9 0 11 0;
#P connect 9 0 11 1;
#P fasten 9 0 10 0 34 548 74 548 74 454 86 454;
#P connect 3 1 5 0;
#P pop;

 

 

Ok here is the basic code that works for Max/MSP... notice that i left in my debugging code. I programmed two chips, one with the code for Max, the other with the code fore HyperTerminal. this way i could identify quickly if I had a software problem in Max or a hardware problem on my breadboard. ( i did have a problem) My Pots were too close together on the board, and i didn't have the right capacitor to separate them, so i just moved them further apart and aaYup, it works now.

'****************************************************************
'* Name : TrixAreForKids_LCC.BAS *
'* Author : [LCC284] *
'* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 9/20/2005 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
DEFINE OSC 4
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS

Potvar1 VAR WORD ' Create variable to store result
Potvar2 var word
Sendvar1 var byte
Sendvar2 var byte


TRISA = %11111111 ' Set PORTA to all input
TRISB = %11111111 ' set portB to all input
ADCON1 = %10000010 ' Set PORTA analog and right justify result
Pause 500 ' Wait .5 second

Start:

OUTPUT PORTD.2
output portd.1
HIGH PORTD.2
PAUSE 150
LOW PORTD.2
PAUSE 110
HIGH PORTD.2
PAUSE 150
LOW PORTD.2
PAUSE 110
HIGH PORTD.2
PAUSE 150
LOW PORTD.2
PAUSE 110
HIGH PORTD.2
PAUSE 150


MAIN:
ADCIN 0, Potvar1 ' Read channel 0 to Potvar1
ADCIN 1, Potvar2 ' Read channel 1 to Potvar2
sendvar1 = potvar1 / 8
sendvar2 = potvar2 / 8

serout2 PORTC.6, 16468, [144, sendvar1, sendvar2]
 
'serout2 PORTC.6, 16468, [DEC sendvar1, 32, DEC sendvar2, 32,
sendvar1,32, sendvar2, 13, 10]
   ' send that pot var stuff as numbers and as ascii 32 = spacebar


GOTO MAIN

 

 

okeedokee. we gotcha here a max patch that takes them serial controls and draws some stuff on the screen. Now mind you i still need to fix that dang code on the pic chip (see below its a long story), but the lab was super busy tonight so im just gettin this test thing going so when the code on the pic is fixed i will be ready to rock. wwoooo doggy this here is some buggy data...

Oh Eh. BTW to get pictures off yer Wintel PC machine. Hi the [Print Scrn] button, then you can paste into your favorite graphix editor, or MS-Paint. you can then edit and export as a .GIF or .JPG its much easier and somewhat better looking than taking a photograph of your video monitor...

 

The regular sized breadboard doesn't fit so easily in little project boxes, and for the two knobs controlling software via serial data, i don't need all those connections. So i put everything for this project on a smaller breadboard. tomorrow, the box.

 

Here is the code i thought might work well for Max. but i need to scale things back to 7 bits of control data, then use the rest of the 8 bit headroom for routing and stuff, and get rid of the pause, Max has its own scheduling control. OOOfff sometimes it takes for EEEVVVeer to get something going, because the programmers and the laptops don't always get along so well. sometimes it takes a few hours just to make sure that its the computer or the programmer that is a little buggy. then I can get things going, but by then i am spent. oh eh...zzz

'****************************************************************
'* Name : TrixAreForKids_LCC.BAS *
'* Author : [LCC284] *
'* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 9/20/2005 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
DEFINE OSC 4
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS

Potvar1 VAR WORD ' Create variable to store result
Potvar2 var word
Sendvar1 var byte
Sendvar2 var byte


TRISA = %11111111 ' Set PORTA to all input
TRISB = %11111111 ' set portB to all input
ADCON1 = %10000010 ' Set PORTA analog and right justify result
Pause 500 ' Wait .5 second

Start:

OUTPUT PORTD.2
output portd.1
HIGH PORTD.2
PAUSE 150
LOW PORTD.2
PAUSE 110
HIGH PORTD.2
PAUSE 150
LOW PORTD.2
PAUSE 110
HIGH PORTD.2
PAUSE 150
LOW PORTD.2
PAUSE 110
HIGH PORTD.2
PAUSE 150

' flash the lights for a while then stay on.


MAIN:
ADCIN 0, Potvar1 ' Read channel 0 to Potvar1
ADCIN 1, Potvar2 ' Read channel 1 to Potvar2
sendvar1 = potvar1 / 4
sendvar2 = potvar2 / 4


serout2 PORTC.6, 16468, [DEC sendvar1, 32, DEC sendvar2, 32, sendvar1,
32, sendvar2, 13, 10]
   ' send that pot var stuff as numbers and as ascii 32 = spacebar

pause 10 'give the software a moment

GOTO MAIN

 

Observation #2 POGO SIMON BABY

[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][]][][][][]][][][][][]]]][][][][][][][[[[]]][][]]]]]][[[[[[]]]]]]][[[[[[[][[[]]]

week 5 eh.

ok so it took me some 2 hours to discover that the computer i was using did not want to program my chip. though it seemed to think it could, it couldnot. it could only erase the chip... so then i used a different computer and vvvvwuuuuaaaalllaa il marches tres bien. so now i have a chip that will beep when i plug it in. oh and turn on the power switch. i see the second year students with power switches and now understand why. they sure are convenient. yup. so then i added the extra variable resister so i could have two parameter controls. in the case of the program below, the parameters are tempo and pitch. one control varies the pause time in the execution of the loop, the other changes the frequency arguments of the freqout function. booooyaaah. beeps.

oh eh. notice those capacitors that are not plugged in. yah. they didn't work for the audio circuit i don't think. i guess they need to be polarized capacitors??? i still cant read schematic diagrams...

 

Oh eh. now we gotcha some code here eh. you betya its the code that'll make yer little pic chip there go beep beep beeeeep.yup thats some gooood code mmmmmhmmm eh.

'****************************************************************
'* Name : TrixAreForKids_LCC.BAS *
'* Author : [LCC284] *
'* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 9/20/2005 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
DEFINE OSC 4
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS

Potvar VAR WORD ' Create variable to store result
incVar var byte
pitchVar var word
freqVar var word

TRISA = %11111111 ' Set PORTA to all input
ADCON1 = %10000010 ' Set PORTA analog and right justify result
Pause 500 ' Wait .5 second

Start:

OUTPUT PORTD.2
output portd.1

MAIN:
ADCIN 0, freqVar ' Read channel 0 to adval
ADCIN 1, Potvar ' Read channel 1 to adval
incVar = incVar + 1
serout2 PORTC.6, 16468, [DEC incVar, 13, 10]

HIGH PORTD.2
PAUSE (Potvar / 4 + 10)
LOW PORTD.2
PAUSE (Potvar / 4 + 10)
pitchVar = freqVar * 4
freqout portd.1, 150, pitchvar, pitchvar 'beep baby beep!!!!

GOTO MAIN

[[[]]]]]]]]]]]]]][[[[[[[][][]][][][][[[[[[[[]]]][][][][][][][][][[[[ ][ ] [ ] [ ][ ][][[][][][][][][][]]]]]]]]]]]][[[[[[[[[[[[[[

week 4:

oh eh. and the 1st observation project can be located ici.

Ok yah so im making a backup breadboard with the same arrangment so i can bug fix this thing when i start adding more complicated components.

[][]]]]]]]]]]]]]]][[[]]]]]]]]]]]]]]]]]]]]][][][][][][][][[][][][][][][][][][][][][[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

Week 03: Pic Chips kick ass.

now that i have the right gage of wire i am making my breadboards look nicer, and soldering things like the power thingy and the serial thingy.

Hey Oh. Looky we gots the code just for your enjoyment

'****************************************************************
'* Name : TrixAreForKids_LCC.BAS *
'* Author : [LCC284] *
'* Notice : Copyright (c) 2005 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 9/20/2005 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
DEFINE OSC 4
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS

Potvar VAR WORD ' Create variable to store result
incVar var byte

TRISA = %11111111 ' Set PORTA to all input
ADCON1 = %10000010 ' Set PORTA analog and right justify result
Pause 500 ' Wait .5 second

Start:

OUTPUT PORTD.2

MAIN:
ADCIN 0, Potvar ' Read channel 0 to adval
incVar = incVar + 1
serout2 PORTC.6, 16468, [DEC incVar, 13, 10]

HIGH PORTD.2
PAUSE (Potvar / 4 + 10)
LOW PORTD.2
PAUSE (Potvar / 4 + 10)

GOTO MAIN

'## end code.

about this code. it loops though the 8 bit number range (0-255) at a variable rate. the 10k pot is my variable rate control

 

[]][][][][][][[[[][][][]]]]]]][][]]]]]]]][[[[[]][][][][]]]]]]]]]][[[[[][][][][][][][][][][]]]]]]]][[[[[]][[[[[[]]]]]]]]]]][][][][][][][][][]

Week 02: basic electronics.

they have been out of kits at the book store for a while, so i am putting together my own kit from parts at the store and radio shack. i mistakenly bought the wrong gage of wire, it was twisted core so i just broke off strands until it was small enough to fit in the breadboard...

i also bought the wrong type of LED. this one was a 5 volt LED so when i used the resistor as described in the diagram i would get a flashing LED...

ok here is some foam in my MilmoeBox so things dont wiggle around some much when im running to class late.

 

][[[[[[[[[[[[[[[[[[][][[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]][][][][][][[][[[[[[[[[][]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]][[]]][[[[[

Week 01: 7-14 September 2005

Making my MilmoeBox. This was an old analog cassette holder. i was going to use it for shows where i played lots of tapes but then i got a laptop and could play "tapes" from the hard drive... anyway its been carrying small pieces of equipment since then. usually midi controll surfaces and interfacing hardway. hopefully i will soon build a kickin' performance interface that will fit in this little case...

i like walking around carrying a brief case looking object and whering dark glasses. i feel like a cia/sectret service assassin