Using Squeak for media computation Graphics and sound low-level manipulations in Squeak (Smalltalk)

Slides:



Advertisements
Similar presentations
3.01C Multimedia Elements and Guidelines 3.01 Explore multimedia systems, elements and presentations.
Advertisements

Processing Lecture. 1 What is processing?
Using Multimedia on the Web Enhancing a Web Site with Sound, Video, and Applets.
Sound in multimedia How many of you like the use of audio in The Universal Machine? What about The Universal Computer? Why or why not? Does your preference.
Digital Color 24-bit Color Indexed Color Image file compression
Python: Modifying Pictures Using Loops. Review JES command area – program area Defining/using functions specifying a sequence of steps for what the function.
TOPIC 5 INTRODUCTION TO PICTURES 1 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B.
CS1315: Introduction to Media Computation Introduction to Programming.
Created by Mark Guzdial, Georgia Institute of Technology; modified by Robert H. Sloan, University of Illinois at Chicago, For Educational Use. CS.
 Multimedia is everything you can hear or see: texts, books, pictures, music, sounds, CDs, videos, DVDs, Records, Films, and more.  Multimedia comes.
1 L45 Multimedia: Applets and Applications. 2 OBJECTIVES  How to get and display images.  To create animations from sequences of images.  To create.
 Pearson Education, Inc. All rights reserved Multimedia: Applets and Applications.
First Bytes - LabVIEW. Today’s Session Introduction to LabVIEW Colors and computers Lab to create a color picker Lab to manipulate an image Visual ProgrammingImage.
How Images are Represented Bitmap images (Dots used to draw the image) Monochrome images 8 bit grey scale images 24 bit colour Colour lookup tables Vector.
CS110: Computers and the Internet Color and Image Representation.
Skill Area 212 Introduction to Multimedia Internet and MultiMedia for SC 2.
1 Project 7: Huffman Code. 2 Extend the most recent version of the Huffman Code program to include decode information in the binary output file and use.
Computer Science [3] Java Programming II - Laboratory Course Lab 7: Multimedia: Applets and Applications Faculty of Engineering & IT Software Engineering.
Media File Formats Jon Ivins, DMU. Text Files n Two types n 1. Plain text (unformatted) u ASCII Character set is most common u 7 bits are used u This.
Introduction to Interactive Media 10: Audio in Interactive Digital Media.
Web Design Vocab 12 The Last one! Applet, HTTPS, RGB Color, Rollover, Server.
Chapter 8: Digital Media1 Digital Media Chapter 8.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
 2005 Pearson Education, Inc. All rights reserved Multimedia: Applets and Applications.
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
CS1315: Introduction to Media Computation Picture encoding and manipulation.
CS1315: Introduction to Media Computation Picture encoding and manipulation.
Images, Hyperlinks, and Sound Module 2: XHTML Basics LESSON 3.
2.02 Develop Computer Animations Review By: Adam Garcia,Christian Brown, Richard Williams, Tyler Borden.
Multimedia Elements: Sound, Animation, and Video.
Module 8 Review Questions 1.VGA stands for A. Video Graphic Association B. Video Gradient Array C. Video Graphic Array D. Video Graphic Arrangement.
CS2984: Introduction to Media Computation Using Loops for Pictures Conditionals Copying images.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 8: Making Sounds by Combining Pieces.
Chapter 2 : Business Information Business Data Communications, 6e.
1 Ethics of Computing MONT 113G, Spring 2012 Session 10 HTML Tables Graphics on the Web.
Jeopardy Heading1Heading2Heading3Heading4 Heading5 Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy.
M404 Multimedia Elements Form 4.
Introduction to Interactive Media 03: The Nature of Digital Media.
Agenda Last class: Memory, Digitizing Numbers Today: Digitizing: Text
CS1315: Introduction to Media Computation Introduction to Programming.
Georgia Institute of Technology Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Sept 2005.
Image Representation. Digital Cameras Scanned Film & Photographs Digitized TV Signals Computer Graphics Radar & Sonar Medical Imaging Devices (X-Ray,
CS1315: Introduction to Media Computation Picture encoding and manipulation.
1 CS 177 Week 5 Recitation Slides Mirroring and copying images, Using for Loop, if statement, and range.
File Format. Graphics file Format GIF (Graphics Interchange Format) JPEG (Joint Photographic Experts Group) PNG (Portable Network Graphics) TIFF (Tag.
File Format. Graphic file Format GIF –cross-platform compatibility –developed by CompuServe as a common format for exchanging bitmapped images between.
Digital Image Processing Lecture4: Fundamentals. Digital Image Representation An image can be defined as a two- dimensional function, f(x,y), where x.
How to embed a video into a power point if you do not have internet access. You will need to download the video to your computer or a flash drive. Drag.
An bitmapped image on the computer is represented by many pixels. A pixel is basically a dot on the computer screen.
Intro-Sound-part1 Introduction to Processing Digital Sounds part 1 Barb Ericson Georgia Institute of Technology Oct 2009.
CSCI-100 Introduction to Computing Hardware Part II.
ITEC 109 Multimedia Lecture Lecture 23. Photo manipulation Review Lists / Arrays.
Multimedia. What is multimedia? Multimedia is everything you can hear or see: texts, books, pictures, music, sounds, CDs, videos, DVDs, Records, Films,
Audio Streaming © Nanda Ganesan, Ph.D.. Audio File Features Audio file is a record of captured sound that can be played back –The WAV File is an example.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
CS1315: Introduction to Media Computation Introduction to Programming.
CS1315: Introduction to Media Computation Transforming pictures by index number.
Representing Sound and Image. Representing images One mean of representing an image it to interpret the image as a collection of dots, each is called.
Information Systems Design and Development Media Types Computing Science.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Red Green Blue (RGB) Colour conversions Y and RGB Link In the images, the lighter the colour intensity (Red, Green, Blue), the more the contribution.
Week 13 - Monday CS 121.
Data Formats.
Integrating Multimedia: Sound, Video and More
Chapter 2: Introduction to Programming
Colors Computers build colors from Red, Green, and Blue; not Red, Blue, and Yellow. RGB = Red Green Blue Creating Colors Red + Blue = Purple No Red, No.
Digital Image Processing
(c) V/2-Com (Verhaart) Multimedia Elements & standards 4/15/2019 (c) V/2-Com (Verhaart)
CS1315: Introduction to Media Computation
Presentation transcript:

Using Squeak for media computation Graphics and sound low-level manipulations in Squeak (Smalltalk)

What is Squeak? Re-implementation and extension of (original) Smalltalk-80, with VM written in Smalltalk Runs on over 30 different platforms, including Linux, Windows, MacOS, Solaris…even Windows CE  Apple license allows commercial apps, but system fixes must be posted Squeak has faster, more stable, cross-platform media than Java  Media: 3-D graphics, MIDI, Flash, MPEG, sound recording  Network: Web, POP/SMTP, zip compression/decompress  Beyond Smalltalk-80: Exceptions, namespaces

Squeak Books

Heart of graphics in Squeak: Form The class Form is what represents pictures in any Smalltalk.  To load it from a file, Form fromFileNamed: ‘myfile.gif’ (or.jpg or.bmp) To display a Form in Smalltalk, you can just send it the message display To display it in a “window” (Morph) in Squeak, use a SketchMorph  (SketchMorph withForm: form) openInWorld To write it out to JPEG file, use form writeJPEGfileNamed: filename

Manipulating pixels in Squeak Forms understand form colorAt: which returns a Color  Colors understand methods like red, green, blue, lighter, darker, duller, brighter  Color will create new colors with the r:g:b: method Forms understand form colorAt: put: aColor

Negative example in Squeak form := Form fromFileNamed: 'C:\Documents and Settings\Mark Guzdial\My Documents\mediasources\barbara.jpg'. 1 to: (form width) do: [:x | 1 to: (form height) do: [:y | color := form colorAt: newcolor := Color r: (1.0-color red) g: (1.0-color green) b: (1.0-color blue). "newcolor := Color r: (color luminance) g: (color luminance) b: (color luminance)." form colorAt: put: newcolor]]. (SketchMorph withForm: form) openInWorld.

Squeak Music Essays on CD

Sound Support in Squeak Class AbstractSound is heart of sound support in Squeak  It knows how to write files sound storeWAVonFileNamed: ‘fred.wav’ sound storeAIFFonFileNamed: ‘fred.aif’ Class SampledSound knows how to read recorded sounds  (SampledSound fromAIFFfileNamed: '1.aif') play  (SampledSound fromWaveFileNamed: 'c:\windows\media\chimes.wav') play

Manipulating Sounds: SoundBuffer A SoundBuffer knows how to manipulate samples for conversion to sounds later  sr := SoundPlayer samplingRate.  anArray := SoundBuffer newMonoSampleCount: (sr * seconds). SoundBuffers are manipulated with at:put: and at: like any other array in Smalltalk. You get the SoundBuffer for a SampledSound using the method samples

Converting SoundBuffers to SampledSounds |base sound| “Generate a SoundBuffer at the right frequency” base := SoundBufferGenerator forFreq: 440 amplitude: 3000 duration: 2. sound := SampledSound samples: base samplingRate: SoundPlayer samplingRate. sound viewSamples. "sound play."

Playing a sound backwards in Squeak source := SampledSound fromWaveFileNamed: 'C:\Documents and Settings\Mark Guzdial\My Documents\mediasources\thisisatest2.wav'. target := source copy. samples := target samples. sourceIndex := source samples size. 1 to: (samples size) do: [:index | samples at: index put: (source samples at: sourceIndex). sourceIndex := sourceIndex - 1.]. target play.