Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface -...

41
Conductor Hero Natalie Cheung, Yuta Kuboyama, Edgar Twigg

Transcript of Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface -...

Page 1: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Conductor HeroNatalie Cheung, Yuta Kuboyama, Edgar Twigg

Page 2: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Introduction

Page 3: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Goal: Conduct an Orchestra based on Hand Movements

•Score transferred through a USB Port•User conducts the entire orchestra and smaller sections•Output orchestra music and graphical representation of the

orchestra on the screen

Overview

Page 4: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USBInput Score Data

Score Manager

Conductor

Mixer

enb enbpitch pitchpitch

dynamicsarticulationsection_sel

video_out

USB245M

note_data

beat_numbusynote_data(no beat)

video_input

enb

tempo

beat

stereo_left,stereo_right stereo_left, stereo_right

stereo_left, stereo_right

audio_out

reprogram

22

12

10

7 77

8 83

2x16 2x16 2x16

2x24Compressor

signal_sum

reset

reset

reset

ZBTnote_data

address address1919

34 34

2x16

clk2 clk2

clk2

clk2

clk2clk2

clk1

ZBT ZBT

write_enbread_enb

VideoDecoder

video_data

Instrument Manager

reset

Page 5: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USBInput Score Data

Score Manager

Conductor

Mixer

enb enbpitch pitchpitch

dynamicsarticulationsection_sel

video_out

USB245M

note_data

beat_numbusynote_data(no beat)

video_input

enb

tempo

beat

stereo_left,stereo_right stereo_left, stereo_right

stereo_left, stereo_right

audio_out

reprogram

22

12

10

7 77

8 83

2x16 2x16 2x16

2x24Compressor

signal_sum

reset

reset

reset

ZBTnote_data

address address1919

34 34

2x16

clk2 clk2

clk2

clk2

clk2clk2

clk1

ZBT ZBT

write_enbread_enb

VideoDecoder

video_data

Instrument Manager

reset

• Score Management- Music data handling- Takes numeric user signals and score data to determine what instruments play when

Page 6: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USBInput Score Data

Score Manager

Conductor

Mixer

enb enbpitch pitchpitch

dynamicsarticulationsection_sel

video_out

USB245M

note_data

beat_numbusynote_data(no beat)

video_input

enb

tempo

beat

stereo_left,stereo_right stereo_left, stereo_right

stereo_left, stereo_right

audio_out

reprogram

22

12

10

7 77

8 83

2x16 2x16 2x16

2x24Compressor

signal_sum

reset

reset

reset

ZBTnote_data

address address1919

34 34

2x16

clk2 clk2

clk2

clk2

clk2clk2

clk1

ZBT ZBT

write_enbread_enb

VideoDecoder

video_data

Instrument Manager

reset

• Conductor- User Interface- Generates numeric signals from user movement

• Score Management- Music data handling- Takes numeric user signals and score data to determine what instruments play when

Page 7: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USBInput Score Data

Score Manager

Conductor

Mixer

enb enbpitch pitchpitch

dynamicsarticulationsection_sel

video_out

USB245M

note_data

beat_numbusynote_data(no beat)

video_input

enb

tempo

beat

stereo_left,stereo_right stereo_left, stereo_right

stereo_left, stereo_right

audio_out

reprogram

22

12

10

7 77

8 83

2x16 2x16 2x16

2x24Compressor

signal_sum

reset

reset

reset

ZBTnote_data

address address1919

34 34

2x16

clk2 clk2

clk2

clk2

clk2clk2

clk1

ZBT ZBT

write_enbread_enb

VideoDecoder

video_data

Instrument Manager

reset

• Conductor- User Interface- Generates numeric signals from user movement

• Score Management- Music data handling- Takes numeric user signals and score data to determine what instruments play when

• Sound Synthesis- Given on/off and pitch- Generates actual sound

Page 8: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Time

24

ticks

beatbeatbeat

• 128 ticks per beat• At 50 bpm a tick lasts for 9.4ms

- humans can detect differences of ~20-30ms• Uneven note durations (e.g. triplets) won’t sound choppy

Page 9: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

NoteData Format

Start Beat Start Tick Instrument Pitch Enable

0-11 (0-4095) 12-18 (0-127) 19-25 (0-127) 26-32 (0-127) 33 (0-1)

• Each NoteData takes up one 36 bit wide SRAM location• Two NoteData events per note (on and off) = 72 bits per note• 500 Measures in 4/4, average of 15 notes per beat = 2.06Mb

Page 10: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Score Management

Page 11: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

note_data note_data

note_data

USBInput

ZBT Score Data

address

19

34 34

address

19

USB 245M

reprogram

22 12

Score Manager

reset

reset

reset

pitch 7 enable

beat

tempo

10

Tick Counter

pitch 7 enable pitch 7 enable

reset7

beat_num

current_tick

Page 12: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

note_data note_data

note_data

USBInput

ZBT Score Data

address

19

34 34

address

19

USB 245M

reprogram

22 12

Score Manager

reset

reset

reset

pitch 7 enable

beat

tempo

10

Tick Counter

pitch 7 enable pitch 7 enable

reset7

beat_num

current_tick

puts USB data into

ZBT SRAM

Page 13: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

note_data note_data

note_data

USBInput

ZBT Score Data

address

19

34 34

address

19

USB 245M

reprogram

22 12

Score Manager

reset

reset

reset

pitch 7 enable

beat

tempo

10

Tick Counter

pitch 7 enable pitch 7 enable

reset7

beat_num

current_tick

puts USB data into

ZBT SRAM

When beat_num > current beatbusy = highoutput new note_data

Page 14: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

note_data note_data

note_data

USBInput

ZBT Score Data

address

19

34 34

address

19

USB 245M

reprogram

22 12

Score Manager

reset

reset

reset

pitch 7 enable

beat

tempo

10

Tick Counter

pitch 7 enable pitch 7 enable

reset7

beat_num

current_tick

puts USB data into

ZBT SRAM

When beat_num > current beatbusy = highoutput new note_data

If beat switches stateincrement beat_numwhile Score Data is busy

overwrite BRAM w/ new note_dataall data in BRAM now has same beat

If current_tick == tick in BRAMdo the note (turn on/off, set pitch, etc)

Page 15: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

note_data note_data

note_data

USBInput

ZBT Score Data

address

19

34 34

address

19

USB 245M

reprogram

22 12

Score Manager

reset

reset

reset

pitch 7 enable

beat

tempo

10

Tick Counter

pitch 7 enable pitch 7 enable

reset7

beat_num

current_tick

puts USB data into

ZBT SRAM

When beat_num > current beatbusy = highoutput new note_data

If beat switches stateincrement beat_numwhile Score Data is busy

overwrite BRAM w/ new note_dataall data in BRAM now has same beat

If current_tick == tick in BRAMdo the note (turn on/off, set pitch, etc)

counts clock cyclescompares to #cyc/tickif a tick has passed

increment tick counter

Page 16: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USB Input (Data Reading Timings)

- excerpt from FTDI UM245R USB-Parallel

FIFO Development Module Datasheet

Page 17: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Tick Counter

Tick Counter

reset

7tempo

10

• Counts the # of clock cycles that have elapsed since the last tick• Calculates the # of clock cycles that should elapse before the next

tick based on the tempo• Increments the current tick when count = calculated

tempo4

beatsmin

_128 tickmin

_ 160minsec

= tempo_ 815ticksec

1tempo

_158sectick

_27,000,000 clksec

= 50,625,000tempo

clktick

Page 18: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Conductor

Page 19: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Conductor Module

Video Decoder• Detect LED using thresholds• Reject other colors• Store data into ZBT

Page 20: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Conductor Module

ZBT• Each frame

- ZBT1 collects information from video_data- Conductor module reads from ZBT2

• Every frame- ZBT1 <= ZBT2- ZBT2 <= ZBT1

Page 21: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Conductor Module

Conductor• Determine if there are 2 LEDs (conduct

the whole orchestra)• Determine position of LED• If position of LED remains the same for a

certain number of frames (based on a counter), the next time the LED moves to a different position, the beat enable is high

• Tempo is based on the velocity of the LED

Page 22: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sound Synthesis

Page 23: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USBInput Score Data

Score Manager

Conductor

Mixer

enb enbpitch pitchpitch

dynamicsarticulationsection_sel

video_out

USB245M

note_data

beat_numbusynote_data(no beat)

video_input

enb

tempo

beat

stereo_left,stereo_right stereo_left, stereo_right

stereo_left, stereo_right

audio_out

reprogram

22

12

10

7 77

8 83

2x16 2x16 2x16

2x24Compressor

signal_sum

reset

reset

reset

ZBTnote_data

address address1919

34 34

2x16

clk2 clk2

clk2

clk2

clk2clk2

clk1

ZBT ZBT

write_enbread_enb

VideoDecoder

video_data

Instrument Manager

reset

•Represents a section of instruments (strings, brass,etc), and produces audio signals for the instruments at specified pitches

•Consists of instrument parameters, signal processor, sample look-up table

•Updates the dynamics and articulation when the section selector matches

•Outputs a stereo signal representing the location in the orchestra

Instrument Manager

Page 24: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USBInput Score Data

Score Manager

Conductor

Mixer

enb enbpitch pitchpitch

dynamicsarticulationsection_sel

video_out

USB245M

note_data

beat_numbusynote_data(no beat)

video_input

enb

tempo

beat

stereo_left,stereo_right stereo_left, stereo_right

stereo_left, stereo_right

audio_out

reprogram

22

12

10

7 77

8 83

2x16 2x16 2x16

2x24Compressor

signal_sum

reset

reset

reset

ZBTnote_data

address address1919

34 34

2x16

clk2 clk2

clk2

clk2

clk2clk2

clk1

ZBT ZBT

write_enbread_enb

VideoDecoder

video_data

Instrument Manager

reset

•Simply adds the left channel and right channel signals separately

•Produces a 24-bit stereo signal from adding 16-bit stereo signals

Mixer

Page 25: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

USBInput Score Data

Score Manager

Conductor

Mixer

enb enbpitch pitchpitch

dynamicsarticulationsection_sel

video_out

USB245M

note_data

beat_numbusynote_data(no beat)

video_input

enb

tempo

beat

stereo_left,stereo_right stereo_left, stereo_right

stereo_left, stereo_right

audio_out

reprogram

22

12

10

7 77

8 83

2x16 2x16 2x16

2x24Compressor

signal_sum

reset

reset

reset

ZBTnote_data

address address1919

34 34

2x16

clk2 clk2

clk2

clk2

clk2clk2

clk1

ZBT ZBT

write_enbread_enb

VideoDecoder

video_data

Instrument Manager

reset

•Balances the output and prevents clipping or getting too quiet

•Applies gain < 1 for signals that would clip

•Applies gain > 1 for signals that are too quiet

•Sends a 16-bit stereo signal to the DAC, then to the speakers

Compressor

Page 26: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Memory and Resources

Page 27: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Memory and Resources

16 16 16 16 16 16 16

Sound sample lookup table

Page 28: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Memory and Resources

16 16 16 16 16 16 16

Sound sample lookup table

16 16 16 16 16 16 16

Sound sample lookup table

Page 29: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Memory and Resources

~4000 samples per instrument ~4000 samples per instrument

16 16 16 16 16 16 16

Sound sample lookup table

16 16 16 16 16 16 16

Sound sample lookup table

Page 30: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Memory and Resources

~4000 samples per instrument ~4000 samples per instrument

~15 instruments

16 16 16 16 16 16 16

Sound sample lookup table

16 16 16 16 16 16 16

Sound sample lookup table

Page 31: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Memory and Resources

~4000 samples per instrument ~4000 samples per instrument

~15 instruments

16 16 16 16 16 16 16

Sound sample lookup table

16 16 16 16 16 16 16

Sound sample lookup table

0.96Mbits out of 2.5Mbits on one FPGA

Page 32: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Finale

Page 33: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Page 34: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Detect LED ColorWrite USB Input ModuleSample Audio & Playback

Page 35: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Collect data and determine Beat and TempoWrite Score Data ModulePlayback audio at given pitch

Detect LED ColorWrite USB Input ModuleSample Audio & Playback

Page 36: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Thanksgiving Break

Collect data and determine Beat and TempoWrite Score Data ModulePlayback audio at given pitch

Detect LED ColorWrite USB Input ModuleSample Audio & Playback

Page 37: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Thanksgiving Break

Collect data and determine Beat and TempoWrite Score Data ModulePlayback audio at given pitch

Detect LED ColorWrite USB Input ModuleSample Audio & Playback

Write Score ManagerCreate Conductor Module for whole orchestra

Playback audio with Dynamics and Articulation Parameters

Page 38: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Thanksgiving Break

Integration

Collect data and determine Beat and TempoWrite Score Data ModulePlayback audio at given pitch

Detect LED ColorWrite USB Input ModuleSample Audio & Playback

Write Score ManagerCreate Conductor Module for whole orchestra

Playback audio with Dynamics and Articulation Parameters

Page 39: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Thanksgiving Break

Integration

Finishing Touches

Collect data and determine Beat and TempoWrite Score Data ModulePlayback audio at given pitch

Detect LED ColorWrite USB Input ModuleSample Audio & Playback

Write Score ManagerCreate Conductor Module for whole orchestra

Playback audio with Dynamics and Articulation Parameters

Page 40: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Sun Mon Tues Wed Thurs Fri Sat

Nov

Today

Dec

Timeline

30

2

25

18

17161514131211

9

19

26

3

10

20

27

4

11

21

28

5

12

22

29

6

13

23 24

7

14

1

8

15

Thanksgiving Break

Integration

Finishing Touches

Collect data and determine Beat and TempoWrite Score Data ModulePlayback audio at given pitch

Add orchstra sections and graphicsWrite MIDI to Bitfile ConverterWrite Mixer & Compressor Modules

Detect LED ColorWrite USB Input ModuleSample Audio & Playback

Write Score ManagerCreate Conductor Module for whole orchestra

Playback audio with Dynamics and Articulation Parameters

Page 41: Conductor Heroweb.mit.edu/6.111/www/f2007/projects/ncheung... · • Conductor - User Interface - Generates numeric signals from user movement • Score Management - Music data handling

Thank you...