virtual musical instrument integrated...

15
BERKELEY PAR LAB Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah Bird, Gage Eads, Yunsup Lee, Ian Saxton, David Sheffield, Andrew Waterman, David Wessel ParLab Final Party May 30 th 2013

Upload: others

Post on 07-Jun-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB BERKELEY PAR LAB

Virtual Musical Instrument

Integrated Demo

Michael Anderson, Grey Ballard, Sarah Bird,

Gage Eads, Yunsup Lee, Ian Saxton, David

Sheffield, Andrew Waterman, David Wessel

ParLab Final Party

May 30th 2013

Page 2: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Demo Overview

Vision-based virtual music instrument

Synthesizing audio from hand motions over a drum

Demonstrates ParLab technology working together:

SEJITS

Tessellation

RISC-V

Communication-avoiding algorithms

Parallel computer vision

Audio graph signal processing

Live video capture Computed motion Synthesized Audio

Page 3: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Inspiration: Ed Thigpin Solo

Brushes

3

Page 4: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Optical Flow

Color code

• Optical flow computes the apparent motion of each pixel (direction and speed) across two frames of a video

• We solve optical flow using the Horn-Schunck method

• Inner loop is a sparse linear solve with 2 coupled 5-point stencils

• We can solve the linear system using communication-avoiding conjugate gradient (CA-CG)

• We demonstrate two versions: – CA-CG in OpenCL (Native GPU code)

– CG in Three Fingered Jack (SEJITS vectorizing compiler)

Optical flow field

Structure of optical flow sparse matrix

Page 5: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Three Fingered Jack

Three Fingered Jack – Three Fingered Jack is a Python-based SEJITS framework to generate code for data-

parallel and many-core CPUs along with generating custom processing engine implementations

– Parallelism extracted using reordering transforms

– We use TFJ to target SSE on Tessellation and the vector unit on RISC-V Hwacha (UC Berkeley test chip)

5

Cache

Vector Register-File

Memory Controller

RISC-V

Vector

Core

Data-Parallel CPUs Multicore CPU Custom PEs

Page 6: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Music Synthesis Overview

Page 7: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Music Synthesis Details

NoiseGenerator

Bandpass Filter

OF Vector Angle

Audio Frequency

Mapping

Volume

OF Vector Magnitude

Mapping

Audio

Gain

Output

import("music.lib"); import("filter.lib"); pitch_param = hslider("pitch", 60, 0, 128, 0.00001); gain_param = hslider("gain", 0, -128, 0, 0.00001); pitch = smooth(0.9995, pitch_param); gain = smooth(0.9995, gain_param); pitch_to_freq(pitch) = 440.0 * pow(2.0, (pitch - 69.0) / 12.0); process = db2linear(gain) * noise : resonbp(pitch_to_freq(pitch), 30.0, 1.0);

Faust Source Code:

Page 8: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Our Configurations

8

• Linux with NVIDIA GPU

Linux Configuration

OpenCL

GPGPU

x86

Multicore

Tess Linux

PULSE

GRR

TFJ

Optical Flow

Music Synthesis

RISC-V

RV FPGA

RV Chip

Page 9: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Our Configurations

9

• Tessellation on FPGA-simulated RISC-V

• Three Fingered Jack offline assembly-code generation

Tessellation on RV FPGA configuration

OpenCL

GPGPU

Tess Linux

PULSE

GRR

TFJ

Optical Flow

Music Synthesis

RISC-V

RV FPGA

RV Chip

Page 10: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Our Configurations

10

• EOS14 (RISC-V chip)

• Three Fingered Jack offline assembly-code generation

EOS14 (RISC-V chip) configuration

OpenCL

GPGPU

Tess Linux

PULSE

GRR

TFJ

Optical Flow

Music Synthesis

RISC-V

RV Chip

Page 11: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Our Configurations

11

• Tessellation on x86

• Three Fingered Jack offline source-to-source translation

Tessellation on x86 Configuration

OpenCL

GPGPU

x86

Multicore

Tess Linux

PULSE

GRR

TFJ

Optical Flow

Music Synthesis

RISC-V

RV FPGA

RV Chip

Page 12: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Linux Configuration

Optical Flow / Music Demo

Parlab Optical Flow + Communication-avoiding CG

Parlab Audio

OpenCV/Video4Linux

OpenCL PortAudio Faust

Linux

Camera NVIDIA GPU Intel CPU Audio Device

Frame Capture Optical Flow Computation Audio Synthesis

Playstation Eye Webcam

Solve Optical Flow on GPU

Audio Synthesis

Sound through speakers

Capture Movement

Page 13: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Audio Synthesis Optical Flow Computation Frame Capture

Tessellation on FPGA-simulated

RISC-V Configuration

FPGA Demo Client

Parlab Optical Flow

TFJ (Offline)

Tessellation

FPGA

Demo Server

OpenCV / Video4Linux

Linux

Intel CPU Camera

Demo Server PlayStation

Eye Webcam Zynq FPGA SoC

Audio Device

Parlab Audio

PortAudio Faust

Page 14: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Audio Synthesis

Optical Flow Computation

Frame Capture

Tessellation on RISC-V Chip

FPGA Demo Client

Parlab Optical Flow

TFJ (Offline)

EOS14 RISC-V Chip

Demo Server

OpenCV / Video4Linux

Linux

Intel CPU Camera Audio Device

Parlab Audio

PortAudio Faust

Demo Server EOS14 Chip

PlayStation Eye Webcam Opal Kelly

Interface

Page 15: Virtual Musical Instrument Integrated Demoparlab.eecs.berkeley.edu/sites/all/parlab/files/Virtual...Virtual Musical Instrument Integrated Demo Michael Anderson, Grey Ballard, Sarah

BERKELEY PAR LAB

Audio Synthesis Optical Flow Computation Frame Capture

Tessellation on x86 Configuration

Demo Client

Parlab Optical Flow

Parlab Audio

TFJ (Offline) PortAudio Faust

Tessellation

Intel CPU Audio Device

Demo Server

OpenCV / Video4Linux

Linux

NIC Intel CPU Camera

NIC

Frame Data

Demo Server PlayStation

Eye Webcam Demo Client Ethernet Switch