i2c wav player chip

31
Art Hacking Dave Monachello [email protected] Project blog: sidnancy.posterous.com

Upload: api-26485814

Post on 10-Apr-2015

680 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: i2c Wav Player Chip

Art Hacking

Dave [email protected]

Project blog: sidnancy.posterous.com

Page 2: i2c Wav Player Chip

2

inspiration/history

Page 3: i2c Wav Player Chip

Demo

Page 4: i2c Wav Player Chip

4

How El-wire works

electroluminescent phosphor emits light when placed in a field of AC current.

Zinc sulfide powder, with small additions of copper or manganese

Page 5: i2c Wav Player Chip

How El-wire works

Page 6: i2c Wav Player Chip

How El-wire works

Page 7: i2c Wav Player Chip

How El-wire works

Page 8: i2c Wav Player Chip

8

What does it do?

Animated el-wire portrait Driven by a home-made sequencer that animated the

el-wire Provides synchronized sound via wave file player The el-wire animation data and wave file are stored

on an SD card There can be multiple animations on a card The system will loop through the SD card directory

(fat16 file system) and play all animation file pairs it finds

Page 9: i2c Wav Player Chip

9

System Architecture

Page 10: i2c Wav Player Chip

System

ELWire

(24 segments)

I2cseq I2c

seq

I2cseq

CPUcard

ACinverter

AMPspeaker

speaker

12v 12v6vsdcard

8 AC lines 8 AC lines

8AC

lines

I2C

I2CI2CAC

ACAC

Page 11: i2c Wav Player Chip

11

Hardware – el wire driver

Page 12: i2c Wav Player Chip

Triac circuit

Page 13: i2c Wav Player Chip

optoisolator

Page 14: i2c Wav Player Chip

Hardware – el wire driver

Page 15: i2c Wav Player Chip

15

Hardware – daughter board

Page 16: i2c Wav Player Chip

Hardware – daughter board

Page 17: i2c Wav Player Chip

17

Hardware – propeller chip

Page 18: i2c Wav Player Chip

18

Propeller cogs

Page 19: i2c Wav Player Chip

Propeller Counters

Page 20: i2c Wav Player Chip

20

EL Wire Portrait

Page 21: i2c Wav Player Chip

21

Software

Big picture Talking over I2C Playing a wave file - 1 Playing a wave file - 2

Page 22: i2c Wav Player Chip

22

Software Big Picture

Maincog

blinkercog

elcog

wavecog

SDcog

El datacog

I2Cpins

SPIpins

audiopins

I2Clib

Filereader

lib

Wavebufferplayer

Page 23: i2c Wav Player Chip

23

Talking over I2C

repeat

pindir := -1

repeat 8

outa[dbgLed] := !outa[dbgLed] ' toggle the debug led

i2cObject.i2cStart

i2cObject.i2cWrite(i2cMuxAddr, numI2cMuxBits) ' send address

i2cObject.i2cWrite(pindir, numI2cMuxBits) ' send the data

i2cObject.i2cStop

waitcnt(frameTime + cnt)

pindir <-= 1

Page 24: i2c Wav Player Chip

24

Playing a wave file - 1

'play the wave data from the buffer

PUB Player(pWav, buffSize, PinR, PinL) | idx, baseTime

'Set pins to output mode

DIRA[PinR]~~ 'Set Right Pin to output

DIRA[PinL]~~ 'Set Left Pin to output

'Set up this cog's counters to do D to A conversion

CTRA:= %00110 << 26 + 0<<9 + PinR

CTRB:= %00110 << 26 + 0<<9 + PinL

Page 25: i2c Wav Player Chip

25

Playing a wave file - 2

buffSize--

baseTime:=cnt+15000

'Play loop

repeat idx from 0 to buffSize

baseTime += 10000 ' assume this is 8k rate.

waitcnt(baseTime)

FRQA:=(byte[pWav+idx])<<24

FRQB:=FRQA ' copy same data to the other audio channel

Page 26: i2c Wav Player Chip

26

Creating sync data - 1

Page 27: i2c Wav Player Chip

27

Creating Sync data - 2

AI phoneme FV phoneme

Page 28: i2c Wav Player Chip

Creating sync data – 3

Page 29: i2c Wav Player Chip

Creating sync data - 4

Data file format – frame<sp>phoneme<nl>

example el data file:1 A

25 C

49 ^

73 D

97 E

Page 30: i2c Wav Player Chip

Big picture again

Maincog

blinkercog

elcog

wavecog

SDcog

El datacog

I2Cpins

SPIpins

audiopins

I2Clib

Filereader

lib

Wavebufferplayer

Page 31: i2c Wav Player Chip

Credits wav player - Raymond Allen

http://obex.parallax.com/objects/324/

I2C interface - James Burrows

http://obex.parallax.com/objects/217/

SPI interface to a Secure Digital card - Tomas Rokicki - http://obex.parallax.com/objects/92/

 El wire hardware ideas – guerroloco member of instructables

http://www.instructables.com/id/EL-wire-eye-candy/

another el wire sequencer - Dave Chesavage - http://www.oceanbeach.com/ches/travel/burning_man/artcar/el_wire_sequencer/index.html

El wire/lipsync data file – David Cuny

http://yolo.sourceforge.net/