The Magic of Macintosh: Programming Graphics and Sound
From the originals
13 scansMachine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.
These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.
Image 1
THE MAGIC OF MACINTOSH Programming Graphics and Sound William B. Twitty b 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 10
A red book cover with bold black and white title type at top and a grid of colorful graphic illustrations below, including a hand with a diagonal square and labeled sides b and c, a pixel grid with axis numbers 0 to 10, a blue-grey shape, a dotted-pattern panel, and an oval with rectangles.
Reading notes: Small axis labels and the stray letter 'b' at left edge and the small 'c' and 'a' labels in the hand illustration are uncertain and may be diagram fragments rather than copy. Partial text fragments at the left edge are cut off and not transcribed. The 'Programming Graphics and Sound' subtitle is printed in black and the title in white, reading order follows top-to-bottom.
- Printed product names
- Macintosh
- Languages
- English
PDF page 1
THE MAGIC OF MACINTOSH Programming Graphics and Sound William B. Twitty b c a b 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 10
A red book cover with a bold title block at top, a grid of geometric and pixel-style illustrations including a hand with diagram labels, a dotted pattern, a bitmap grid with connecting lines, and abstract blue and gray shapes.
Reading notes: Small diagram labels (b, c, a, and grid axis numbers) are partially legible and their reading order is approximate. Left-edge partial letter fragment near the illustrations is not clearly legible and was omitted.
- Languages
- English
PDF page 2
THE MAGIC OF MACINTOSH
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 THE MAGIC OF MACINTOSH 6)<5 -
Reading notes: Headline taken from the supplied extracted text (THE MAGIC OF MACINTOSH) and not verified against the image. The string '6)<5' is unclear and may be OCR noise or a fragment of artwork, not a price or date. A long row of '1' characters appears in the source text and is likely scanning or extraction noise. 'MACINTOSH' is not confirmed as an advertised product name because the context of the advertisement is not visible. Layout, reading order, and any additional body copy could not be verified from the supplied text.
- Languages
- English
PDF page 3
THE MAGIC OF MACINTOSH
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 THE MAGIC OF MACINTOSH Programming Graphics and Sound William B. Twitty Scott, Foresman and Company Glenview, Illinois London 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Reading notes: Source contains a run of repeated '1' characters above and below the text, which may be a scanning artifact or border
- Languages
- English
PDF page 4
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 For Othermamma Macintosh is a trademark of Mcintosh Laboratory, Inc. and is licensed to Apple Computer, Inc. and is being used with express permission of its owner. MacPaint, MacWrite, MacDraw, and Macintosh Pascal are trademarks of Apple Computer, Inc. Library of Congress Cataloging-in-Publication Data Twitty, William B. The magic of Macintosh. Bibliography: p. 305 Includes index. 1. Macintosh (Computer)-Programming. graphics. 3. Computer sound processing. QA76.8.M3T84 1986 006.6'76 ISBN 0-673-18253-3 2. Computer I. Title. 86-3750 1 2 3 4 5 6-KPF-91 90 89 88 87 86 ISBN 0-673-18253-3 Copyright © 1986 William B. Twitty and Pacific Systems, Inc. All Rights Reserved. Printed in the United States of America. Notice of Liability The information in this book is distributed on an "As Is" basis, without warranty. Neither the author nor Scott, Foresman and Company shall have any liability to customer or any other person or entity with respect to any liability, loss, or damage caused or alleged to be caused directly or indirectly by the programs contained herein. This includes, but is not limited to, interruption of service, loss of data, loss of business or anticipatory profits, or consequential damages from the use of the programs. Scott, Foresman Professional Publishing Group books are available for bulk sales at quantity discounts. For information, please contact Marketing Manager, Professional Books, Professional Publishing Group, Scott, Foresman and Company, 1900 East Lake Avenue, Glenview, IL 60025.
Reading notes: Leading line of repeated '1' characters appears to be a scanning artifact, not text. Reading order of the Library of Congress cataloguing block is scrambled (ISBN and subject heading lines interleaved).
- Printed product names
- Macintosh · MacPaint · MacWrite · MacDraw · Macintosh Pascal
- Printed dates
- 1986 · 86-3750
- Languages
- English
PDF page 5
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 PREFACE The magic of the Macintosh is its graphics and sound. The Macintosh's ease of use and its appeal to nonprogrammers depend on its graphics. Anyone who writes programs for the Macintosh quickly finds that learning how to generate and manipulate images is an absolute must; you can't do anything on the Macintosh until you can understand and use the Quick- Draw graphics package. This book was written to introduce programmers with little or no graphics background to Macintosh graphics and sound. The book has a fair amount of technical material, but there's also a lot of fun with graphics and sound. The early chapters are very basic and deal with graphics fundamen- tals, QuickDraw, making images on the Macintosh, and drawing text in various type fonts. The later chapters address more technical subjects but always with the understanding that the reader may be able to program but has no prior experience with computer graphics. The material is ordered so that a user can start writing programs immediately without having to understand all of the details of QuickDraw coordinates and mathematics. Those kinds of details are covered in later chapters. The emphasis is on explaining by example. I felt it important to provide a concise example for each concept that is explained in the text, so The Magic of Macintosh is filled with programming examples and illustrations. The examples are designed so that the reader can take parts
Reading notes: Heading line for the source is not clearly printed, so headline is null Page-break hyphenation in 'Quick-Draw' and 'fundamen-tals' may be a line-wrap artifact
- Printed product names
- Macintosh · QuickDraw · The Magic of Macintosh
- Languages
- English
PDF page 6
of the programs and transfer them to his or her own applications. They are a set of pretested parts for the software builder. The example programs are written in Macintosh Pascal. To keep them as simple as possible, I did not use any toolbox routines except those directly associated with graphics and sound. Chapter 1 introduces the reader to computer graphics and their implementation on the Macintosh. Chapter 2 explains the fundamentals of drawing in two dimensions and coordinate systems and begins introduc- ing QuickDraw topics. Chapter 3 goes into more detail on drawing shapes and patterns with QuickDraw. Chapter 4 introduces the reader to text fonts and how they are drawn on the Macintosh with tools from the QuickDraw package. Chapter 5 deals with the mouse, the cursor, and more advanced tools in QuickDraw, as well as pictures, polygons, and regions. Chapter 6 leads the reader into the more technical subjects through an understanding of the fundamental concepts behind Quick- Draw, its coordinate systems and data structures. From chapter 7 on, the topics are not strictly limited to the Macintosh and QuickDraw but range over a variety of technical methods used in computer-aided design systems and other graphics programs. Chapter 7 discusses how to draw and store objects. Chapter 8 takes us into the exotic climes of spline curves and fractals. Chapter 9 brings the book to a close with explanations and examples of how to produce complex sounds on the Macintosh. Writing a technical book is a demanding task, but along with the work on this book, there was a lot of fun doing graphics and sound with the magical Macintosh. I hope that you have as much fun with this book as I did. Programmers new to the Macintosh will find the first book in this series, Programming the Macintosh: An Advanced Guide, to be another useful addition to their library. Many people helped to create and produce this book. Among them are the folks at Apple Computer who provided information and technical advice and my editor at Scott, Foresman, Richard Swadley, who had more patience than one could reasonably expect. A special thank-you goes to Jeanine Johnson, who put in many editing hours helping to make sense out of my technical ramblings and fumble-fingered typing.
Reading notes: Source begins mid-sentence; reading order and any preceding heading are unclear.
- Printed product names
- Macintosh Pascal · Programming the Macintosh: An Advanced Guide · QuickDraw
- Languages
- English
PDF page 7
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 CONTENTS CHAPTER 1 UN• EASHING THE MAGICIAN 1 The Magic in Your Macintosh 2 The Macintosh Display 3 Pixel Coordinates 4 Jaggies 7 Halftone Images 8 QuickDraw 9 Programming 9 CHAPTER 2 DRAWING IN TWO DIMENSIONS 11 Dimensions 12 Coordinate Systems 12 Pixels and Memory 13 The Pen 13 Coordinate Transformations 15 Points and Rectangles 20 Clipping and Windows 24 CHAPTER 3 DRAWING SHAPES AND PAnFRNS 27 Coordinates and the Pen 28 The Pen Pattern 29 Drawing Modes 31 QuickDraw Shapes 40 Drawing QuickDraw Shapes 44
Reading notes: Chapter 1 title contains garbled characters ('UN• EASHING'), likely 'UNVEILING' Chapter 3 title reads 'PAnFRNS', likely 'PATTERNS'
- Languages
- English
PDF page 8
CHAPTER 4 DRAWING TEXT 49 Displaying Text with Type Fonts 50 Type Style 51 Type Size 51 Font Files 5 3 Text Character Images 5 3 Kerning 55 QuickDraw and the Font Manager 5 7 QuickDraw Routines 58 Drawing Text 59 Getting Information about the Font 61 A Program to Draw a Font's Character Set 63 CHAPTER 5 MORE TOOLS FOR THE MAGICIAN 69 The Cursor 70 The Mouse 76 Pictures, Polygons, and Regions 79 Creating QuickDraw Pictures 83 QuickDraw Polygons 87 Using Regions 94 CHAPTER 6 QUICKDRAW COORDINATES AND DATA STRUCTURES 101 Coordinates and Data Structures 102 QuickDraw Coordinates 102 Pixels and Memory 106 The Graph Port 108 More on Coordinates 111 Translation and Scaling 116 CHAPTER 7 DRAWING OBJECTS 119 What's an Object? 120 Using Data Structures to Define Objects 121 An Object as a Collection of Shapes 122 Basic Trigonometry 12 8 Rotation 130 Rotation about an Arbitrary Point 134 Scaling an Object 135 A Program with Objects 139 Modifying the Object-Drawing Program 152
Reading notes: Headline not clearly identified; the source is a table of contents rather than an advertisement. Some character spacing in chapter titles may reflect extraction artifacts (e.g., 'Font Files 5 3').
- Languages
- English
PDF page 9
CHAPTER 8 SPLINES AND FRACTALS 179 Drawing Smooth Curves 180 Spline Curves 184 The Spline Program 190 Drawing Jagged Curves 191 Drawing Fractals 193 Simulating Nature 200 CHAPTER 9 SOUND MAGIC 227 Sound Basics 228 Making Music with the Macintosh 230 SysBeep and Note 232 Controlling the Volume 233 The Sound Synthesizers 234 Generating Square-Wave Tones 237 Sound from Free-Form Waves 239 Using the Four-Voice Synthesizer 245 APPENDIXES 265 A QuickDraw Data Structures 267 B QuickDraw Routines 271 C Mouse Routines 293 D Macintosh Pascal Window Routines 295 E Sound Routines and Data Structures 297 GLOSSARY 301 BIBLIOGRAPHY 305 INDEX 307
Reading notes: Source text is a table of contents with no advertised products, prices, or dates; headline is not identifiable as a primary heading.
- Languages
- English
PDF page 10
The Magic in Your Macintosh
CHAPTER 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 The Magic in Your Macintosh The Macintosh Display Pixel Coordinates Jaggies Halftone Images QuickDraw Programming lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll 1
Reading notes: Repeated '1' and 'l' characters appear as decorative rules and page number; uncertain whether '1' is chapter number or page number
- Printed product names
- Macintosh
- Languages
- English
PDF page 11
UNLEASHING THE MAGICIAN
2 UNLEASHING THE MAGICIAN THE MAGIC IN YOUR 11111111111111111111111111111111 MACINTOSH A magician is someone who performs supernatural and astonishing feats through the mastery of secret and mysterious forces. And what could be more magical than a tan-colored box that draws pictures and makes music by its own hand? Your Macintosh computer is like a magician, accom- plishing tasks that no small computer could before. However, the real magic within the Macintosh lies in the programs that produce the pictures and sound. Writing programs for sound and graphics may seem an arcane art calling for secret knowledge, but taken step by step, it's really very simple. When you learn the basics of computer graphics with examples pro- grammed for the Macintosh, you are on your way to unleashing the magician in your Macintosh. The Macintosh produces pictures of striking quality for an inexpen- sive computer. The basis of this high quality is the high-resolution display, which produces finely detailed images. The inexpensive high-resolution graphics open up many new possibilities for graphics on personal computers. The high-resolution display provides the fine artist with an entirely new medium in which to work and a new set of tools as well. Every medium has its own characteristics, and artists have been quick to capi- talize on the Macintosh's. Commercial artists were not caught napping either. Some of the first third-party products for the Macintosh were disks containing pictures that any nonartist could use to add spice to proposals, newsletters, circulars, or other types of documents produced on the Macintosh. Business people use the graphics capabilities of the Macintosh to prepare for presentations and illustrate financial data. Engineers now have a tool for quickly producing graphs and charts based on engineering calculations. There are a number of low-cost computer-aided design programs on the market that will do everything from lay out printed circuit boards to help you design a garden. Of all the new application programs for personal computers, the most exciting are the ones designed specially for the Macintosh. They relate pictures to information in new and inno- vative ways. Some are so new in concept that old labels no longer apply. Commercial packages provide graphics-based tools for doing a job. In this book we are more interested in the fun of graphics and sound on the Macintosh. We don't have any specific goals to produce a useful program. We're in it for the fun. Along the way we will learn a lot about graphics and
Reading notes: Chapter number '2' and running header text may be page furniture rather than headline
- Printed product names
- Macintosh
- Languages
- English