100% found this document useful (13 votes)
70 views

Full Download Multi Tier Application Programming with PHP 1st Edition David Wall PDF DOCX

Application

Uploaded by

rudgetrialby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (13 votes)
70 views

Full Download Multi Tier Application Programming with PHP 1st Edition David Wall PDF DOCX

Application

Uploaded by

rudgetrialby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Download the full version of the ebook at ebookname.

com

Multi Tier Application Programming with PHP 1st


Edition David Wall

https://ebookname.com/product/multi-tier-application-
programming-with-php-1st-edition-david-wall/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Web Programming for Business PHP Object Oriented


Programming with Oracle 1st Edition David Paper

https://ebookname.com/product/web-programming-for-business-php-object-
oriented-programming-with-oracle-1st-edition-david-paper/

ebookname.com

CodeIgniter for Rapid PHP Application Development Improve


your PHP coding productivity with the free compact open
source MVC CodeIgniter framework 1st Edition David Upton
https://ebookname.com/product/codeigniter-for-rapid-php-application-
development-improve-your-php-coding-productivity-with-the-free-
compact-open-source-mvc-codeigniter-framework-1st-edition-david-upton/
ebookname.com

Programming PHP 2nd Edition Covers PHP 5 Rasmus Lerdorf

https://ebookname.com/product/programming-php-2nd-edition-covers-
php-5-rasmus-lerdorf/

ebookname.com

Air Pollution and Turbulence Modeling and Applications 1st


Edition Davidson Moreira

https://ebookname.com/product/air-pollution-and-turbulence-modeling-
and-applications-1st-edition-davidson-moreira/

ebookname.com
Improve Your Chess Calculation 1st Edition R.B. Ramesh
[Ramachandran Ramesh]

https://ebookname.com/product/improve-your-chess-calculation-1st-
edition-r-b-ramesh-ramachandran-ramesh/

ebookname.com

World Class Applications of Six Sigma Real World Examples


of Success 1st Edition Jiju Antony

https://ebookname.com/product/world-class-applications-of-six-sigma-
real-world-examples-of-success-1st-edition-jiju-antony/

ebookname.com

Engineering Innovative Products A Practical Experience 1st


Edition Roger Woods

https://ebookname.com/product/engineering-innovative-products-a-
practical-experience-1st-edition-roger-woods/

ebookname.com

O Código Civil Brasileiro em Inglês The Brazilian Civil


Code in English 1ª Edition Leslie Rose

https://ebookname.com/product/o-codigo-civil-brasileiro-em-ingles-the-
brazilian-civil-code-in-english-1a-edition-leslie-rose/

ebookname.com

The Body Keeps the Score 1st Edition Bessel Van Der Kolk

https://ebookname.com/product/the-body-keeps-the-score-1st-edition-
bessel-van-der-kolk/

ebookname.com
Building Web Apps with WordPress 1st Edition Brian
Messenlehner

https://ebookname.com/product/building-web-apps-with-wordpress-1st-
edition-brian-messenlehner/

ebookname.com
Multi-Tier Application Programming
with PHP
Practical Guide for Architects and Programmers
The Morgan Kaufmaiin Practical Guides Series
Series Editor. Michael J. Donahoo
Multi-Tier Application Programming with PHP:
Practical Guide for Architects and Programmers
David Wall

TCP/IP Sockets in C#; Practical Guide for Programmers


David Makofske, Michael J. Donahoo, and Kenneth L. Calvert

Java Cryptography Extensions: Practical Guide for Programmers


Jason Weiss

JSP: Practical Guide for Java Programmers


Robert J. Brunner

JSTL: Practical Guide for JSP Programmers


Sue Spielman

Java: Practical Guide for Programmers


Zbigniew M. Sikora

The Struts Framework: Practical Guide for Java Programmers


Sue Spielman

Multicast Sockets: Practical Guide for Programmers


David Makofske and Kevin Almeroth

TCP/IP Sockets in Java: Practical Guide for Programmers


Kenneth L. Calvert and Michael J. Donahoo

TCP/IP Sockets in C: Practical Guide for Programmers


Michael J. Donahoo and Kenneth L. Calvert

JDEC: Practical Guide for Java Programmers


Gregory D. Speegle

For further information on these books and for a list of forthcoming titles, please visit our
website at http://www.mkp.com/practical
Multi-Tier Application
Programming with PHP
Practical Guide for Architects
and Programmers

David Wall

_ _i®
AMSTERDAM BOSTON HEIDELBERG LONDON
NEW YORK OXFORD PARIS SAN DIEGO
: < ^ '
T CTT» rwTUTt ^^'^ FRANCISCO SINGAPORE SYDNEY TOKYO
J:ll^ri>Vl£SK Morgan Kaufmann Publishers Is an i m p r i n t of Elsevier M O R G A N K A U F M A N N PUBLISHERS
Senior Editor: Rick Adams
Publishing Services Manager: Andre Cuello
Associate Editor: Karyn Johnson
Project Manager: Kristin Macek
Design, illustration, and composition: Cepha Imaging Private Limited
Cover Design: Yvo Riezebos Design
Cover Image: Cargo containers being stacked at terminal.
© Sandra Baker/The Image Bank
Copyeditor: Graphic World Publishing Services
Proofreader: Graphic World Publishing Services
Printer: The Maple-Vail Book Manufacturing Group

Morgan Kaufmann Publishers is an Imprint of Elsevier.


500 Sansome Street, Suite 400, San Francisco, CA 94111

This book is printed on acid-free paper.

© 2004 by Elsevier, Inc. All rights reserved.

Designations used by companies to distinguish their products are often claimed as trademarks or
registered trademarks. In all instances in which Morgan Kaufmann Publishers is aware of a claim,
the product names appear in initial capital or all capital letters. Readers, however, should contact
the appropriate companies for more complete information regarding trademarks and registration.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means—electronic, mechanical, photocopying, or otherwise—without written
permission of the publishers.

Permissions may be sought directly from Elsevier's Science & Technology Rights
Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail:
[email protected]. You may also complete your request on-line via the Elsevier
homepage (http://elsevier.com) by selecting "Customer Support" and then "Obtaining Permissions.'

Library of Congress Cataloging-in-Publication Data

Application Submitted

ISBN: 0-12-732350-3

For information on all Morgan Kaufmann publications,


visit our website at www.mkp.com

Printed in the United States of America


08 07 06 05 04 5 4 3 2 1
Pour ma chere Catou. Tu es ma lumiere.
This Page Intentionally Left Blank
Contents

Preface xiii

1 Introduction 1
1.1 Defining Multi-Tier Software Design 1
1.2 Advantages of a Multi-Tier System 2
1.2.1 Software Modularity 3
1.2.2 Reliability 4
1.2.3 Division of Responsibility and Ease of Management
1.2.4 Ease of Documentation 4
1.2.5 Security 5
1.2.6 Performance and Scalability 5
1.3 Disadvantages of a Multi-Tier System 6
1.3.1 Execution Speed 6
1.3.2 Network Latency 6
1.3.3 Security 7
1.4 Questions and Exercises 7

Principles of Object Orientation in PHP 9


2.1 Creating Classes 10
2.1.1 Declaring a Class 10
2.1.2 Adding a Constructor 10
2.1.3 Adding Methods and Properties (a.k.a. Functions and
Variables) 11

VII
VIII Contents

2.2 Using a Class 12


2.2.1 Instantiating a Class 12
2.2.2 Accessing Variables in a Class Instance 12
2.2.3 Accessing Methods in a Class Instance 12
2.3 More Advanced Aspects of PHP Object Orientation 13
2.3.1 Getting a Class to Refer to Itself 13
2.3.2 Inheritance 14
2.3.3 Public, Private, and Protected Members 15
2.3.4 Overriding Class Methods 17
2.4 Questions and Exercises 19

HTTP in PHP 21
3.1 Understanding HTTP 22
3.1.1 A Simple Page Request and Response 22
3.1.2 A More Complex GET Request 24
3.1.3 A POST Request 26
3.2 Working with HTTP in PHP 26
3.2.1 Accessing GET Variables 26
3.2.2 Accessing POST Variables 27
3.2.3 Accessing Various HTML Form Elements 29
3.3 Cookies 37
3.3.1 Setting Cookies 38
3.3.2 Retrieving Cookies 39
3.3.3 Deleting Cookies 40
3.4 Sessions 40
3.4.1 Preparing the PHP Server for Session Tracking 41
3.4.2 Establishing a Session 41
3.4.3 Setting a Session Variable 42
3.4.4 Retrieving a Session Variable 42
3.5 Questions and Exercises 43

Simple Object A c c e s s Protocol Under PHP 45


4.1 Understanding SOAP 46
4.1.1 A SOAP Request 47
4.1.2 A SOAP Response 48
4.2 Implementing SOAP in PHP 50
4.2.1 A Simple Application of NuSOAP 50
4.2.2 A More Complex Application of NuSOAP 52
4.3 Questions and Exercises 53
Contents IX

Designing and Implementing a Multi-Tier Application in PHP 55


5.1 Examining the Problem 55
5.1.1 Sketching Out the Layers 56
5.1.2 Communication Between the Layers 57
5.2 The Database Layer 58
5.2.1 Creating the Table 58
5.2.2 Populating the Table 59
5.3 The Accessor Layer 61
5.3.1 Isolating the Database Details 61
5.3.2 Getting City Names from the Database 62
5.3.3 Getting Latitudes and Longitudes from the Database 64
5.4 The Business Logic Layer 66
5.5 The Presentation Layer 68
5.6 Questions and Exercises 72

6 The Persistence Layer 73


6.1 Choosing a Persistent Storage Mechanism 73
6.1.1 Choosing a Database Server 74
6.1.2 Selecting Development Tools 75
6.2 Designing the Database 76
6.2.1 General Database Design Principles 76
6.2.2 Specific Design Requirements 76
6.3 Understanding Table Relationships and Normalization 11
6.3.1 First Normal Form 78
6.3.2 Further Normal Forms 80
6.4 Deciding on a Table Schema 80
6.4.1 Initial Table Specifications 81
6.4.2 Further Table Specifications 83
6.5 Translating the Schema into SQL 83
6.5.1 Creating the ACCT^account Table 85
6.5.2 Creating the ACCT_trans_type Table 85
6.5.3 Creating the ACCT_acct-type Table 86
6.5.4 Creating the ACCT_currency Table 86
6.5.5 Creating the ACCT.payee Table %1
6.5.6 Creating the ACCTJnstitution Table 87
6.5.7 Creating the ACCT_bank_account Table 88
6.5.8 Creating the ACCT_register Table 89
6.6 Populating the Tables 92
6.7 Questions and Exercises 93
Contents

The Accessor Layer 95


7.1 Extracting Data From the Database 95
7.1.1 Using SELECT Queries 96
7.1.2 SELECT Queries for Currawong Accounting 106
7.2 Adding Data to the Database 133
7.2.1 Using INSERT Queries 133
7.2.2 INSERT Queries for Currawong Accounting 135
7.3 Modifying Data in the Database 145
7.3.1 Using UPDATE Queries 146
7.3.2 UPDATE Queries for Currawong Accounting 147
7.4 Deleting Data from the Database 155
7.4.1 Delete Queries in General 155
7.4.2 DELETE Queries in Currawong Accounting 157
7.5 Questions and Exercises 163

Business Logic 165


8.1 Inserting, Updating, and Deleting 165
8.1.1 Inserting a Row 165
8.1.2 Updating a Row 167
8.1.3 Deleting a Row 170
8.2 Reporting 171
8.2.1 Generating an Accounts Summary 171
8.2.2 Graphing the Balance of a Single Account over Time 175
8.2.3 Graphing the Balance of a Single Account over Time, with
a Moving Average 182
8.2.4 Graphing the Balance of Multiple Accounts over Time 187
8.3 Questions and Exercises 192

The Presentation Layer 193


9.1 Frameworks and Resources 193
9.1.1 An HTML Display Framework 194
9.1.2 Generating List Boxes 197
9.2 Viewing and Adding—Everything but Transactions 202
9.2.1 Viewing and Adding Accounting Categories 203
9.2.2 Viewing and Adding Bank Accounts 208
9.2.3 Viewing and Adding Bank Account Types 209
9.2.4 Viewing and Adding Currencies 210
9.2.5 Viewing and Adding Institutions 211
9.2.6 Viewing and Adding Payees 213
9.2.7 Viewing and Adding Transaction Types 214
Contents XI

9.3 Editing—Everything but Transactions 215


9.3.1 Editing Accounting Categories 217
9.3.2 Editing Bank Accounts 219
9.3.3 Editing Bank Account Types 221
9.3.4 Editing Currencies 222
9.3.5 Editing Institutions 223
9.3.6 Editing Payees 225
9.3.7 Editing Transaction Types 226
9.4 Transactions 228
9.4.1 Special HTML Framework 228
9.4.2 Specifying which Transactions to Display 229
9.4.3 Viewing Transactions 231
9.4.4 Editing Transactions 238
9.4.5 Deleting Transactions 244
9.4.6 Adding Transactions 250
9.5 Questions and Exercises 253

10 The Elsewhere Layer 255


10.1 Means of Grabbing Online Information 255
10.1.1 Screen Scrapes 256
10.1.2 Web Services 257
10.2 Choosing a Web Service 257
10.3 Making Use of the Web Service 258
10.3.1 Describing the Web Service 258
10.3.2 Referring to the Web Service 261
10.4 Questions and Exercises 264

Afterword 267
Index 269
This Page Intentionally Left Blank
Preface

I his book aspires to replace trust in commercial products with reliance on open-source
software and your own ingenuity.
We've all been in a situation in which a customer wants to solve some complicated
information-services problem without spending much money. Maybe the project is a one-
off demonstration that's unlikely to lead to much of a sale. Maybe it's a proof-of-concept
project that may never get real funding. Maybe, and this isn't uncommon at all, the cus-
tomer is just cheap and wants a real, highly capable, production solution for the absolute
least amount of money possible. The application typically is feature rich, with a substantial
data model backing it up. It may be something like a travel reservation system, a catalog,
a data warehouse full of scientific of business data, or, as is modeled in several chapters
of this book, an accounting system.
These are the sorts of applications for which Microsoft touts the .NET Framework
and Sun Microsystems sells Enterprise Java. Those are extraordinarily capable develop-
ment environments. They are also more or less proprietary, and dependent on expensive
software licenses.
The environment that seems to be emerging in many companies is one in which the
first budget line item to fall is the one for software licenses. That means open-source
software fits the budget, and often its capabilities stack up quite favorably against its
commercially licensed competitors. But if the motto of the open-source community is
"do it yourself," there's bound to be some professional services time required to make the
software do what's needed.
Multi-Tier Application Programming with PHP: Practical Guide for Architects and
Programmers is meant for people who find themselves—or would like to find themselves—
in the position of having to provide those professional services.

XIII
XIV Preface

Goals and Audience of this Booi<


The aim of this book is to show you how to solve compUcated information-systems prob-
lems with little more than software you can download freely from the Web, namely PHP and
an open-source database server, such as MySQL or PostgreSQL. To solve such complicated
problems, you'll want to use multi-tier application architecture, specifically a strategy
called the model-view-controller (MVC) pattern.

Goals
Before you start designing applications, you'll need to understand what multi-tier design
is all about, and how to implement it with PHP and related technologies. You'll also need
some design guidance as to when it's appropriate to try to structure your applications
as multi-tier entities under PHP, when it's better to go for a full-blown solution under an
application server (as with Enterprise Java), and when a more traditional PHP solution
is best.
The essence of multi-tier (usually, it boils down to three-tier) application design is
the separation of the logical functions of an application into several layers:
The accessor layer (the model) manages interaction with a database management
system (DBMS). Its job is to query the database as efficiently as possible, making opti-
mum use of the available database connections and sharing database access across
multiple lower-level activities where possible. It exposes methods that represent
abstractions of what's in the database.
The business-logic layer (the controller) decides what sort of data to extract from
the database under various conditions. Further, it can process that data to yield
meaningful information. For example, the business-logic layer might be set up to
request revenue and expenditure data from the persistence layer, then process those
pieces of information and expose a method that returns a profit figure.
The presentation layer (the view) is concerned with providing an interface to the user.
It presents a user interface (in hypertext markup language [HTML], typically) that the
user can manipulate, and it formats the results of the business-logic layer's work in
an attractive way.
The advantage of designing applications this way is ease of maintenance and modification,
as well as better performance under load.
PHP has met tremendous success in the space between static Web pages (simple, not
very flexible, and hard to maintain) and three- or four-tier enterprise applications under
an application server like WebSphere or WebLogic (which are hard to learn, complicated,
expensive, and not worth the trouble for any but the largest projects). For the bulk of
network applications—which require database connectivity, interaction with a user via
forms, an ability to output HTML, and some mechanism for maintaining state in the inher-
ently stateless environment of hypertext transport protocol (HTTP)-—PHP and MySQL do
Preface XV

everything required. Solutions built around these technologies are fun to design, easy to
create, low in cost, and equal or greater in performance to similar applications written
with the Microsoft .NET Framework or Enterprise Java.
The subject of this book is taking PHP a step further by separating the presenta-
tion layer from the business-logic layer. The book aims to teach programmers how to do
this, and why such a layered design is superior to more traditional approaches in many
situations.
Readers should come away from Multi-Tier Application Programming with PHP:
Practical Guide for Architects and Programmers different in several ways:
They should be familiar with the principles of multi-tier software architecture.
They should be more skilled with the PHP language, and particularly with those
elements that are part of PEAR DB or new in PHP 5.
They should tend to think about PHP in association with large software projects for
which they might have discounted it before.
This book does not aspire to teach you PHP. Lots of excellent tutorial and reference books
exist, and there's a great deal of PHP educational material online. This book shows how PHP
can be used in a new way—as a tool for creating multi-tier frameworks into which useful
applications can be built. You can enjoy the benefits of multi-tier software design under
PHP with a much smaller investment in learning than would be required by other languages.
This book deals with programming—actual code samples and commentaries on
them—primarily in the areas that are unique to multi-tier design. A chapter deals with
object orientation in PHP as it applies to the architecture, whereas other chapters have to
do with HTTP and simple object access protocol (SOAP), the two communication protocols
most useful in tying together multiple layers. There's also coverage of database design
and query construction, and some information about tricks you can use in generating user
interfaces.

Audience
The intended audience of Multi-Tier Application Programming with PHP: Practical Guide for
Architects and Programmers includes people with an interest in PHP beyond its applica-
tions as a quick and cheap way to solve server-side programming problems in the course
of building Web sites. They're not so much interested in PHP as an alternative to ASP and
Perl, but in PHP as a language that can deliver excellent results when placed in direct
competition with Microsoft .NET and Enterprise Java.
The people who will appreciate this book most are those who have a working knowl-
edge of HTML and JavaScript, and familiarity with at least one full-fledged programming
language, such as C, Java, or Visual Basic. They probably also will know how to program
in PHP, ASP, or Perl for the purpose of doing server-side scripting work, including how to
connect to and use database servers (possibly under the relatively new PEAR DB system).
For that reason, they'll know the essentials of structured query language (SQL) as well.
XVI Preface

The people who read and learn from this book will be able do something (implement
a multi-tier architecture) for nearly nothing (PHP is free, many of its associated database
servers are free or nearly so, and PHP is a lot easier to learn than Microsoft .NET and
Enterprise Java).

The Road Ahead


Here's a quick introduction to the structure of this book, chapter by chapter.
1. Introduction. This chapter explains the theory of multi-tier design and why you'd
want to use one. It also gets into the question of when you'd want to consider PHP
and an open-source database server for implementing a multi-tier design, and when
a commercial solution might prove superior.
2. Principles of Object Orientation in PHP. This chapter shows you how PHP, particu-
larly its newer versions, implement the principles of object orientation.
3. HTTP in PHP. Key to any online application is HTTP. PHP has a particular way of
interacting with HTTP, and this chapter explains it to you.
4. SOAP under PHP. As you'll see in Chapter 4, SOAP is a very flexible way of commu-
nicating between tiers, even if there's a firewall or other security mechanism in the
way (that's because SOAP rides on top of HTTP or simple mail transport protocol
[SMTP], two protocols to which that firewalls usually allow free passage). Techniques
for implementing SOAP with the NuSOAP libraries are explained in this chapter.
5. Designing and Implementing a Multi-Tier Application in PHP: A Succinct Exam-
ple. This chapter deals with design principles, including the question of how to
establish communications among layers if everything is separated by a network.
You'll find a complete multi-tier application (a simple Great Circle navigation cal-
culator) described here, enabling you to work through a full project with relative
speed.
6. The Persistence Layer. In Chapter 6, we begin the elaborate example that concerns
us throughout much of this book: Currawong Accounting. Named for an Australian
bird, Currawong Accounting is a multicurrency bookkeeping application. In this
chapter, we design a data model (a database schema) for Currawong and implement
it in MySQL, using the dependency features of InnoDB tables.
7. The Accessor Layer. With our database in place, we set about writing the PHP pro-
grams that execute SQL queries. This chapter is very much concerned with the
PEAR DB way of interfacing with a database, as well as with establishing SOAP servers
with the help of the NuSOAP library.
8. Business Logic. The logic layer is where calculations take place, and in Currawong
Accounting it's where we do our report creation. Further, the logic layer in Curra-
wong is interesting because it receives HTTP POST input and makes request of the
accessor layer as a SOAP client.
Preface XVII

9. The Presentation Layer. Concerned with providing an interface (a human interface in


the form of Web pages, in the Currawong case), the presentation layer involves HTML
markup. It also involves HTML forms, some direct calls the accessor layer for the
purpose of showing database table contents, and interactions with the logic layer.
10. The Elsewhere Layer. Because Currawong Accounting is meant to run on a Web
server, it will have access to all sorts of resources on the public Internet. Among
these: Web services that give information on currency exchange rates. The else-
where layer of Currawong Accounting queries one of these services in order to
discover the relative values of the currencies the application tracks.

Setting Up Your Development Environment


In learning any programming language or design strategy, it's vitally important that you
actually do the work—go hands on with the code and try to solve some problems. The main
point of doing this is not so much the solving of the problems as the making of mistakes,
because it is through mistakes that we learn. Software work, in which little things like
the sequence of arguments or the placement of a brace can have far-reaching effects, is
particularly well suited to mistake making.
The key thing is to be able to figure out your mistakes quickly, learn from them, and
move on to the next thing. Battering away at one problem, for hours because you're SURE
you've done everything right and it JUST WON'T WORK, ranks among life's most frustrating
experiences. It's particularly unamusing when the error turns out to be trivial.
Similarly not fun is troubleshooting your infrastructure. The programs in this book
make use of the very reliable and field-proven PHP interpreter and the MySQL database
engine, but those pieces of software, in and of themselves, are not why you should be
reading this book. It's what you can do with them that we're interested in here. So get
them installed right and don't worry about them.
The point: Get your working environment built right and get on with the learning.
Then, you'll be ready to get on with the production coding, as well. Your development
environment is your factory production floor. The rest of this section offers some tips on
doing so.

On the Arrangement of Machines


The whole point of multi-tier software architecture is the possibility of separating software
components so they run on different machines, thus improving reliability, scalability, and,
under some conditions, performance (you'll read all about the advantages and disadvan-
tages of multi-tier design in Chapter 1). In a development environment, however, it's not
as critical that you distribute pieces of your applications across multiple machines. That's
because the advantages of distributing the tiers become most evident when the application
is experiencing heavy load—in other words, in production.
On the other hand, it's nice to be able to carry your entire development project
around on a single notebook computer. One possible solution to the problem of network
XVIII Preface

simulation involves virtual machines. VMWare (http://www.vmware.com) makes a number


of products that allow you to run multiple virtual machines within your "real" operating
system (VMWare Workstation is the simplest of the lot, and fits the purposes of this book).
The software is pretty clever; it walls off a section of your machine's memory and hard
disk and allows you to treat those protected resources as a separate machine. You have to
install an operating system (which may or may not be the same as your "host" operating
system) on the protected area and everything. VMWare manages the work of sharing the
CPU among your host system and your virtual machines (you need a lot of RAM if you want
to have more than one virtual machine running at once, though). The machines share the
network card, too, so both can get separate DHCP addresses from the same router and
communicate with each other over the local area network (LAN).

Server Software
Programs written in PHP will run on any machine for which there is a PHP interpreter.
At the moment, compiled interpreters exist for about 10 operating systems, including IBM
OS/2 and AmigaOS, and you can port the freely downloadable source code to a new one if
you want. Regardless, the chief PHP environments are Microsoft Windows and the various
kinds of Linux, and those are the ones we focus on here.

Linux
You'll want to configure a Linux system as a LAMP server (Linux, Apache, MySQL, PHP) for
the purposes of this book. In other words, you'll want to install these pieces of software:
Linux (http://www.linux.org). Choose your favorite distribution. Anything based on
the 2.4.x kernel will certainly work, as will significantly older versions.
Apache (http://www.apache.org). Install the Apache HTTP server on top of Linux. The
easiest way to do this is by installing the package that fits your Linux distribution
(an RPM file for Red Hat Linux, for example), but you can compile the source if you
prefer.
MySQL (http://www.mysql.com). Next comes the MySQL database server. Again, use
your distribution's package-management solution if you can, or build it yourself.
PHP (http://www.php.net). Install PHP last. You can compile the source, or install the
package that fits your distribution.

Microsoft Windows
Under Microsoft Windows, you have a choice of two major Web servers:
Microsoft Internet Information Services (IIS). Windows' native HTTP server, IIS can be
installed from the Windows distribution CD-ROM.
Preface XIX

Apache (http://www.apache.org). Download and install the Microsoft Windows binary


files.
Once you have an HTTP server in place, you can install the rest of the critical server
software:
MySQL (http://www.mysql.com). You'll want to download the Windows binary from
the MySQL site. It installs automatically, with practically no decisions for you
to make.
PHP (http://www.php.net). As with Linux, install the PHP binary last. If you chose the
IIS Web server, configuration is automatic. If you opted for Apache under Windows,
you have to do some manual configuration that's documented in a file that comes
with the PHP binary kit.

The Client Side


My client computer is a notebook running Microsoft Windows 2000 (it happens to the be
the Server variety of Windows 2000, but that's not because of anything related to PHP).
I sincerely would like to use Linux outside of the server environment (read about the new
file system rumored to be part of Longhorn—that's project name for the next version of
Microsoft Windows—and you'll see why), but I have not yet made the leap with my working
notebook.
On the client side, you'll be doing two things most of the time: writing code and
testing it.
Writing code in PHP, HTML, JavaScript, and SQL—the four languages you'll use in
following this book—is best handled by your text editor of choice, which for me is a prod-
uct called NoteTab Pro from a company called Fookes Software. Read all about it, and
download a trial version, from http://www.notetab.com. I write all my code and prose—
every last word of this book, as a matter of fact—in NoteTab Pro. It has a tabbed interface
with which you can have many documents open at once, its search-and-replace function
supports regular expressions, and its macro language is intelligent. Writing in plain text
removes formatting surprises from my life, and formatting surprises are surprises 1 don't
need. About the only thing I really wish NoteTab had is syntax highlighting for various
programming languages, mainly PHP. Editor wars being what they are, though, I will leave
my discussion of the subject at that.
To test your PHP programs, you'll need a Web browser. It's true that not all PHP
programs are meant to be rendered in browser-interpretable markup languages, and
in fact the accessor- and logic-layer programs described in this book do not generate
HTML output. To test these, though, we'll use a special HTML document that makes the
required calls and displays debugging output, all within a browser window (you'll see
how to create that tester later). In writing this book, 1 did my development and testing
with Microsoft Internet Explorer 6.0. You can get your own copy of that browser from
http://www.microsoft.com/windows/ie. The HTML and JavaScript in these pages aren't
too fancy, though, and should work well in any semimodern Web browser.
XX Preface

You'll want to do testing of your SQL statements independent of PHP and HTML. That
means you'll need a client for whatever database server you choose to use. If you're going to
use MySQL—and that's what appears in this book's examples—you'll very likely be happy
with MySQL Control Center. It's available at http://www.mysql.com/products/mysqlcc.
Its capabilities are covered more fully in Chapters 6 and 7.
Other software tools 1 keep in my PHP programming toolkit include:
Effetech HTTP Sniffer (http://www.effetech.com). A monitoring program that keeps
track of HTTP calls among network nodes. When all else fails, you can use this to make
absolutely sure that your Web services are returning the results you are expecting
them to return.
Search and Replace Funduc Software (http://www.funduc.com/srshareware.htm).
A simple, elegant program that will look through many files to find (and, if you like,
replace) a specified string or regular expression. It's handy for work like changing
a machine name or IP address globally.
CASE Studio (http://www.casestudio.com). A database entity modeler (schema-
generation tool), CASE studio will connect to a database server (any of several kinds,
including all the popular open-source ones) and figure out the table relationships in
a specified existing database.
1 have not outfitted my development environment with any of the Zend Studio software
(http://www.zend.com) yet, mainly because 1 haven't felt like giving up the money (the
version of Zend Studio with the handiest features costs $195, U.S. dollars). I've worked
a bit with their time-limited demo version, though, and 1 think it's great. The ability to
step through programs as they execute is extraordinarily useful, and the environment's
variable-monitoring capability eliminates the need to insert thousands of echo statements
during debugging work. Code completion and the on-screen function reference speed
development, too. I'll probably go to Zend Studio before long.

Shortcut: Setting Up the Example Applications


Setting up the example applications is easy. Essentially, once you have the proper server
infrastructure set up, you can just copy the application directories into the server's Web
root and begin using them right away. Here's a step-by-step procedure, assuming you have
nothing but a Linux or Microsoft Windows server to begin. This section is designed to help
you get the example applications up and running quickly; there is some overlap with the
more deliberate steps described in the preceding section.
1. Install and test the Web server of your choice. Apache Web Server (http://www.
apache.org) is the best option for Linux, whereas both Apache and Microsoft Inter-
net Information Services are good alternatives for Windows. Use Apache 1.3.x or
2.0.x—either branch of the Apache product line is acceptable.
Preface XXI

2. Install and test MySQL (http://www.mysql.com) for your machine. It's important that
you use MySQL 4.0.Ix, or a newer version, because it's only in these that the InnoDB
table type (used to provide enforced relationships among tables) is available. If you
want to use a database other than MySQL, you'll have to edit the code in the accessor
layer—a small but important task—to modify the way in which the programs connect
to the database.
3. Install and test PHP (http://www.php.net) for your machine, making sure that it inter-
prets a simple "Hello, World" script as expected. Use PHP version 4.3.x or newer. PHP
5.x is acceptable.
4. Locate the Web root directory on your machine. On an Apache server, it's usually
called htdocs; on an IIS machine, it's usually called wwwroot.
5. Into that folder, copy the entire contents (including subdirectories) of the acct and
greatCircle directories that you downloaded from the book's support site.
6. Copy the contents of the Required Libraries folder—graph, nusoap-0.6, and PEARDB—
into a directory that's specified in the include_path line of your server's php.ini file.
Usually, one of these is /php/includes.
7. Before the applications will work properly, you'll have to run their database-
preparation scripts.
For the Great Circle navigation program, run cities.sql and citiesPopulator.sql,
in that order.
For Currawong Accounting, run /DBSetup/currawongTables.sql and /DBSetup/
populator.sql, in that order.
You should then be able to run the Great Circle program by navigating to this URL:
http://<servername>/greatCircIe/calcGreatCircle.php. You should be able to run Curra-
wong Accounting by opening this URL: http://<servername>/acct/app.html.

Other Resources
Most of the nonsoftware resources you'll use in your PHP development work have to do
with information. PHP isn't quite as vast as, say, Java, but it's not trivial, and you will
almost certainly want to refer to a reference often. References take the form of Web sites,
books, discussion groups, and—heaven forfend!—human beings.

Books
Books most definitely have a place on the desks of the software architect and programmer.
Very often, it's easier to go to a book for an answer than to a reference site, even for quick-
reference questions. Books really come in handy when the question is more complicated
XXII Preface

than, "What are the keys in the associative array returned by the localtimeO function?"
Very often, authors have solved problems like yours and have published their strategies.
The books that I referred to most often during this project were:
Programming PHP by Rasmus Lerdorf and Kevin Tatroe (Sebastopol, CA, O'Reilly,
2002). The standard text for getting things done in PHP 4.1, it's the one I turn to
when I've been working with some other language and need information about how
the standard problems are solved in PHP.
MySQL Cookbook by Paul DuBois (Sebastopol, CA, O'Reilly, 2003). More than a ref-
erence for MySQL, this book shows you how to solve problems—it's extraordinarily
practical.
Web Database Applications with PHP & MySQL by Hugh Williams and David Lane
(Sebastopol, CA, O'Reilly, 2002). A fair collection of PHP solutions to elaborate
problems.
JavaScript Bible by Danny Goodman (IDG Books, Boston, 1998). A combination
tutorial/reference to JavaScript (and the tricky parts of HTML, as well), this book
has the right combination of solutions to problems and straight object-reference
material. Full disclosure: I did some of the technical editing work on this book.
Linux: Rute User's Tutorial and Exposition by Paul Sheer (Prentice Hall PTR, 2002).
An excellent guide to the Linux operating system, well suited to someone who wants
to configure a server to run reliably in the background.
Database Design for Mere Mortals by Michael Hernandez (Addison-Wesley, 2003).
Database design is a really specialized field, but Hernandez does a good job of teach-
ing it. Because getting your database design right is the greater part of getting your
multi-tier application right, it pays to learn design well.

Web Sites
The Internet makes heaps of information available easily and quickly, and usually free of
charge in the case of PHP and its related technologies. Here are some of the sites you'll
find handy as you do development work:
PHP.net (http://www.php.net). The authoritative PHP site contains the official
documentation, and lots of user comments that will usually help you solve your
own problems.
MySQL.com (http://www.mysql.com). The official MySQL site includes complete doc-
umentation of the MySQL variant of the SQL language, as well as links to many MySQL
utilities.
Sourceforge (http://www.sourceforge.net). Have a look here for software projects in
progress, PHP-related or otherwise. Because source code is always available (and
licensing usually liberal), you can often adapt resources here to fit your needs.
Preface XXIII

PHPBuilder (http://www.phpbuilder.net). Another code library site, this one PHP


specific, PHPBuilder often will show you how someone else has already solved your
problem, or one similar.
Safari (http://safari.oreilly.com). This commercial site (which offers a free two-week
demo) enables you to access the full text of hundreds of technical books from several
big publishers. It's a great place to look for recipes, code snippets, and quick answers,
but it is designed to make reading or printing long passages inconvenient (that's how
they sell paper books).

Discussion Groups
Discussion groups, facilitated by the Internet, are a great way to get answers to
development-related questions. It can take some time to phrase your question in a useful
way, and you'll run into smartypants replies more often that would be ideal, but generally
these groups are great resources:
comp.lang.php
php.general
php.db
Various mailing lists (http://www.php.net/mailing-lists.php)

Human Beings
There's a significant PHP community developing, and lots of people—training companies,
consultancies, product vendors, and others—have an interest in encouraging its growth.
As a result, you'll find it fairly easy to find a PHP event to attend. The PHP home page
(http://www.php.net) includes a calendar of events, which in turn links to the pages
of local PHP users groups that host activities. Most major cities have at least one PHP
get-together at a local bar or restaurant every month.
Good luck implementing multi-tier architectures under PHP. Please share your expe-
riences with me, as well as your comments on this book and your ideas for future
editions. Visit my Web site at http://www.davidwall.com, and reach me by electronic mail
at [email protected].

Acknowledgments
A book, particularly a technical one, is a collaborative effort. Not only does an author have
to consult with other people in his effort to fill the gaps in his knowledge, he must build
atop the tangible prior efforts of others. This is particularly true when the author is work-
ing with open-source software, which derives from a community. I have benefited from
the assistance, direct and indirect, of dozens of people in the course of writing this book.
XXIV Preface

Thanks to Karyn Johnson and the rest of the editorial team at Morgan Kaufmann.
I would also like to thank the project manager, Kristin Macek, the design manager,
Gate Barr, and the production editor, Dan Fitzgerald. They all work hard to deliver quality
books.
Thanks to James Connor, Matt Wade, Guillermo Francia, and Peter Gale, who reviewed
the code and text and contributed a great deal to them. Their comments were invaluable.
Thanks to Herman Veluwenkamp, whose spectacular Graph class features promi-
nently in Chapter 8.
Kudos to the PHP community, which delivers better software and far better support
than most commercial enterprises.
Thanks to Bruce and Connie Wilkinson, Adam and Nikki Bergman, Philippe and Lydie
Vacher, Greg and Wen Smith, Bryan and Suzanne Pfaffenberger, Derek and Gwen Tom,
Jacqueline Vacher, Gary Chin, Geoff May, Diana Yap, Ken Lau, Nicole Pritchard, Daniel
Sjuc, Jo Wong, Paul Comrie-Thomson, Alessandro Lima, and Jairson Vitorino. They are
friends and colleagues 1 am lucky to know.
Thanks to my family as always.

David Wall
Pahs
January 2004
Random documents with unrelated
content Scribd suggests to you:
H. K. M.
FOOTNOTES:
[93] Oskar Bie: ‘A History of the Pianoforte and Pianoforte Players,’ Chap. VIII.
[94] ‘The Pianoforte and Its Music,’ Chap. X.
[95] ‘The Pianoforte and Pianoforte Players,’ Chap. VII.
[96] B. Pesth, 1814; d. Paris, 1888.
[97] Niccolò Paganini, the greatest of all violin virtuosi, was born in 1782 in
Genoa, and died, 1840, in Nizza.
CHAPTER IX
ORCHESTRAL LITERATURE AND ORCHESTRAL
DEVELOPMENT

The perfection of instruments; emotionalism of the


romantic period; enlargement of orchestral resources—
The symphony in the romantic period; Schubert,
Mendelssohn, Schumann; Spohr and Raff—The concert
overture—The rise of program music; the symphonic leit-
motif; Berlioz’s Fantastique; other Berlioz symphonies;
Liszt’s dramatic symphonies—The symphonic poem; Tasso;
Liszt’s other symphonic poems—The legitimacy of program
music.

I
Most typical of the romantic period—more typical even than its art of
song—was its orchestral music. Here all that was peculiar to it—
individuality, freedom of form, largeness of conception,
sensuousness of effect—could find fullest development. The
orchestra in its eighteenth-century perfection was a small, compact,
well-ordered body of instruments, in which every emphasis was laid
on regularity and balance. The orchestra of Liszt’s or Berlioz’s
dramatic symphonies was a bewildering collection of individual
voices and romantic tone qualities. It would hardly be an
exaggeration to say that, whereas a Haydn symphony was a chaste
design in lines, a Liszt symphony was a gorgeous tapestry of color.
Between the two every instrument had been developed to the
utmost of tonal eloquence which composers could devise for it. The
number of kinds of instruments had been doubled or trebled, thanks
partly to Beethoven, and the size of the orchestra in common use
had been increased at least once over. The technique of orchestral
instruments had increased astonishingly; Schubert’s C major
symphony, which was declared unplayable by the orchestra of the
Vienna Musikverein, one of the best of the age, is a mere toy
compared with Liszt’s or Berlioz’s larger works. Such instruments as
the horns and trumpets were greatly improved during the second
and third decades of the century, so that they could take a place as
independent melodic voices, which had been almost denied them in
Beethoven’s time. As an instrument of specific emotional expression
the orchestra rose from almost nil to its present position, unrivalled
save by the human voice.
It is doubtless true to say that this enlargement resulted from the
technical improvements in orchestral instruments and from the
increase of instrumental virtuosity, but the converse is much more
true. The case is here not so much as with the piano, that an
improved instrument tempted a great composer to write for it, but
rather that great composers needed more perfect means of
expression and therefore stimulated the technicians to greater
efforts. For, as we have seen, the musical spirits of the romantic
period insisted upon breaking through conventional limitations and
expressing what had never before been expressed. They wanted
overpowering grandeur of sound, impressive richness of tone, great
freedom of form, and constant variety of color. They wanted
especially those means which could make possible their dreams of
pictorial and descriptive music. Flutes and oboes in pairs and two
horns and two trumpets capable of only a partial scale, in addition to
the usual strings, were hardly adequate to describe the adventures
of Dante in the Inferno. The literary and social life of the time had
set composers thinking in grand style, and they insisted upon having
the new and improved instruments which they felt they needed,
upon forcing manufacturers to inventions which should facilitate
complicated and extended passages in the wind, and the performers
to the acceptance of these new things and to unheard-of industry in
mastering them. Thus the mere external characteristics of romantic
orchestral music are highly typical of the spirit of the time.
Perhaps the most typical quality of all is the insistence upon
sensuous effect. We have seen how the denizens of the nineteenth
century longed to be part of the things that were going on about
them, how, basing themselves on the ‘sentimental’ school of
Rousseau, they considered a truth unperceived until they had felt it.
This distinction between contemplating life and experiencing it is one
of the chief distinctions between the classical and the romantic spirit
everywhere, and between the attitude of the eighteenth century and
that of the nineteenth in particular. When Rousseau offered the
feelings of his ‘new Heloïse’ as justification for her conduct, he sent
a shock through the intelligent minds of France. He said, in
substance: ‘Put yourself in her place and see if you wouldn’t do as
she did. Then ask yourself what your philosophic and moral
disapproval amounts to.’ Within some fifty years it became quite the
craze of polite society to put itself in the new Heloïse’s place, and
George Sand did it with an energy which astonished even France.
Now, when one commences thoroughly to reason out life from one’s
individual feelings, it becomes necessary to reconstruct philosophy—
namely, to construct it ‘from the bottom up,’ from the demands and
relations of the individual up to the constitution of the mass. And it
is quite natural that when insistence is thus laid on the individual
point of view the senses enter into the question far more largely
than before. At its most extreme this view comes to an unrestrained
license for the senses—a vice typical of Restoration France. But its
nobler side was its desire to discover how the other man felt and
what his needs were, in place of reasoning on abstract grounds how
he ‘ought’ to act. Besides, since the French Revolution people had
been experiencing things so incessantly that they had got the habit.
After the fall of Napoleon they could not consent to return to a calm
observation of events. Rather, it was precisely because external
events had calmed down that they so much more needed violent
experience in their imaginative and artistic life. The classic tragedies
of the French ‘golden age’ were indeed emotional and in high
degree, but the emotions were those of types, not of individuals.
They were looked on as grand æsthetic spectacles rather than as
appeals from one human being to another. It was distinctly bad form
to show too much emotion at a tragedy of Racine’s; whereas in the
romantic period tears were quite in fashion. However great the
human falsity of the romantic dramas, they at least pretended to be
expressions of individual emotions, and were received by their
audiences as such. The life of a follower of the arts in Paris in the
twenties and thirties (or anywhere in Europe, for that matter) was
one of laughing and weeping in the joys and sorrows of others,
moving from one emotional debauch to another, and taking pride in
making the feelings of these creations of art as much as possible
one’s own. It was small wonder, then, that musicians did the same;
that, in addition to trying to paint pictures and tell stories, they
should endeavor to make every stroke of beauty felt by the auditor,
and felt in a physical sensuous thrill rather than in a philosophic
‘sense of beauty.’
And nothing could offer the romantic musicians a finer opportunity
for all this than the timbres of the orchestra. The soft golden tone of
the horn, the brilliant yellow of the trumpet, the luscious green of
the oboe, the quiet silver white of the flute seemed to stand ready
for the poets of the senses to use at their pleasure. In the vibrating
tone of orchestral instruments, even more than in complicated
harmonies and appealing melodies, lay their chance for titillating the
nerves of a generation hungry for sensuous excitement. But we
must remember that if these instruments have poetic and colorful
associations to us it is in large measure because there were romantic
composers to suggest them. The horn and flute and oboe had been
at Haydn’s disposal, yet he was little interested in the sensuous
characteristics of them which we feel so acutely. In great measure
the poetic and sensuous tone qualities of the modern orchestra were
brought out by the romantic composers.
The classical orchestra, as we have seen in an earlier chapter, had
originally been based on the ‘string quartet’—namely, the first
violins, the second violins, the violas, and the ‘cellos, with the double
basses reënforcing the 'cello part. The string section completely
supported the musical structure. This was because the strings alone
were capable of playing complete and smooth scales and executing
all sorts of turns and trills with nearly equal facility. Wind
instruments in the eighteenth century were in a very imperfect
condition. Some of them, like the trumpets, were capable of no more
than eight or ten notes. All suffered from serious and numerous
restrictions. Hence they were originally used for giving occasional
color or ornamentation to the music which was carried by the
strings. About the middle of the century the famous orchestra of the
court of Mannheim, under the leadership and stimulus of Cannabich
and of the Stamitz family, reached something like a solid equilibrium
in the matter of instrumentation, and from its disposition of the
strings and wind all later orchestration took its rise. The Mannheim
orchestra became renowned for its nuance of effect, and especially
for its organized crescendos and diminuendos. The ideal orchestra
thus passed on to Haydn and Mozart was a ‘string quartet’ with
wood-wind instruments for the occasional doubling of the string
parts, and the brass for filling in and emphasizing important chords.
Gradually the wood-wind became a separate section of the
orchestra, sometimes carrying a whole passage without the aid of
strings, and sometimes combining with the string section on equal
terms. With this stage modern instrumentation may be said to have
begun. The brass had to wait; its individuality was not much
developed until Beethoven’s time.
Yet during the period of orchestral development under Haydn and
Mozart the strings remained the solid basis for orchestral writing,
partly because of their greater practical efficiency, and partly
because the reserved character of the violin tone appealed more to
the classic sense of moderation. And even with the increased
importance of the wood-winds the unit of writing was the group and
not the individual instrument (barring occasional special solos). The
later history of orchestral writing was one of a gradually increasing
importance and independence for the wood-wind section (and later
for the brass) and of individualization for each separate instrument.
Mozart based his writing upon the Mannheim orchestration and upon
Haydn, showing considerable sensitiveness to timbres, especially
that of the clarinet. Haydn, in turn, learned from Mozart’s
symphonies, and in his later works for the orchestra further
developed freedom of writing, being particularly fond of the oboe.
Beethoven emancipated all the instruments, making his orchestra a
collection of individual voices rather than of groups (though he was
necessarily hampered by the technically clumsy brass).
Yet, compared to the writing of Berlioz and Liszt, the classical
symphonies were in their orchestration rather dry and monochrome
(always making a reservation for the pronounced romantic vein in
Beethoven). Haydn and Mozart felt orchestral contrasts, but they
used them rather for the sake of variety than for their absolute
expressive value. So that, however these composers may have
anticipated and prepared the way for the romanticists, the difference
between the two orchestral palettes is striking. One might say it was
the difference between Raphael’s palette and Rubens’. And in mere
externals the romanticists worked on a much larger scale. The string
orchestra in Mozart’s time numbered from twenty-two to thirty
instruments, and to this were added usually two flutes and two
horns, and occasionally clarinets, bassoons, trumpets, and kettle-
drums in pairs. Beethoven’s orchestra was little larger than this, and
the capabilities of his instruments only slightly greater, but his use of
the various instruments as peculiar and individual voices was
masterly. All the great composers of the second quarter of the
nineteenth century studied his instrumentation and learned from it.
But Beethoven, though he sought out the individual character of
orchestral voices, did not make them sensuously expressive as
Weber and Liszt did. About the time of Beethoven’s death the use of
valves made the brass possible as an independent choir, capable of
performing most of the ordinary diatonic and accidental notes and of
carrying full harmony. But it must be said that even the most radical
of the romantic composers, such as Berlioz, did not avail themselves
of these improvements as rapidly as they might, and were
characteristic rather in their way of thinking for instruments than in
their way of writing for them. The valve horns and valve trumpets
came into use slowly; Schumann frequently used valve horns plus
natural horns, and Berlioz preferred the vulgar cornet à pistons to
the improved trumpet.
But the romantic period added many an instrument to the limited
orchestra of Mozart and Beethoven. Clarinets and trombones
became the usual thing. The horns were increased to four, and the
small flute or piccolo, the English horn, and the bass clarinet (or the
double bassoon), and the ophicleide became frequent. Various
instruments, such as the ‘serpent,’ the harp, and all sorts of drums
were freely introduced for special effects.
Berlioz especially loved to introduce unusual instruments, and
quantities of them. For his famous ‘Requiem’ he demanded (though
he later made concessions): six flutes, four oboes, six clarinets, ten
bassoons, thirty-five first and thirty-five second violins, thirty ‘cellos,
twenty-five basses, and twelve horns. In the Tuba Mirum he asks for
twelve pairs of kettle-drums, tuned to cover the whole diatonic scale
and several of the accidentals, and for four separate ‘orchestras,’
placed at the four corners of the stage, and calling for six cornets,
five trombones, and two tubas; or five trumpets, six ophicleides, four
trombones, four tubas, and the like. His scores are filled with minute
directions to the performers, especially to the drummers, who are
enjoined to use a certain type of drumstick for particular passages,
to place their drum in a certain position, and so on. His directions
are curt and precise. Liszt, on the other hand, leaves the matter
largely to ‘the gracious coöperation of the director.’
Experimentation with new and sensational effects made life thrilling
for these composers. Berlioz recalls with delight in his Memoirs an
effect he made with his arrangement of the ‘Rackoczy March’ in
Buda Pesth. ‘No sooner,’ says he, ‘did the rumor spread that I had
written hony (national) music than Pesth began to ferment. How had
I treated it? They feared profanation of that idolized melody which
for so many years had made their hearts beat with lust of glory and
battle and liberty; all kinds of stories were rife, and at last there
came to me M. Horwath, editor of a Hungarian paper, who, unable
to curb his curiosity, had gone to inspect my march at the copyist.’
'“I have seen your Rakoczy score,” he said, uneasily.
'“Well?”
'“Well, I feel horribly nervous about it.”
'“Bah! Why?”
'“Your motif is introduced piano, and we are used to hearing it
fortissimo.”
'“Yes, by the gypsies. Is that all? Don’t be alarmed. You shall have
such a forte as you never heard in your life. You can’t have read the
score carefully; remember the end is everything.”
‘All the same, when the day came my throat tightened, as it did in
times of great excitement, when this devil of a thing came on. First
the trumpets gave out the rhythm, then the flutes and clarinets, with
a pizzicato accompaniment of strings—softly outlining the air—the
audience remaining calm and judicial. Then, as there came a long
crescendo, broken by the dull beats of the big drum (as of distant
cannon), a strange restless movement was perceptible among them
—and, as the orchestra let itself go in a cataclysm of sweeping fury
and thunder, they could contain themselves no longer. Their
overcharged souls burst with a tremendous explosion of feeling that
raised my hair with terror.’
This bass-drum beat pianissimo ‘as of distant cannon’ has never to
this day lost its wild and mysterious potency. But it must not be
supposed that the romanticists’ contribution to orchestration
consisted mainly in isolated sensational effects. Their work was
marvellously thorough and solid. Berlioz in particular had a wizard-
like ear for discerning and developing subtleties of timbre. His great
work on Orchestration (now somewhat passé but still stimulating
and valuable to the student) abounds in the mention of them. He
points out the poetic possibilities in the lower registers of the
clarinets, little used before his day. He makes his famous notation as
to the utterly different tone qualities of one violin and of several
violins in unison, as though of different instruments. And so on
through hundreds of pages. The scores of the romanticists abound
in simple effects, unheard of before their time, which gain their end
like magic. Famous examples come readily to mind: the muted
violins in the high registers in the ‘Dance of the Sylphs’ from ‘The
Damnation of Faust’; the clumsy bassoons for the dance of the ‘rude
mechanicals’ in Mendelssohn’s incidental music to ‘A Midsummer
Night’s Dream’; the morose viola solo which recurs through Berlioz’s
‘Harold in Italy’; the taps and rolls on the tympani to accompany the
speeches of the devil in Der Freischütz or the flutes in their lowest
register in the accompaniment to Agathe’s air in the same opera—all
these are representative of the richness of poetic imagination and
understanding of orchestral possibilities in the composers of the
romantic period.

II
It was inevitable that the pure symphonic form should decline in
esteem during the romantic period; for it is based primarily on a love
of pure design—the ‘da capo’ scheme of statement, development,
and restatement, which remains the best method ever invented for
vividly presenting musical ideas without extra-musical association or
aid. It is primarily a mold for receiving ‘pure’ musical material, and
the romantic period, as we have seen, had comparatively little use
for music without poetic association. Of the best symphonies of the
time the greater part have some general poetical designation, like
the ‘Italian’ and ‘Scotch’ symphonies of Mendelssohn, or the ‘Spring’
and ‘Rhenish’ symphonies of Schumann. These titles were in some
cases mere afterthoughts or concessions to the demands of the
time, and in every case the merest general or whimsical suggestion.
Yet they can easily be imagined as fitting the musical material, and
they always manage to add interest to the work without interfering
with the ‘absolute’ musical value. And even when they are without
specific title they are infused with the spirit of the age—delight in
sensuous effects and rich scoring, emotional melody, and varied
harmonic support.
For all this, as for nearly everything else in modern music, we must
go back to Beethoven if we wish to find the source, but for purposes
of classification Schubert may be set down as the first romantic
symphonist. He adhered as closely as he could to the classical mold,
though he never had a predominant gift for form. A beautiful melody
was to him the law-giver for all things, and when he found such a
melody it went its way refusing to submit to the laws of proportion.
Yet this willfulness can hardly be regarded as standing in the way of
outward success; the ‘Unfinished’ symphony in B minor could not be
better loved than it is; it is safe to say that of all symphonies it is the
most popular. It was written (two movements and a few bars of a
scherzo) in 1822, was laid aside for no known reason, and lay
unknown in Vienna for many years until rescued by Sir George
Grove. The mysterious introduction in the ‘cellos and basses, as
though to say, ‘It happened once upon a time’; the haunting ‘second
theme’ introduced by the ‘cellos; the stirring development with its
shrieks of the wood-wind—all are of the very stuff of romantic
music. A purist might wish the work less diffuse, especially in the
second movement; no one could wish it more beautiful. In the great
C major symphony, written in the year of his death, Schubert seems
to have been attempting a magnum opus. If he had lived, this work
would certainly have been regarded as the first composition of his
‘second period.’ He labored over it with much more care than was his
custom, and showed a desire to attain a cogent form with truly
orchestral ideas. The best parts of the ‘Unfinished Symphony’ could
be sung by the human voice; the melodies of the C major are at
home only with orchestral instruments. The work was all but
unprecedented for its time in length and difficulty; it is Schubert’s
finest effort in sustained and noble expression, and, though
thoroughly romantic in tone, his nearest approach to ‘absolute’
music. It seems outmoded and at times a bit childlike to-day, but by
sheer beauty holds its place steadily on orchestral programs.
Schubert’s other symphonies have dropped almost completely out of
sight.
Mendelssohn’s four symphonies, including the ‘Italian,’ the ‘Scotch,’
and the ‘Reformation,’ have had a harder time holding their place. It
seems strange that Mendelssohn, the avowed follower of the
classics, should not have done his best work in his symphonies, but
these compositions, though executed with extreme polish and
dexterity, sound thin to-day. A bolder voice might have made them
live. But the ‘Scotch’ and ‘Italian’ in them are seen through Leipzig
spectacles, and the musical subject-matter is not vigorous enough to
challenge a listener in the midst of modern musical wealth. As for
the ‘Reformation’ symphony, with its use of the Protestant chorale,
Ein feste Burg, a technically ‘reformed’ Jew could hardly be expected
to catch the militant Christian spirit. Yet these works are at their best
precisely in their romantic picturesqueness; as essays in the
‘absolute’ symphony they cannot match the nobility and strength of
Schubert’s C major.
Schumann, the avowed romantic, had much more of worth to put
into his symphonies, probably because he was an apostle and an
image-breaker, and not a polite ‘synthesist.’ The ‘Spring’ symphony
in B flat, written in the year of his marriage, 1840 (the year of his
most exuberant productivity), remains one of the most beautiful
between Beethoven and recent times. The austerity of the classical
form never robbed him of spontaneity, for the ideas in his symphony
are not inferior to any he ever invented. The form is, on the whole,
satisfactory to the purist, and, beyond such innovations as the
connecting of all four movements in the last symphony, he
attempted little that was new. The four works are fertile in lovely
ideas, such as the graceful folk-song intoned by ‘cellos and wood-
wind in the third, or the impressive organ-like movement from the
same work. Throughout there is the same basic simplicity of
invention—the combination of fresh melodic idea with colorful
harmony—which endears him to all German hearts. It is customary
to say that Schumann was a mere amateur at orchestration. It is
certainly true that he had no particular turn for niceties of scoring or
for searching out endless novelties of effect, and it is true that he
sometimes proved himself ignorant of certain primary rules, as when
he wrote an unplayable phrase for the horns in his first symphony.
But his orchestration is, on the whole, well balanced and adequate
to his subject-matter, and is full of felicities of scoring which
harmonize with the romantic color of his ideas.
Of the other symphonists who were influenced by the romantic
fervor the greater part have dropped out of sight. Spohr, who may
be reckoned among them, was in his day considered the equal of
Beethoven, and his symphonies, though often manneristic, are noble
in conception, romantic in feeling, and learned in execution. Of a
much later period is Raff, a disciple of Liszt, and, to some extent, a
crusader on behalf of Wagner. Like Spohr, he enjoyed a much
exaggerated reputation during his lifetime. Of his eleven symphonies
Im Walde and Leonore (both of a mildly programmistic nature) were
the best known, the latter in particular a popular favorite of a
generation ago. Raff further developed the resources of the
orchestra without striking out any new paths. Many of his ideas were
romantic and charming, but he was too often facile and rather
cheap. Still, he had not a little to teach other composers, among
them the American MacDowell. Gade, friend of Mendelssohn and his
successor at Leipzig, was a thorough scholarly musician, one of the
few of the ‘Leipzig circle’ who did not succumb to dry formalism. He
may be considered one of the first of the ‘national composers,’ for
his work, based to some extent on the Danish folk idiom, secured
international recognition for the national school founded by J. P. E.
Hartmann. Ferdinand Hiller, friend of Liszt and Chopin, wrote three
symphonies marked by romantic feeling and technical vigor, and
Reinecke, for many years the representative of the Mendelssohn
tradition at Leipzig, wrote learnedly and at times with inspiring
freshness.

III
In the romantic period there developed, chiefly at the hands of
Mendelssohn, a form peculiarly characteristic of the time—the so-
called ‘concert overture.’ This was based on the classic overture for
opera or spoken drama, written in sonata form, usually with a slow
introduction, but poetic and, to a limited extent, descriptive, and
intended purely for concert performance. The models were
Beethoven’s overtures, ‘Coriolanus,’ ‘Egmont,’ and, best of all, the
‘Leonore No 3,’ written to introduce a particular opera or drama, it is
true, but summing up and in some degree following the course of
the drama and having all the ear-marks of the later romantic
overture. From a mere prelude intended to establish the prevailing
mood of the drama the overture had long since become an
independent artistic form. These overtures gained a great popularity
in concert, and their possibilities for romantic suggestion were
quickly seized upon by the romanticists.
Weber’s overture to Der Freischütz, though written for the opera,
may be ranked as a concert overture (it is most frequently heard in
that capacity), and along with it the equally fine Euryanthe and
Oberon. The first named was a real challenge to the Philistines. The
slow introduction, with its horn melody of surpassing loveliness, and
the fast movement, introducing the music of the Incantation scene,
are thoroughly romantic. Weber’s best known concert overture (in
the strict sense), the Jubel Ouvertüre, is of inferior quality.
Schumann, likewise, wrote no overtures not intended for a special
drama or a special occasion, but some of his works in this form rank
among his best orchestral compositions. Chief among them is the
‘Manfred,’ which depicts the morbid passions in the soul of Byron’s
hero, as fine a work in its kind as any of the period. The ‘Genoveva’
overture is fresh and colorful in the style of Weber, and that for
Schiller’s ‘Bride of Messina’ is scarcely inferior. Berlioz has to his
credit a number of works in this form, mostly dating from his earliest
years of creative activity. Best known are the ‘Rob Roy’ (introducing
the Scotch tune, ‘Scots Wha’ Hae’) and the Carnival Romain, but the
‘Lear’ and ‘The Corsair,’ inspired by two of his favorite authors,
Shakespeare and Byron, are also possessed of his familiar virtues.
Another composer who in his day made a name in this form is
William Sterndale Bennett, an Englishman who possessed the
highest esteem of Mendelssohn and Schumann, and was a valuable
part of the musical life of Leipzig in the thirties and later. The best
part of his work, now forgotten save in England, is for the piano, but
the ‘Parisina’ and ‘Wood Nymphs’ overtures were at one time ranked
with those of Mendelssohn. Like all English composers of those times
he was inclined to the academic, but his work had much freshness
and romantic charm, combined with an admirable sense of form.
But it is Mendelssohn whose place in this field is unrivalled. His
‘Midsummer Night’s Dream’ overture, written when he was
seventeen, has a place on modern concert programs analogous to
that of Schubert’s ‘Unfinished Symphony.’ This work is equally the
delight of the musical purist and of the untechnical music-lover. It is
marked by all Mendelssohn’s finest qualities. Not a measure of it is
slipshod or lacking in distinction. Its scoring is deft in the extreme.
Its themes are fresh and charming. And upon it all is the polish in
which Mendelssohn excelled; no note seems out of place, and none,
one feels, could be otherwise than as it is. It is mildly descriptive—as
descriptive as Mendelssohn ever was. The three groups of characters
in Shakespeare’s play are there—the fairies, the love-stricken
mortals, and the rude mechanicals—each with its characteristic
melody. The opening chords, high in the wood-wind, set the fanciful
tone of the whole. For deft adaptation of the means to the end it has
rarely been surpassed in all music. In his other overtures
Mendelssohn is even less descriptive, being content to catch the
dominant mood of the subject and transmit it into tone in the sonata
form. ‘Fingal’s Cave,’ the chief theme of which occurred to him and
was noted down on the supposed scene of its subject in Scotland, is
equally picturesque in its subject matter, but lacks the buoyant
invention of its predecessor. The ‘Calm Sea and Prosperous Voyage’
is a masterpiece of restraint. The technical means are exceedingly
simple, for in his effort to paint the reigning quiet of his theme
Mendelssohn dwells inordinately upon the pure tonic chord. Yet the
work never lacks its composer’s customary freshness or sense of
perfect proportion. His fourth overture—‘To the Story of the Lovely
Melusina’—is only second to the ‘Midsummer Night’s Dream’ in
popularity. In these works Mendelssohn is at his best; only the
‘Elijah’ and the violin concerto equally deserve long life and frequent
repetition. For the overtures best show Mendelssohn the synthesist.
In them he has caught absolutely the more refined spirit of
romanticism, with its emphasis on tone coloring and its association
of literary ideas, and has developed it in a classic mold as perfect as
anything in music. Nowhere else do the dominating musical ideas of
the eighteenth and nineteenth centuries come to such an amicable
meeting ground.

IV
Yet this ‘controlled romanticism,’ which Mendelssohn doubtless
hoped would found a school, had little historical result. The frenzied
spirits of the time needed some more vigorous stimulation, and
those who had vitality sufficient to make history were not the ones
to be guided by an academic gourmet. The Mendelssohn concert
overtures are a pleasant by-path in music; they by no means strike a
note to ring down the corridors of time. ‘Controlled romanticism’ was
not the message for Mendelssohn’s age; for this age was essentially
militant, smashing idols and blazing new paths, and nothing could
feed its appetite save bitter fruit.
This bitter fruit it had in full measure in Berlioz’s romantic
symphonies, as in Liszt’s symphonic poems. Of the true romantic
symphonies the most remarkable is Berlioz’s Symphonie Fantastique,
one of the most astonishing productions in the whole history of
music. It seems safe to say that in historical fruitfulness this work
ranks with three or four others of the greatest—Monteverdi’s opera
Orfeo, in 1607; Wagner’s Tristan, and what else? The Fantastique
created program music; it made an art form of the dramatic
symphony (including the not yet invented symphonic poem and all
forms of free and story-telling symphonic works). At the same time it
gave artistic existence to the leit-motif, or representative theme, the
most fruitful single musical invention of the nineteenth century.
The Fantastique seems to have no ancestry; there is nothing in
previous musical literature to which more than the vaguest parallel
can be drawn, and there is nothing in Berlioz’s previous works to
indicate that he had the power to take a new idea—two new ideas—
out of the sky and work them out with such mature mastery. One
might have expected a period of experimentation. One might at least
expect the work to be the logical outcome of experiments by other
men. But Berlioz had no true ancestor in this form; he had no more
than chance forerunners.
Nevertheless program music, or at least descriptive music, in some
form or other, is nearly as old as music itself. We have part-songs
dating from the fifteenth and sixteenth centuries which imitate the
cuckoo’s call, or the songs of other birds. Jannequin, contemporary
with Palestrina, wrote a piece descriptive of the battle of Marignan,
fought between the French and the Swiss in 1515. Even Bach joins
the other program composers with his ‘Caprice on the departure of
his brother,’ in which the posthorn is imitated. Couperin gave
picturesque titles to nearly all his compositions, and Rameau wrote a
delightful piece for harpsichord, suggestively called ‘The Hen.’ Many
of Haydn’s symphonies have titles which add materially to the poetry
of the music. Beethoven admitted that he never composed without
some definite image in mind. His ‘Pastoral Symphony’ is so well
known that it need only be mentioned, though strict theorists may
deny it a place with program music on the plea that, in the
composer’s own words, it is ‘rather the recording of impressions than
painting.’ Yet Beethoven wrote one piece of downright program
music in the strict sense, for his ‘Battle of Vittoria’ frankly sets out to
describe one of the battles of the Napoleonic wars. It is, however,
pure hack work, one of the few works of the master which might
have been composed by a mediocre man. It is of a sort of debased
program music which was much in fashion at the time, easy and silly
stuff which pretended to describe anything from a landscape up to
the battle of Waterloo. The instances of imitative music in Haydn’s
‘Creation’ are well known. Coming down to later times we find the
ophicleide imitating the braying of the ass in Mendelssohn’s
‘Midsummer Night’s Dream’ overture, and since then few composers,
however reserved in manner and classic in taste, have wholly
disdained it.
Yet all this long, even distinguished, history does not fully prepare
the way for the program music of Berlioz. It is not likely that he was
familiar with much of it. And even if he had been he could have
found no programmistic form or idea ready at hand for his program
pieces. The program music idea was rather ‘in the air’ than in
specific musical works. From the literary romanticists’ theory of the
mixing of the genres and the mingling of the arts his lively mind no
doubt drew a hint. And the influence of his teacher, Lesueur, at the
Conservatory must be reckoned on. Lesueur was something of a
radical and apostle of program music in his day, having been, in fact,
relieved of his duties as director of music in Notre Dame because he
insisted upon attuning men’s minds to piety by means of
‘picturesque and descriptive’ performances of the Mass. Program
music! Here was a true forerunner of Berlioz—a very bad boy in a
very solemn church. Perhaps this accounts for Berlioz’s veneration of
his teacher, one of the few men who doesn’t figure somewhat
disgracefully in the Memoirs. At any rate, the young revolutionist
found in Lesueur a sympathetic spirit such as is rarely to be found in
conservatories.
To sum up, then, we find that Berlioz had no precedent in reputable
music for a sustained work of a close descriptive nature. Works of
picturesque quality, which specifically do not ‘depict events’—like the
‘Pastoral’ symphony—are not program music in the more exact
sense. Isolated bits of description in good music, like the famous
‘leaping stag’ and ‘shaggy lion’ of Haydn’s ‘Creation,’ offer no analogy
for sustained description. And the supposed pieces of sustained
description, like the fashionable ‘battle’ pieces, had and deserved no
musical standing. The Fantastique, as we shall see, was detailed and
sustained description of the first rank musically. The gap between
the Fantastique and its supposed ancestors was quite complete. It
was bridged by pure genius.
As for the leit-motif, it is even more Berlioz’s own invention. The use
of a particular theme to represent a particular personage or emotion
was, of course, in such program music as had existed. But only in a
few isolated instances had this been used recurrently to accompany
a dramatic story. Mozart, in Don Giovanni, had used the famous
trombone theme to represent the Statue, first in the Graveyard
scene and later in the Supper scene. Weber had somewhat loosely
used a particular theme to represent the devil Samiel in Der
Freischütz. We know from Berlioz’s own description[98] how this
work affected him in his early Parisian years and we may assume
that the notion of the leit-motif took hold on him then. But the leit-
motif in Mozart and Weber is hardly used as a deliberate device,
rather only as a natural repetition under similar dramatic conditions.
The use of the leit-motif in symphonic music, and its variation under
varied conditions belongs solely to Berlioz.
True to romantic traditions, Berlioz evolved the Fantastique out of his
own joys and sorrows. It originated in the frenzy of his love for the
actress, Henriette Smithson. He writes in February, 1830:[99]
‘Again, without warning and without reason, my ill-starred passion
wakes. She is in London, yet I feel her presence ever with me. I
listen to the beating of my heart, it is like a sledge-hammer, every
nerve in my body quivers with pain.
‘Woe upon her! Could she but dream of the poetry, the infinite bliss
of such love as mine, she would fly to my arms, even though my
embrace should be her death.
‘I was just going to begin my great symphony (Episode in an Artist’s
Life) to depict the course of this infernal love of mine—but I can
write nothing.’
Why, this is very midsummer madness! you say. But the kind of
madness from which came much good romantic music. For the work
had been planned in the previous year, not long after Miss Smithson
had rejected Berlioz’s first advances.
But the composer very soon found that he could write—and he
wrote like a fiend. In May he tells a friend that the rehearsals of the
symphony will begin in three days. The concert is to take place on
the 30th. As for Miss Smithson, ‘I pity and despise her. She is
nothing but a commonplace woman with an instinct for expressing
the tortures of the soul that she has never felt.’ Yet he wished that
‘the theatre people would somehow plot to get her there—that
wretched woman! She could not but recognize herself.’
The performance of the symphony finally came off toward the end of
the year. But in the meantime a new goddess had descended from
the skies. The composer’s marriage was to depend on the success of
the concert—so he says. ‘It must be a theatrical success; Camille’s
parents insist upon that as a condition of our marriage. I hope I shall
succeed.
‘P. S. That wretched Smithson girl is still here. I have not seen her.’
And a few weeks later: ‘I had a frantic success. They actually
encored the Marche au Supplice. I am mad! mad! My marriage is
fixed for Easter, 1832. My blessed symphony has done the deed.’
But not quite. He was rewriting this same symphony a few months
later in Italy when there came a letter from Camille’s mother
announcing her engagement to M. Pleyel!
As explanation to the symphony the composer wrote an extended
‘program’—in the strictest modern sense. He notes, however, that
the program may be dispensed with, as ‘the symphony (the author
hopes) offers sufficient musical interest in itself, independent of any
dramatic intention.’ The program of the Fantastique is worth quoting
entire, since it stands as the prototype and model of all musical
programs since:
‘A young musician of morbid sensitiveness and ardent imagination
poisons himself with opium in an excess of amorous despair. The
narcotic dose, too weak to cause his death, plunges him into a
heavy sleep, accompanied by the strangest visions, while his
sensations, sentiments and memories translate themselves in his
sick brain into musical thoughts and images. The loved one herself
has become for him a melody, like a fixed idea which he rediscovers
and hears everywhere.
‘First Part: Reveries, Passions. He first recalls that uneasiness of the
soul, that wave of passions, those melancholies, those reasonless
joys, which he experienced before having seen her whom he loves;
then the volcanic love with which she suddenly inspired him, his
frenzied heart-rendings, his jealous fury, his reawakening
tenderness, his religious consolations.
‘Second Part: A Ball. He finds the loved one at a ball, in the midst of
tumult and a brilliant fête.
‘Third Part: In the Country. A summer evening in the country: he
hears two shepherds conversing with their horns; this pastoral duet,
the natural scene, the soft whispering of the winds in the trees, a
few sentiments of hope which he has recently conceived, all combine
to give his soul an unwonted calm, to give a happier color to his
thoughts; but she appears anew, his heart stops beating, painful
misapprehensions stir him—if she should deceive him! One of the
shepherds repeats his naïve melody; the other does not respond.
The sun sets—distant rolls of thunder—solitude—silence——
‘Fourth Part: March to the Gallows. He dreams that he has killed his
loved one, that he is condemned to death, led to the gallows. The
cortège advances, to the sounds of a march now sombre and wild,
now brilliant and solemn, in which a dull sound of heavy steps
follows immediately upon the noisiest shouts. Finally, the fixed idea
reappears for an instant like a last thought of love, to be interrupted
by the fatal blow.
‘Fifth Part: Dream of the Witches’ Festival. He fancies he is present
at a witches’ dance, in the midst of a gruesome company of shades,
sorcerers, and monsters of all sorts gathered for his funeral. Strange
sounds, sighs, bursts of laughter, distant cries and answers. The
loved melody reappears again; but it has lost its character of nobility
and timidity; it is nothing but an ignoble dance, trivial and
grotesque; it is she who comes to the witches’ festival. Sounds of joy
at her arrival. She mingles with the hellish orgy; uncanny noises—
burlesque of the Dies Irae; dance of the witches. The witches’ dance
and the Dies Irae follow.’
The music follows this program in detail, and supplies a host of other
details to the sympathetic imagination. The opening movement
contains a melody which Berlioz avers he composed at the age of
twelve, when he was in love with yet another young lady, a certain
Estelle, six years his senior. And in each movement occurs the ‘fixed
idea,’ founder of that distinguished dynasty of leit-motifs in the
nineteenth century:

[PDF][Listen]

In the opening movement, when the first agonies of love are at their
height, this theme undergoes a long contrapuntal development
which is a marvel of complexity and harmonic energy. It recurs
practically unchanged in the next three movements, and at its
appearance in the fourth is cut short as the guillotine chops the
musician’s head off. In the last movement it undergoes the change
which makes this work the predecessor of Liszt’s symphonic poems:
[PDF][Listen]

The structure of this work is complicated in the extreme, and it


abounds in harmonic and contrapuntal novelties which are strokes of
pure genius. Many a musician may dislike the symphony, but none
can help respecting it. The orchestra, though not large for our day,
was revolutionary in its time. It included, in one movement or
another (besides the usual strings) a small flute and two large ones;
oboes; two clarinets, a small clarinet, and an English horn; four
horns, two trumpets, two cornets à pistons, and three trombones;
four bassoons, two ophicleides, four pairs of kettle-drums, cymbals,
bells, and bass drum.
A challenge to the timid spirits of the time; and a thing of
revolutionary significance to modern music.
The other great dramatic symphonies of the time belong wholly to
Berlioz and Liszt. The Revolutionary Symphony which Berlioz had
planned under the stimulus of the 1830 revolution, became, about
1837, the Symphonie Funèbre et Héroïque, composed in honor of
the men killed in this insurrection. It is mostly of inferior stuff
compared with the composer’s other works, but the ‘Funeral Sermon’
of the second movement, which is a long accompanied recitative for
the trombones, is extremely impressive. ‘Harold in Italy,’ founded
upon Byron’s ‘Childe Harold,’ was planned during Berlioz’s residence
in Italy, and executed under the stimulus of Paganini. Here again we
have the ‘fixed idea,’ in the shape of a lovely solo, representing the
morose hero, given to the viola. The work was first planned as a
viola concerto, but the composer’s poetic instinct carried him into a
dramatic symphony. First Harold is in the mountains and Byronic
moods of longing creep over him. Then a band of pilgrims
approaches and his melody mingles with their chant. Then the hero
hears an Abruzzi mountaineer serenading his lady love, and to the
tune of his ‘fixed idea’ he invites his own soul to muse of love. And,
finally, Harold is captured by brigands, and his melody mingles with
their wild dance.
Berlioz’s melodies are apt to be dry and even cerebral in their
character, but this one for Harold is as beautiful as one could wish:

[PDF][Listen]

The ‘Romeo and Juliet’ is by many considered Berlioz’s finest work. It


is in two parts, the first including a number of choruses and
recitatives narrating the course of the tragedy, and the second
developing various pictures selected out of the action. The love
scene is ‘pure’ music of the highest beauty, and the scherzo, based
on the ‘Queen Mab’ speech, is one of Berlioz’s most typical
inventions.
All these compositions antedate by a number of years the works of
Liszt and Wagner, which make extended use of Berlioz’s means.
Wagner describes at length how the idea of leit-motifs occurred to
him during his composition of ‘The Flying Dutchman’ (completed in
1841), but he was certainly familiar with Berlioz’s works. Liszt was
from the first a great admirer of Berlioz, and greatly helped to
extend his reputation through his masterly piano arrangements of
the Frenchman’s works. His development of the leit-motif in his
symphonic poems is frankly an adaptation of the Berlioz idea.
Liszt’s dramatic symphonies are two—‘Dante’ and ‘Faust’—by which,
doubtless, if he had his way, his name would chiefly be known
among the nations. We have seen in an earlier chapter how deeply
Liszt was impressed by the great paintings in Rome, and how in his
youth he dreamed of some later Beethoven who would translate
Dante into an immortal musical work. In the quiet of Weimar he set
himself to accomplish the labor. The work is sub-titled ‘Inferno,
Purgatory, and Paradise,’ but it is in two movements, the Purgatory
leading into, or perhaps only to, the gate of Heaven. The first
movement opens with one of the finest of all Liszt’s themes,
designed to express Dante’s

[PDF][Listen]

lines: ‘Through me the entrance to the city of horror; through me


the entrance into eternal pain; through me the entrance to the
dwelling place of the damned.’ And immediately another motive for
the horns and trumpets to the famous words: ‘All hope abandon, ye
who enter here.’ The movement, with an excessive use of the
diminished seventh chord, depicts the sufferings of the damned. But
presently the composer comes to a different sort of anguish, which
challenges all his powers as tone poet. It is the famous episode of
Paolo and Francesca da Rimini. It is introduced by another motive of
great beauty, standing for the words: ‘There is no greater anguish
than, during suffering, to think of happier times.’ In the Francesca
episode Liszt lavishes all his best powers, and achieves some of his
finest pages. The music now descends into the lower depths of the
Inferno, and culminates in a thunderous restatement of the theme,
‘All hope abandon,’ by the horns, trumpets and trombones. The
second movement, representing Purgatory, strikes a very different
note, one of hope and aspiration, and culminates in the Latin
Magnificat, sung by women’s voices to a modal tune, which Liszt,
now once more a loyal Catholic, writes from the heart.
The ‘Faust’ symphony, written between 1854 and 1857, is hardly less
magnificent in its plan and execution. It is sub-titled ‘three
character-pictures,’ and its movements are assigned respectively to
Faust, Gretchen, and Mephistopheles. Yet the last movement merges
into a dramatic narration of the love story and of Faust’s philosophic
aspirations, and reaches its climax in a men’s chorus intoning the
famous final chorus from Goethe’s drama: ‘All things transitory are
but a semblance.’ The Faust theme deserves quoting because of its
chromatic character, which has become so typical of modern music:

[PDF][Listen]

The whole work is in Liszt’s most exalted vein. The ‘character


pictures’ are suggestive in the extreme, and are contrasted in the
most vivid manner. Liszt has rarely surpassed in sheer beauty the
Gretchen episode, the theme of which later becomes the setting for
Goethe’s famous line, ‘The eternal feminine leads us upward and on.’
These two works—the ‘Dante’ and the ‘Faust’—are doubtless not so
supremely creative as Liszt imagined, but they remain among the
noblest things in modern music. Their great difficulty of execution,
even to orchestras in our day, stands in the way of their more
frequent performance, but to those who hear them they prove
unforgettable. In them, more than in any other of his works, Liszt
has lavished his musical learning and invention, has put all that was
best and noblest in himself.

V
The most typical musical form of to-day—the symphonic poem—is
wholly the creation of Liszt. The dramatic symphony attained its
highest development at the hands of its inventor; later works of the
kind, such as Raff’s ‘Lenore Symphony,’ have been musically of the
second or third rate. It is quite true that a large proportion of the
symphonies of to-day have some sort of general program or
‘subject,’ and nearly all are sufficiently dramatic in feeling to invite
fanciful ‘programs’ on the part of their hearers. But few composers
have cared or dared to go to Berlioz’s lengths. The symphonic poem,
on the other hand, has become the ambition of most of the able
orchestral writers of our day. And, whereas Berlioz has never been
equalled in his line, Liszt has often been surpassed, notably by
Richard Strauss, in his.
Curiously enough, Berlioz, who was by temperament least fitted to
work in the strict symphonic form, always kept to it in some degree.
The most revolutionary of spirits never broke away wholly from the
past. Liszt carried Berlioz’s program ideas to their logical conclusion,
inventing a type of composition in which the form depended wholly
and solely on the subject matter. This latter statement will almost
serve as a definition of the symphonic poem. It is any sort of
orchestral composition which sets itself to tell a story or depict the
emotional content of a story. Its form will be—what the story
dictates, and no other. The distinction sometimes drawn between the
symphonic poem and the tone poem is largely fanciful. One may say
that the former tends to the narrative and the latter to the
emotional, but for practical purposes the two terms may be held
synonymous.
In any kind of musical narration it is usually necessary to represent
the principal characters or ideas in particular fashion, and the leit-
motif is the natural means to this end. And, though theoretically not
indispensable, the leit-motif has become a distinguishing feature of
the symphonic poem and inseparable from it. Sometimes the themes
are many (Strauss has scores of them in his Heldenleben), but Liszt
took a particular pleasure in economy of means. Sometimes a single
theme served him for the development of the whole work. He took
the delight of a short-story writer in making his work as compact
and unified as possible. In fact, the formal theory of the symphonic
poem would read much like Poe’s well known theory of the short
story. Let there be some predominant character or idea—‘a single
unique effect,’ in Poe’s language—and let this be developed through
the various incidents of the narration, changing according to the
changing conditions, but always retaining an obvious relation to the
central idea. Or, in musical terms, select a single theme (or at most
two or three) representing the central character or idea, and repeat
and develop this in various forms and moods. This principle brought
to a high efficiency a device which Berlioz used only tentatively—that
of transformation. To Liszt a theme should always be fluid, rarely
repeating itself exactly, for a story never repeats itself. And his
musicianship and invention show themselves at their best (and
sometimes at their worst) in his constant variation of his themes
through many styles and forms.
But such formal statement as this is vague and meaningless without
the practical application which Liszt gave it. The second and in many
respects the noblest of Liszt’s symphonic poems is the ‘Tasso,
Lament and Triumph,’ composed in 1849 to accompany a festival
performance of Goethe’s play at Weimar on the hundredth
anniversary of the poet’s birth. The subject caught hold of Liszt’s
romantic imagination. He confesses, like the good romanticist that
he is, that Byron’s treatment of the character appealed to him more
than Goethe’s. ‘Nevertheless,’ he says in his preface to the work,
‘Byron, in his picture of Tasso in prison, was unable to add to the
remembrance of his poignant grief, so nobly and eloquently uttered
in his “Lament,” the thought of the “Triumph” that a tardy justice
gave to the chivalrous author of “Jerusalem Delivered.” We have
sought to mark this dual idea in the very title of our work, and we
should be glad to have succeeded in pointing this great contrast—
the genius who was misjudged during his life, surrounded, after
death, with a halo that destroyed his enemies. Tasso loved and
suffered at Ferrara; he was avenged at Rome; his glory still lives in
the folk-songs of Venice. These three elements are inseparable from
his memory. To represent them in music, we first called up his
august spirit as he still haunts the waters of Venice. Then we beheld
his proud and melancholy figure as he passed through the festivals
of Ferrara where he had produced his master-works. Finally, we
followed him to Rome, the eternal city, that offered him the crown
and glorified in him the martyr and the poet.’ A few lines further Liszt
says: ‘For the sake, not merely of authority, but the distinction of
historical truth, we put our idea into realistic form in taking for the
theme of our musical hero the melody to which we have heard the
gondoliers of Venice sing over the waters the lines of Tasso, and
utter them three centuries after the poet.’ The theme is one of the
finest in the whole Liszt catalogue. We need hardly go to the length
of saying that its origin was a fiction on the part of the composer,
but doubtless he changed it generously to suit his musical needs. Yet
his evident delight in its pretended origin is typical of the man and
the time; romanticism had a sentimental veneration for ‘the people,’
especially the people of the Middle Ages, and a Venetian gondolier
would naturally be the object of a shower of quite undeserved
sentimental poetry. The whole story, and the atmosphere which
surrounded it, was meat for Liszt’s imagination.

[PDF][Listen]

This is the theme—a typical one—which Liszt transforms, ‘according


to the changing conditions,’ to delineate his hero’s struggles, the
heroic character of the man; his determination to achieve greatness;
his ‘proud and melancholy figure as he passed through the festivals
at Ferrara’—the theme of the dance itself is developed from the
Tasso motif:

You might also like