Top Banner
Human Sensing Beam 2014
21

Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13) GFU&feature=relmfu.

Dec 28, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Human SensingBeam 2014

Page 2: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Low resolution image and Sound

• Image 8 x 8 pixels• Sound: 8 notes in an octave (13)•

http://www.youtube.com/watch?v=ljGMhDSSGFU&feature=relmfu

Page 3: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Musical Scale

• Notes are specific sounds• A melody is a sequence of these sounds

• Melody has “meaning”• Note sequence• Rythm

• Brain does a good job “remembering” sequences specific sounds

Page 4: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Sound Scapes

• “unspecific sounds” and iconic sounds– Noise– Background “canvas” of life– Uncontrolled sound– No coding sound

– But also “meaning”: bird sound, water sound, wind, applause: “iconic” sounds

Page 5: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Difference melody - iconic

• Melody is coded: can be low res– MIDI, very low filesize

• Iconic is uncoded: high res– HD, lots of memory

• Arduino can do – melody, – a bit of clicking, – but no really bird sounds, no MP3

Page 6: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Arduino Sound

• Quality: 8 bits (Arcade game sound)• If coded (melody): length no problem• If random clicks:no problem• If MP3: not possible (few seconds bad quality)– That is without extra electronics

Page 7: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Reinforced Arduino

• Sound Shields 1– Attach amplifier– Improve Volume– No improvement in Quality (still 8 bits)

• Sound Shields 2– Attach external memory– Improve volume, storage capacity– Improve quality

Page 8: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

This Workshop Arduino

• Just attach an 8 Ohm speaker– With a capacitor to avoid short cutting a PIN

• Sound library, sound scale: melody• Sound click: some random sounds

• Tone• Sirene

Page 9: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Melody Script

• Arduino script environment• Examples, Melody

Page 10: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Script

MelodyNOTE sequenceNOT duration

PIN 8 for speaker

But speaker has 2 PINS:

Add:Pinmode(9, OUTPUT);digitalWrite(9, LOW);In setup(){ }

Page 11: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Hardware

• Speaker• Capacitor• To digital PIN 8 +• To digital PIN 9 GND

(coded GND PIN)

Page 12: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Experiment with Melody script

• Add Notes• Change note duration• Change speed

• Make different melodies (search internet)– Short– Significant, eg Beethoven 5th theme

• Experiment with fast “texture”, upbeat style

Page 13: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Sound 2

• Use Click: digitalWrite(8, HIGH) and LOW• In between delay(milliseconds) command

• See script in next slide:

Page 14: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Sound scape Code• for (int i= 0; i< 1000; i++) {• clickSound();• }

• clickSound(){• digitalWrite(8, HIGH);• delay(1);• digitalWrite(8, LOW);• delay(1);• }

Page 15: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Problem:

• delay(1) = 1 millisecond, not fast enough• Special fastest command: • __asm__("nop\n\t"); • But this is too fast! Toooooo high notes.• Make this command slower with another for

loop:• for(int i2 = 0 ; i2<beats ;i2++)• __asm__("nop\n\t");

Page 16: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

No you can go high pitch:

• for(int i2 = 0 ; i2<beats ;i2++)• __asm__("nop\n\t");

• Instead of “delay( .. )”

• (double for loops)• Change “beats” inside the loop for obtaining

sirenes

Page 17: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Experiments• Alternate melody with sirenes

• Sequential programming• Block 1: melody1• Block 2: sirene1, say “up”• Block 3: melody2• Block 4: sirene2, say “down”

• Try to make “sense” sound

Page 18: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

If statement

• Forking possibilities• Instead of 4 blocks repeating: choice

• Choice can be: – human input, push button, paper button– Sensor input, digital or analog

• Needed for us: analog input

Page 19: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Analog PINS, 6 of them

• Input range 0-1023

• Normally used for sensors – light (LDR)– Temperature– Pollution

• Capacitive sensor: electrostatic charge

Page 20: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Breadboard

Page 21: Human Sensing Beam 2014. Low resolution image and Sound Image 8 x 8 pixels Sound: 8 notes in an octave (13)  GFU&feature=relmfu.

Smart Connections

• Standardized!