0% found this document useful (0 votes)
31 views57 pages

Git Apprentice Second Edition 2nd Edition Raywenderlich Tutorial Team Download

The document is about the 'Git Apprentice Second Edition' ebook, which provides a comprehensive guide to using Git for version control. It includes chapters on fundamental concepts such as cloning repositories, committing changes, and managing branches. Additionally, it offers links to related Git resources and other recommended ebooks for further learning.

Uploaded by

mondeeland87
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
0% found this document useful (0 votes)
31 views57 pages

Git Apprentice Second Edition 2nd Edition Raywenderlich Tutorial Team Download

The document is about the 'Git Apprentice Second Edition' ebook, which provides a comprehensive guide to using Git for version control. It includes chapters on fundamental concepts such as cloning repositories, committing changes, and managing branches. Additionally, it offers links to related Git resources and other recommended ebooks for further learning.

Uploaded by

mondeeland87
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/ 57

Git Apprentice Second Edition 2nd Edition

Raywenderlich Tutorial Team download

https://ebookbell.com/product/git-apprentice-second-edition-2nd-
edition-raywenderlich-tutorial-team-54452352

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Git Apprentice Getting Started With Git Commands Concepts 1st Edition
Chris Belanger

https://ebookbell.com/product/git-apprentice-getting-started-with-git-
commands-concepts-1st-edition-chris-belanger-34635248

Git Apprentice By Chris Belanger And Bhagat Singh

https://ebookbell.com/product/git-apprentice-by-chris-belanger-and-
bhagat-singh-36344032

Git Pocket Guide A Working Introduction 1st Edition Richard Silverman

https://ebookbell.com/product/git-pocket-guide-a-working-
introduction-1st-edition-richard-silverman-49451698

Git Version Control Cookbook Leverage Version Control To Transform


Your Development Workflow And Boost Productivity 2nd Edition Kenneth
Geisshirt Emanuele Zattin Rasmus Voss Aske Olsson

https://ebookbell.com/product/git-version-control-cookbook-leverage-
version-control-to-transform-your-development-workflow-and-boost-
productivity-2nd-edition-kenneth-geisshirt-emanuele-zattin-rasmus-
voss-aske-olsson-49848068
Git Essentials Developers Guide To Git 1st Edition Franois Dupire

https://ebookbell.com/product/git-essentials-developers-guide-to-
git-1st-edition-franois-dupire-50377272

Git Repository Management In 30 Days 1st Edition Sumit Jaiswal

https://ebookbell.com/product/git-repository-management-
in-30-days-1st-edition-sumit-jaiswal-50418178

Git Distributed Version Controlfundamentals And Workflows Ren Preiel


Bjrn Stachmann

https://ebookbell.com/product/git-distributed-version-
controlfundamentals-and-workflows-ren-preiel-bjrn-stachmann-51344514

Git For Humans 1st Edition Demaree David

https://ebookbell.com/product/git-for-humans-1st-edition-demaree-
david-55382370

Git Version Control For Everyone Ravishankar Somasundaram

https://ebookbell.com/product/git-version-control-for-everyone-
ravishankar-somasundaram-55382386
Git Apprentice Git Apprentice

Git Apprentice
Chris Belanger & Bhagat Singh

Copyright ©2021 Razeware LLC.

Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text,
images, or source code) may be reproduced or distributed by any means without
prior written permission of the copyright owner.

Notice of Liability
This book and all corresponding materials (such as source code) are provided on an
“as is” basis, without warranty of any kind, express of implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose, and
noninfringement. In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in action of contract, tort or otherwise,
arising from, out of or in connection with the software or the use of other dealing in
the software.

Trademarks
All trademarks and registered trademarks appearing in this book are the property of
their own respective owners.

raywenderlich.com 2
Git Apprentice

Table of Contents: Overview


Book License ................................................................................................ 8
Before You Begin ................................................................... 9
What You Need ........................................................................................ 10
Book Source Code & Forums ............................................................. 11
Acknowledgments .................................................................................. 14
Introduction .............................................................................................. 15
Section I: Beginning Git .................................................... 18
Chapter 1: A Crash Course in Git ......................................... 19
Chapter 2: Cloning a Repo ...................................................... 32
Chapter 3: Committing Your Changes ............................... 42
Chapter 4: The Staging Area .................................................. 62
Chapter 5: Ignoring Files in Git ............................................. 75
Chapter 6: Git Log & History .................................................. 83
Chapter 7: Branching ................................................................ 98
Chapter 8: Merging ................................................................. 109
Chapter 9: Syncing With a Remote ................................... 123
Chapter 10: Creating a Repository ................................... 138
Conclusion .............................................................................................. 152
Section II: Appendices .................................................... 153
Appendix A: Installing & Configuring Git ....................... 154

raywenderlich.com 3
Git Apprentice

Table of Contents: Extended


Book License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
What You Need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Book Source Code & Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
About the Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Content Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Enter the video courses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
How to read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Section I: Beginning Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18


Chapter 1: A Crash Course in Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
What are remote repositories? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Forking the remote repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Cloning the repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Creating a branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Making and staging changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Committing changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Pushing your changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Creating a pull request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 2: Cloning a Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
What is cloning?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Using GitHub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Forking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

raywenderlich.com 4
Git Apprentice

Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Chapter 3: Committing Your Changes . . . . . . . . . . . . . . . . . . . . . . . 42
What is a commit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Working trees and staging areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Committing your changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Adding directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Looking at git log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Chapter 4: The Staging Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Why staging exists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Undoing staged changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Moving files in Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Deleting files in Git. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Chapter 5: Ignoring Files in Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Introducing .gitignore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Nesting .gitignore files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Looking at the global .gitignore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Finding sample .gitignore files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Chapter 6: Git Log & History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Viewing Git history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

raywenderlich.com 5
Git Apprentice

Vanilla git log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84


Limiting results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Graphical views of your repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Viewing non-ancestral history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Using Git shortlog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Searching Git history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Chapter 7: Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
What is a commit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
What is a branch? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Creating a branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
How Git tracks branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Checking your current branch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Switching to another branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Viewing local and remote branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Explaining origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Viewing branches graphically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
A shortcut for branch creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Chapter 8: Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
A look at your branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Three-way merges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Merging a branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Fast-forward merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Forcing merge commits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

raywenderlich.com 6
Git Apprentice

Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122


Chapter 9: Syncing With a Remote . . . . . . . . . . . . . . . . . . . . . . . . . 123
Pushing your changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Pulling changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Dealing with multiple remotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Chapter 10: Creating a Repository . . . . . . . . . . . . . . . . . . . . . . . . . 138
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Creating a LICENSE file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Creating a README file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Creating and syncing a remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Section II: Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Appendix A: Installing & Configuring Git . . . . . . . . . . . . . . . . . . . 154
Installing on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Installing on macOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Configuring credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Setting your username and email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Persisting your password. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

raywenderlich.com 7
L Book License

By purchasing Git Apprentice, you have the following license:

• You are allowed to use and/or modify the source code in Git Apprentice in as many
apps as you want, with no attribution required.

• You are allowed to use and/or modify all art, images and designs that are included
in Git Apprentice in as many apps as you want, but must include this attribution
line somewhere inside your app: “Artwork/images/designs: from Git Apprentice,
available at www.raywenderlich.com”.

• The source code included in Git Apprentice is for your personal use only. You are
NOT allowed to distribute or sell the source code in Git Apprentice without prior
authorization.

• This book is for your personal use only. You are NOT allowed to sell this book
without prior authorization, or distribute it to friends, coworkers or students; they
would need to purchase their own copies.

All materials provided with this book are provided on an “as is” basis, without
warranty of any kind, express or implied, including but not limited to the warranties
of merchantability, fitness for a particular purpose and noninfringement. In no event
shall the authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from, out of or in
connection with the software or the use or other dealings in the software.

All trademarks and registered trademarks appearing in this guide are the properties
of their respective owners.

raywenderlich.com 8
Before You Begin

This section tells you a few things you need to know before you get started, such as
what you’ll need for hardware and software, where to find the project files for this
book, and more.

raywenderlich.com 9
i What You Need

To follow along with this book, you’ll need the following:

• Git 2.32 or later. Git is the software package you’ll use for all the work in this
book. There are installers for macOS, Windows and Linux available for free from
the official Git page here: https://git-scm.com/downloads. We’ve tested this book
on Git 2.32.0, but you can follow along with older versions of Git as well.

raywenderlich.com 10
ii Book Source Code &
Forums

Book source code


The materials for this book are all available in the GitHub repository here:

• https://github.com/raywenderlich/gita-materials/tree/editions/2.0

You can download the entire set of materials for the book from that page.

Forum
We’ve also set up an official forum for the book at https://
forums.raywenderlich.com/c/books/git-apprentice. This is a great place to ask
questions about the book or to submit any errors you may find.

raywenderlich.com 11
“For Russ and Skip.”

— Chris Belanger

“For my mother, who always believed in me..”

— Bhagat Singh

raywenderlich.com 12
Git Apprentice About the Team

About the Authors


Chris Belanger is an author of this book. He is the CMO of
raywenderlich.com. If there are words to wrangle or a paragraph to
ponder, he‘s on the case. In the programming world, Chris has over
25 years of experience with multiple database platforms, real-time
industrial control systems, and enterprise healthcare information
systems. When he kicks back, you can usually find Chris with guitar
in hand, looking for the nearest beach, or exploring the lakes and
rivers in his part of the world in a canoe.

Bhagat Singh is an author of this book. He hails from New Delhi,


India. Bhagat started iOS Development as a hobby which
eventually became his profession. His design practice combines
design thinking and experience strategy with a relentless focus on
the user. He has also been contributing in the raywenderlich.com
tutorial team from past three years. When the laptop lid shuts
down, you can find him chilling with his friends and finding new
places to eat. He dedicates all his success to his mother. You can
find Bhagat on Twitter: @soulful_swift (https://twitter.com/
soulful_swift)

About the Editors


Aaron Douglas is the final pass editor for this book. He was that
kid taking apart the mechanical and electrical appliances at five
years of age to see how they worked. He never grew out of that core
interest - to know how things work. He took an early interest in
computer programming, figuring out how to get past security to be
able to play games on his dad’s computer. He’s still that feisty nerd,
but at least now he gets paid to do it. Aaron works for Automattic
(WordPress.com, WooCommerce, Tumblr, SimpleNote) as a Mobile
Lead primarily on the WooCommerce mobile apps. Find Aaron on
Twitter as @astralbodies or at his blog at https://aaron.blog.

raywenderlich.com 13
v Acknowledgments

Content Development
We would like to thank Chris Belanger for his work on the previous edition of the
book.We also should mention Sam Davies whose evergreen video course is the basis
of this book.

raywenderlich.com 14
vi Introduction

There are usually two reasons a person picks up a book about Git: one, they are
unusually curious about how the software works at a deeper level; or two, they’re
frustrated and need something to solve their problems now.

Whatever situation brought you here, welcome! I’m happy to have you onboard. I
came to write this book for both of the above reasons. I am a tinkerer and hacker by
nature, and I love going deep into the internals of software to see what makes them
tick. But I, like you, found Git at first to be an inscrutable piece of software. My brain,
which had been trained in software development through the late 1990s, found
version control packages like SVN soothing, with their familiar client-server
architecture, Windows shell integration, and rather straightforward, albeit heavy,
processes.

When I came to use Git and GitHub about seven years ago, I found it inscrutable at
best; it seemed no matter which way I turned, Git was telling me I had a merge
conflict, or it was merging changes from the master branch into my current branch,
or quite often complaining about unstaged changes. And why was it called a “pull
request”, when clearly I was trying to push my changes into the master branch?

Little by little, I learned more about how Git worked; how to solve some of the
common issues I encountered, and I eventually got to a point where I felt
comfortable using it on a daily basis.

raywenderlich.com 15
Git Apprentice Introduction

Enter the video courses


In early 2017, my colleague Sam Davies created a conference talk, titled “Mastering
Git”, and from that, two video courses at raywenderlich.com: “Beginning Git” and
“Mastering Git”. Those two courses form the basis of this book, but it always nagged
me a little that, while Sam’s video version of the material was quite pragmatic and
tied nicely into using both the command line and graphical tools to solve common
Git workflow problems, I always felt like there was a bit of detail missing; the kind of
information that would lead a curious mind to say “I see the how, but I really want to
know more about the why.”

This book gives a little more background on the why: or, in other words, “Why the
%^&$ did you do that to my repository, Git?!” Underneath the hood, you’ll find that
Git has a rather simple and elegant architecture, which is why it scales so well to the
kinds of globally distributed projects that use Git as their version control software,
via GitHub, GitLab, Bitbucket, or other cloud repository management solutions.

And while GUI-based Git frontends like Tower or GitHub Desktop are great at
minimizing effort, they abstract you away from the actual guts of Git. That’s why this
book takes a command-line-first approach, so that you’ll gain a better understanding
of the various actions that Git takes to manage your repositories — and more
importantly, you’ll gain a better understanding of how to fix things when Git does
things that don’t seem to make much sense.

How to read this book


This book covers Beginning Git. If you are still struggling to figure out the
difference between a push and a commit, or you’re coming to Git from a different
version control system, start here. This section takes you through concepts such as
cloning, staging, committing, syncing, merging, viewing logs, and more. The very
first chapter is a crash course on using Git, where you’ll go through the basic Git
workflow to get a handle on the how before you move into the what and the why.

This book works with a small repository that houses a simple ToDo system based on
text files that hold ideas (both good and bad) ideas for content for the website. It’s an
ideal way to learn about Git without getting bogged down in a particular language or
framework.

The next book in our mastering Git series, Advanced Git, which we encourage you to
explore once you’ve completed this book.

raywenderlich.com 16
Random documents with unrelated
content Scribd suggests to you:
give a single note at the end of each verse “to receive the sound.” It
is one of the most ancient of Chinese musical instruments. When an
instrument is composed of a number of these stones it is called Pien-
ch’ing. Usually sixteen of these stones all the same size are placed
upon a frame of fantastic ornamentation, set in two rows; the
difference in pitch is secured a difference in thickness of each:
otherwise all are alike throughout the scale.
The instrument is exclusively used in court and religious ceremonies,
and it is said that beyond those in the Confucian temples and
imperial palaces it is impossible now to find a complete specimen,
though single stones are sometimes met with.
There is a tradition that about two thousand years ago a complete
stone chime was found in a pool, and that this model was followed
by imperial decree. But this, if correct, does not afford any accurate
guidance or tell us what kind of stone chime was extant during the
old Hsia, Shang, or Chou dynasties; for not an instrument or book of
those periods escaped the great destruction ordered by the Emperor
Che Huang-ti; at least, there is no certain evidence against this
belief. So that, for the determination of the actual date of the
introduction of the supposed equal tempered twelve semitone scale,
we remain in the dark, without a clue. Moreover, when the existing
stone chimes—or, rather, the Yün-lo, or gong chimes constructed to
correspond in scale to the stone chimes upon the same twelve lüs
principle—are submitted to examination of the necessary rigid
enquiry by tests, they do not bear out the true semitonal character
that has been asserted. Mr. Ellis tested two specimens in the South
Kensington Museum, but both differed greatly, and he failed to find
anything like the assumed scale; and such scale as he did find he
was unable to give any theory for. Van Aalst says that

It has become exceedingly difficult to find a Yün-lo capable of giving a satisfactory


gamut; besides, the pitch is not uniform, so that two Yün-los rarely agree.
And of the Pien-ching, or stone chimes, he states that
It is exclusively used in court and religious ceremonies, and it would be considered
a profanation to use it elsewhere. It is impossible to find a complete instrument for
sale, although separate stones may be found. It is not known to whom and to
what dynasty the Pien-ching may be attributed, but there is no doubt that it is one
of the most ancient instruments.

Where then shall we find this semitonal scale, this twelve notes
series comprised within the octave?
Considering how very ancient the stone chime is, the question may
well arise how the pitch was derived or ascertained, since in the
material and dimensions no certain reliance could be placed. Both
the stone chime and the Sheng are attributed to an era some five
thousand years ago (about the time of Noah), and then in those
days the Chinese had long been a musical people. It would be but
natural to conclude that the Sheng conforms most to the lüs the
ancient and the original determinant of pitch, and we may be quite
sure that the pitch given by my pipe is the same to-day as in that
remote age. Neither strings nor stones can pretend to the same
absolute fixity.
But now listen. “Music in China,” says Van Aalst, “has been known
since the remotest antiquity. The first invaders of China certainly
brought with them certain notions of music. The aborigines
themselves had also some kind of musical system, which their
conquerors admired and probably mixed with their own. These
invaders were a band of immigrants fighting their way among the
aborigines, and supposed to have come from the south of the
Caspian Sea; remnants of the original Li, the Kuei, and the Feng
tribes are said to be still in existence in south China.” Is there not
here the hint of a curious problem? By what track came the Phœnix
and the Pan’s pipes both to Greece and to China? Dim, through
sequestered years we should wander back, to some immemorial
age, moss grown with primæval traditions, long ere these lands had
their names, and in the deep recesses of forests untrodden by the
foot of man, peradventure we should find that dwelling place of the
great god Pan whence in the earliest of days he came bringing his
river reeds and his wild music with him.
CHAPTER XIV.

The Mongols’ New Home.

THE MYTHICAL FINDING OF THE LÜS.

In considering questions of early origin and of direction of human


intelligence, there is no point of more importance to bear in mind
than the allowance of long periods for the operation of the process
we are now accustomed to call evolution. When we have traced
history to its utmost verge in the dim past, the civilization we come
then in contact with, in those very ancient days gives evidence of
many centuries—aye, even many tens of centuries—having been
necessary for that growth of adaptations recognised as the outcome
of human intelligence and industry in such communities. So, when I
speak of origin, I am thinking of a time when systems were not; of
conditions when devices were more the result of spontaneous
impulse than deliberate invention.
China, certainly of all existing empires the most ancient, has records
which extend almost unbroken back to a period of 2400 b.c., and
then beyond that lies the haze of a remote past, where the light of
tradition breaks through with no uncertain radiance, revealing points
of distance far, far, away, telling of another 2000 years of the still
immeasurable past of the “black-haired people” who settled along
the banks of the Great Yellow River, and whose descendants in
succeeding centuries spread over the valley of the still greater Yang-
tse River, and pushing southward appropriated territory after
territory, and who to-day outnumber every other nation on the face
of the earth. A strange destiny! to increase, yet not to progress.
Many little digressions into the history and customs of the Chinese
seem inevitable in attempting an enquiry into the origin and nature
of the musical instruments and music of this singular people.
Of Chinese musical instruments none that are ancient exist, and yet
the new are still the old, for so far as can be ascertained there has
been no essential difference during the thousands of years of
civilized life that they have been in national use, and in the authentic
records which refer to them, they are described as already old, in
periods that are mythical; the whole family of instruments seem to
have been born at one date, without any order of precedence. The
Chinese have no modern music. The music in use is only their
earliest music reappearing from day to day in immemorial custom,
and it is to them a completely satisfying survival.
Their system of music is the oldest system that has been placed on
record, and for this reason alone it has a special interest.
In the chapters “At the Gates of the Past,” and “In the land of myth”
I expressed very clearly the views at which I had arrived concerning
the music of the Chinese and its affiliation to the music of the
Greeks, stating my belief that in a far distant past both races were in
contact with one source, and then came a day of disruption,—one
race eastward, one race westward, each pursuing its own pathway.
These two races to us have been known as Egyptians and Chinese.
Greece deriving from Egypt, I traced the way therefrom across
Arabia to the southern part of the great valley of the Euphrates,
called Mesopotamia, Chaldæa, Elam, and further, to the Iranian
mountains.
In justification of these views, some considerations should here be
advanced as briefly as may be, and although details may have the
aspect of being antiquarian, I anticipate that they will help the
general readers to the better understanding of the place of music in
Chinese history, and in the daily life of the people inhabiting the land
modernly known as China.
When I started the enquiry I had no idea where the quest would
lead me. It was only afterwards that, prompted by a wider interest
in the subject, I found that independently, I had come to a
conclusion identical with that of modern research in ethnology,
philology, and archæology. My study of the matter is but a simple
venture over an untrodden course, seeking the earliest sources of
music, and the identity of view of learned authorities may, I think,
fairly be taken as strengthening my own.
A few hints concerning these will answer our purpose.
In that southern valley of the Euphrates, the first people named in
history were the Akkadians and Sumerians, they came down from
the mountains and built cities; the unnamed settlers earlier than
these had occupied the region and were without bond of union
sufficient to give them a name in common, yet it should not be
forgotten that they, too, had a past, remote in time, though
unrecorded as history.
How then do we connect the Chinese with these? The Chinese
constitute one of the numerous branches of the Mongolian race.
Historians state that the ancient empire of Medea was founded by
Mongols. When the first immigrants of this race entered China
colonising the fertile valley of the Yellow River, they brought with
them evidences of a civilization which it must have taken many,
many centuries to have arrived at. Agriculture they were proficient
in; astronomy they possess records of, that point to events
thousands of years earlier; masonry, and canalization also, in well-
developed systems immediately applicable to their new
surroundings; and my argument is that they brought also a primitive
system of music arising from or out of a simple pipe adoption,
having a series of four or five sounds, such as we have found to be
the original basis of Egyptian and Greek music. Ancestor worship
they also brought with them. A formulated religion they had not,
neither had they a priesthood.
Where can be found a common centre, where a population had
existed in prehistoric times, at which these chief evidences of
civilization had been grouped together in communal or in civic life?
Research can shew but one—and that, the southern valley of the
Euphrates.
In his work, “Primitive Civilizations,” Mr. E. J. Simcox writes:—

“That the Chinese themselves did not learn agriculture in China is beyond a doubt;
the family life of the Chinese does not go back to a time when the black-haired
people were not agricultural.”

again as to Astronomy:—
“The astronomical knowledge of the Chinese was almost certainly derived from
their kinsmen in Mesopotamia.”

Dr. Edkins was struck by the many ancient customs pointing to a


connection between Western Asia and China, he calls attention to:—
“the resemblances between Chinese writing and the pre-cuneiform or linear
Akkadian character; ’a deep relationship undoubtedly between the vocabulary of
the two languages.’”

Both the Revs. C. J. Ball and M. de Lacouperie agree:—


“in regarding Chinese as a representative of a much earlier stage of Turano-Sythic
speech than any other living language and as still including elements going back
to some source common to it, with the founders of Elamo-Babylonian civilization.”
Mr. Simcox states that the Akkad religion:—
“was purely naturalistic, it consisted in the recognition of a ‘Spirit of Heaven,’ and a
‘Spirit of Earth,’ but these spirits were not worshipped but ‘conjured’; hence
charms were older than litanies.”
and as to ancestor worship Mr. Simcox says:—
“it was the first branch of the Egyptian religion to become associated with
proprietary ideas, which also constitutes the leading feature of the Chinese
religion, the worship of the spirits or manes of deceased ancestors.”
On these points we shall notice that much that differentiates the two
peoples will tend to show that the Chinese broke away from the
Euphrates earlier than the Egyptian kindred, before indeed the
anthropomorphic religious ideas became superimposed upon the
naturalistic. This is an important index to the distance in time when
the migration eastward began. Imagine that vast valley peopled as
Berosus the old Babylonian historian states,—“There was originally in
the land of Babylon a multitude of men of foreign race who had
settled in Chaldea.” These people consisted of numerous tribes,
previously dwellers in the forests in the highland range eastwardly
bounding the valley, and through long centuries they had multiplied
exceedingly; to be called in after time by several distinguishing
names. In this early period they were all Akkads from the northern
mountains, and Sumerians from the southern range as these names
originally imply. Presumably, these people would sort themselves into
kindreds, so that when the pressure from increase of population
caused them to swarm, they went off in bodies all of the same type.
The Red type we may call Egyptians, the Yellow type, or black-haired
we call Chinese, the great remaining bulk of dwellers on the soil
became the people called Chaldeans, Babylonians, Assyrians and
other names. How long ago was it when “the black-haired people”
swarmed off? The Chinese chronologers go back 43,000 years b.c.
for the earliest tidings of their race, and no doubt their records are
but dim traditions, not of China, but of this their primitive home by
the Tigris and the Euphrates. Their astronomical calculations are
shewn not correct for the land of China but must be referred to the
land of Medea and of Southern Asia. The black-haired people took
with them a knowledge which was common with all the tribes
around them in that valley; their religion, the Sumerian, “the Spirit of
Heaven,” “the Spirit of Earth,” nothing more, no gods or goddesses,
agriculture and canalization they learnt there, and the building of
dwellings of the reed-thatched type from which they have not
departed, and the worship of ancestors common to that early world
remains with the Chinese in its most primitive stage, as a
traditionary usage almost instinctively connected with the family
claims, as a posthumous honouring, not as a feeling of religion. The
polytheistic ideas developed later with the other tribes had not then
arisen, consequently we find the Chinese settled in their new home
with only simple, vague notions of “Spirits” good and harmful, and
being a people singularly wanting in imagination, they present still,
notwithstanding their long history, an aspect, as a nation, of archaic
survival.
These considerations help us to understand how it is that in their
music they have shewn so little growth. They drew from the same
musical roots as other nations yet remain stunted; socially and
intellectually the Chinaman of to-day is the same as the man who
was obedient to the rule of Yao, and Hwang-ti, and when the latter
formulated the rules that were held to govern the music, the
Chinese were content that for ever after music was fixed; they
appear to delight in keeping things in a dwarfed state as they take a
pride in dwarfed trees, and we of the Western world find it so
difficult to understand them, but we still go on trying.
In these hints I think you will find fair justification for my belief in
the very remote antiquity of a musical scale, a set sequence of
sounds by choice adopted, it may be of four or five sounds, common
in its rudimentary stage amongst all the tribes aggregated in
Southern Asia, where we have for many scientific reasons a
conviction that civilization originated.
The great migrations of peoples were caused by famines, plagues,
inundations, overcrowding of population, but apart from these the
instinctive desire of man to better himself in place and position and
possessions was an ever inciting force.
An old Akkadian hymn, perhaps the oldest piece of writing in the
world, commences,
“Mankind is born to wander,”

a simple sentence—a premonition of all history. Imagine, if you can,


the ages of civilized life necessary to bring the human brain to a
conception so philosophic and true as this. Earth is old now. Earth
was very old then.

The Chinese affirm that the Emperor Hwang Ti, the Yellow Emperor,
invented the scale of twelve semitones, called the twelve lüs, and
according to the record of date this was 4590 years ago. The pitch
of the notes of all ancient systems was described by lineal
measurements; hence every interval accepted was either the excess
or defect resulting from the division of a greater measure, the
octave, or the fourth. In some way or other the derived proportions
have been grateful to human ears, perhaps because they denote
absence of conflict, or presence of symmetry.
The discovery by the Yellow Emperor as narrated reads somewhat
fabulous. It is stated that he sent his minister Ling Lun to the valley
west of the Kuênlun mountains, where bamboos of regular thickness
grow; that Ling Lun cut the piece of bamboo which is between the
knots, and the sound emitted by this tube when blown across he
considered the bass or tonic; that is our way of naming, not his. The
length was equal to one Chinese foot. He then cut a second pipe two
thirds of the length of the first, which gave a sound a fifth higher,
and continued similar relations from pipe to pipe, and so on, he
completed the series of twelve sounds according to the idea of his
master, and for evermore fixed the musical scale handed down from
generation to generation through thousands of years.
I have shown that Amiot misled us in assigning it to the Sheng, and
I expect he has given currency to other errors. What I do note, and
have assigned the cause for in the argument of the previous chapter,
is the peculiar crowding of the scale with intervals less than a
semitone between f and a; and perhaps this crowding has helped
towards inducing the belief, without question, that the semitonal
scale was intended, but that the making of the instrument was not
done with due exactness, or that the instrument was out of order if
it did not bear out the theory of an equal tempered semitonal
succession through an octave. The theoretical existence of such a
scale is not here called in question: my contention is that the ancient
instruments give no confirmation of having been planned in view of
such a principle. Stranger still, the very scheme to which the learned
writers refer as the basis of the principle, and carefully guarded by
them as an authentic ancient treasure, gives a complete denial to
the whole assumption. I take their own statements, the evidence of
their own authorities, and wonder, when I examine the twelve lüs,
why they never examined them, why from curiosity alone they
sought no corroboration of their statements from the lüs themselves.
In Van Aalst’s book the scheme is fully set out in diagram, the twelve
lüs figured, and all the curious details inserted of the moons and the
hours to which each pipe belongs by some mystical relation which
the Chinese mind perceives; the pipes are arranged in the order in
which they bear to the longest one, which is the prime genitor. Also
there is another diagram, elaborately designed to display the
affinities in a circle, having twelve compartments springing from a
common centre; the kung or fundamental sound being placed as the
hub of a wheel with the other sounds rayed round, each sound
being named. The diagram of pipes shows how the lüs generate one
another, whereas the circle or wheel diagram gives the notes as they
follow in a series. I think that I remember seeing these diagrams in
Amiot’s sixth volume. Very likely Van Aalst has taken them from the
same source. Again, he says, “The lüs are a series of bamboo tubes,
the longest of which measures nine inches, and which are supposed
to render the twelve chromatic semitones of the octave.” It appears
to me that the great source of misunderstanding has been in the
European persistence in regarding “the twelve lüs” as meaning
“twelve semitones”: whereas the Chinese name lüs means laws or
principles.
I have examined these pipes by measures and do not find them in
any way corroborating the semitonal relation; and simply taking the
names accorded to the lüs and set forth in these diagrams, if we
arrange the notes in successive order, neither do they bear out the
scale claimed for them. Let us see: this is how they stand. Twelve
semitones forsooth!
♯ ♯ ♯ ♯ ♯
a— d — e — f ‿ g ‿ g ‿ a ‿ a ‿ b — c — d — f

Thus the development of the scale shows only a central crowding of


semitones, and not even an octave relation, plainly indicating an
ancient growth through the tetrachord. The diagram showing how
the lüs generate one another states that the longest pipe is nine
inches; yet in the letterpress Van Aalst says that
The first tube was one foot in length in reality, but that the foot was considered as
being only nine inches, because nine is perfectly divisible by three, whereas ten is
not.
And further, that
The twelve lüs were used by the Chinese merely to regulate the instruments and
give a uniform pitch to the music. The diameter of all the tubes must be the same.
Mêne K’ang says that the circumference of all the tubes diminishes according to
their length; but this is explicitly contradicted by Tas’i Tzü, who quotes Chêng
K’ang-chêng and Ts’ai Yung (two great wine bibbers and famous writers on
music), and he flatly declares that Mêne K’ang and his adherents know nothing
about music. The tubes were all of the same thickness, circumference and
diameter; only the length varied according to the sounds.
And so on, which shows how almost European the Chinese are in
their humanity.
I have quoted largely from J. A. Van Aalst’s “Chinese Music” to which
I am much indebted. The author is learned in the ways and in the
literature of the Chinese, being himself in the Chinese Imperial
Customs Service, and his work is published by order of the Inspector
General of Customs, Shanghai.
The first tube in the diagram bears this inscription:—
Huang-Chung, or yellow bell, corresponds to the eleventh moon and the eleventh
hour, emits the sound kung (modernly called yo), is a yang-lü, was the first tube
cut, and served as genitor to all the others. It measured one Chinese foot long,
and contained exactly twelve hundred grains of millet. Two thirds of its length
form the next tube. Lin-Chung, or forest bell, gives a note a fifth higher, etc.

Description follows, in the same style of quaint symbolism, upon


each of the twelve. At the third pipe, however, which it says ought to
be two-thirds of the preceding length, a change comes, which it is
important to notice,—viz., “that the sound would be too high
compared with kung, and so the tube is to be doubled, and four
thirds taken instead of two thirds.” This virtually introduces the three
fourths relation, the fourth instead of the fifth; and in the remainder
of the pipes some are calculated some way, and some the other.
There is no twelve fifth scheme carried out as supposed.
Pursuing the investigation, I cut slips on the system laid down, and
found that the lengths and the pitches did not agree; and I also tried
working out the Sheng on a basis of fifths instead of fourths, of the
relation 2/3 instead of 3/4, and found that the result did not
correspond with the speaking lengths of the Sheng pipes.
The tale told of the twelve lüs bears every evidence of being an
invention; and I fancy that the fable originated in a scholastic
endeavour to account for the existence of the perfected instrument
the Sheng, so old that none knew how it came into being. The
twelve lüs comprised a scale of an octave and a fourth, and the
scale of the Sheng is also an octave and a fourth in compass; but
neither constituted a semitonal scale, which was an idea of much
later date. So also the making of a scale out of a succession of
twelve fifths was a notion of the pedants, the men learned in book
knowledge, and they fixed upon Ling Lun the credit of cutting each
pipe by a succession of two-third lengths, on the principle of the
fifth.
The question has been raised whether the pipes were open or
stopped, and the authorities say they were stopped, and they make
their drawings of the pipes corroborate their view, but if so, what
becomes of the affirmation that Ling Lun cut the bamboos between
the knots unless to secure an open tube?
Although I may seem to have been wandering from the track, I have
not lost sight of the central point to which my cogitations tend. I
wished to impress the evidence of evolution in the appropriation of
bamboo pipes for musical purposes, in the use of such bamboos in
the earliest periods, all of similar diameters, and to show that
variation in the diameters was an after development, even as was
the use of metal pipes instead of the natural growth of bamboo or
reed.
If you have read the first part of this volume you will have
understood that I take the view that the earliest musical notions of
man in his primitive state were derived from the industry of his
fingers, and the relations of a musical scale had the same basis,
becoming afterwards hereditary. The Chinese foot is equal to a
hand-span of a ruler or emperor, and has ten divisions equal each to
a thumb’s breadth. The standard pipe is 9-7/8in. of our measure.
Taking a pipe that length and halving it, or taking one half that
length, the notes obtained are what we call tonic and its octave; but
being of the same diameter the octave will be flat. This we find to be
a peculiarity in Chinese music. Taking a pipe three quarters the
length of the whole, a note is obtained from it which is a fourth; and
this, the same diameter being kept, will be inevitably a flat fourth;
hence the existence of a flat fourth in the ancient musical
instruments of the Chinese and Japanese. And so everywhere,
unless the diameters have varied as the lengths have varied, the
intervals cannot then have been the exact intervals that we set down
for our musical relations. Yet, strange it is: showing the persistence
of heredity and tradition. The Chinese in later times perfectly well
knew, as I shall show, the relations of the diameters of pipes
according to geometrical laws.
Music with the Chinese, itself as an art so unprogressive, has from
the first taken a unique position in the national life. Dr. Wagener tells
us that the weights and measures that have been in use these 4600
years in the Chinese empire are based upon Lyng-lun’s work in
determining the musical standards of the lüs. The first pipe which he
cut as the foundation of his scale was the longest, and it was found
to contain 1200 grains of millet seed. He chose a sort of millet, the
sorghum rubrum, which is of a dark brown colour, as being harder
and more uniform than the gray and other kinds. One hundred of
these was made by him the unit of weight, and this was divided and
subdivided on a decimal system until a single grain became the
lowest weight of all. The length of this pipe was equal to 81 of these
seeds placed lengthwise; but breadth-wise, it took 100 grains to
make the same length: hence the double division 9 + 9 and 10 + 10
was naturally arrived at. This musical foot thus became the standard
measure with decimal subdivisions. The breadth of a grain of seed
was 1 fen (line), 10 fen = 1 tsun (inch), 10 tsun = 1 che (foot), 10
che = 1 chang, 10 chang = 1 ny. Lyng-lun also fixed the dimensions
of the interior of the pipe at 9 grains breadth. The contents of the
tube proved to be 1200 grains, and the weight of 100 grains was
made by him the unit of weight. The pipe was thus made the basis
of the musical system, and equally so the basis of the system for
lineal measure, dry measure, and weight; ultimately for coinage.
Another interesting fact is that the Chinese had ascertained the
geometrical relation of musical pipes. The problem had been
thoroughly examined by a certain Prince Tsai-Yu (1596). In practical
and scientific hydrodynamics, the relation of the diameters of pipes
to the volume contained was well known; but it appears that, as
applied to sounding pipes, the Prince Tsai-Yu was the first clearly to
record its demonstration. Of two musical pipes of the same diameter,
one two feet long and the other one foot long, the latter does not,
as assumed, give a note the higher octave of the former, for the
note will be flat. Neither if we halve the diameter, even as we halve
the length, will the note prove true. The common practice with us in
organ building is to give the half diameter to the seventeenth pipe;
but this is merely an empirical decision. The prince, without
explaining theoretically why, showed that the proper dimensions
relatively of length and diameter were as follows. Assuming a pipe of
2ft. length to have an interior diameter of 5 lines, then correctly the
pipe of 1ft. length should have a diameter of 3 lines 53 cent., and a
pipe of 6in. length a diameter of 2 lines 50 cent.
Our organ pipe custom is solely a determination of ear, or feeling, as
regards the aggregate of sounds; for we gain in brightness and
fluency by not delaying the acceptance of the half diameter until the
second octave, which geometrically would be its true position,—viz.,
at the twenty-fifth note. Thus, and by holding control in regard to
the amount of wind, and regulating by voicing, we are able to blend
the total accord of sounds in harmony, in the way pleasurable to the
trained ear or cultivated taste, according to the perceptivities of the
Western peoples.
CHAPTER XV.

In the Flowery Kingdom.

THE BIRD’S NEST.

Music by inspiration. Yes, that is it,—the very thing we want, what


we are all longing for; so little of the truly inspired music comes
newly to refresh us as the birth of the days we live in. Only the old
seems the ever new. How inspiring it is to listen to the themes of the
old masters, and feel the old melodies pass through us like a current
of life, awakening thrills of delight, the memory of the first hearing
of them blending with and enhancing the emotions of the present.
To inspire, “to drink in.” How we drink in the life renewing melodies
of Beethoven and Schubert: their potency never fails, and in our
exultation we call them divine. How strangely inevitable are the
ideas we associate with the words “divine” and “inspiration.” Apply
them as we will to frail human effluences, there is no escape from
the higher exalted sense, from the ideal signification. Inspiration,—it
is a grand word. Somehow the ideal clings around words, in however
“matter o’ fact” way they come to be used; like the eastern vase that
has been filled with roses, in after time
“The scent of the roses will cling round it still.”

One thought leads to another thought. I have a little instrument


before me, dignified by the name “organ,”—a very little organ, but
the name comes to it because it is one of the earliest of the race
from which our present day organ has sprung. Was its inventor a
genius? A poor human nomad wandering the wilds of Tartary,
inspired to begin the foundations of that which was to be an empire
of sound,—one of those
“Who builded better than he knew,”
Was he inspired, I wonder? True it is that the invention has been
claimed for some emperor, but that is so natural an appropriation
that we give no heed to it. Certainly it is the unknown man who is
the true great man, though history has obliterated his name and
graven a royal cartouche in its place. The mythical is always later
than the real.
This curious instrument: what a juggle of words it has led me to.
The inspiration I have to talk of is done by inspiring,—its music is
made as the lark’s music is, by inspirating. Note you how the bird
sings by drawing in breath, by inspiring; and higher and higher he
mounts, filling the air with melody for a half mile around him;
soaring, singing and singing as he soars, never tiring for the hour
together, because every effort invigorates the little body instead of
exhausting its strength; he drinks in oxygen at every note, and so is
refreshed by singing. Would that human singing were equally
refreshing to the singer and the hearer!
The
Chinese
Sheng.
(Quarter
Size.)
Fig. 28.

The Sheng was formerly called the “bird’s nest,” and the peculiar
arrangement of its pipes—the longest of which pipes exceed
considerably the real sounding length—is held by the Chinese to
represent the tail of the phœnix as she sits upon her nest; indeed,
unless we accept the symbolism, the method shown in the
construction is unaccountable.
According to the Chinese there are eight sound giving bodies
corresponding to the eight symbols of Fu Hsi, which they believe are
the expression of all the changes and permutations which take place
in the universe. These eight are stone, metal, silk, bamboo, wood,
skin, gourd, clay, with symbolic relations to the eight points of the
compass and the eight seasons of the year. The Sheng is the
representative of the gourd principle. Originally the bowl was formed
of a portion of a gourd or calabash, although in later times made of
wood and lacquered. This gourd is in shape like a teacup, the top of
which is covered by the insertion of a circle of wood, having a series
of holes around the margin, into which the pipes are fixed; then
there is a neck or mouthpiece shielded by an ivory plate, through
which the performer draws the wind. My instrument is an old one,
has been in this country eighty years or more; and as it has been
here photographed to a scale of one fourth, all the proportions are
preserved in the engraving. The instrument is placed to the mouth
with the pipes slanting to the right shoulder, the right hand
forefinger being placed within the opening seen in the circle of
pipes, and the thumb so placed as to be ready to cover the hole
seen on the second pipe, counting to the left from this opening. The
bowl is held in the hollow of the left hand, with the fingers reaching
upwards to the pipes.
A noticeable feature is that it is the left hand that fingers the
instrument, indicating a very early custom, in that respect. The pipe
engraved here is of full size, and shows the little metal free reed
affixed, which also is drawn at the side full size in its frame. The slot
determining the speaking length of the pipe is at the back, and is
here indicated at the proper position by the side diagram, the length
of pipe above the slot having no particular relation except an
average one of about the same length as the bottom portion
reckoned from the lowest end of the cut. The pipes numbers 3 and 4
have their holes at the inside or back of the pipes in a position to be
covered by the forefinger of the right hand.

Diagram of the
Length of Slot at the Back.

The Reed (Full Size.)

Fig. 29.

A Pipe of the Sheng (Full Size.)

The little free reed is of copper, is of very delicate workmanship, the


tongue is about half an inch long having its tip slightly loaded with
beeswax, and the corners rounded off, thus leaving passage way for
the air, otherwise the tongue would not be set in vibration, since the
reed tongue is quite level with its frame, a condition in which
modern reeds would not speak. It is a peculiarity worth noticing.
Another strange contrivance is that the hole which we see on each
pipe a short distance above the cup, is designed to prevent the pipe
from speaking; is not the opening for the sound of the note as in
other pipes is the usual purpose; although the air drawn in comes
simultaneously through all the pipes, not a single pipe will sound
that has not the side hole covered by a finger. The position of the
hole has no relation to nodal distance, it effects its purpose by
breaking up the air column when it is open, and so prevents the pipe
from furnishing a reciprocating relation to the pitch of the reed. Over
these holes the four fingers play in the order the music requires.
The Sheng is considered to be one of the most important of the
Chinese musical instruments; no other is so perfect either for
sweetness or delicacy of construction. It is indispensable in the ritual
music of their temples.
At the Confucian ceremonies there are six Sheng, three on the east
and three on the west side of the hall. They play exactly the same
music as the ti-tza or flute, yet they are not used in the popular
orchestras. At nuptial and funeral processions the Sheng is played,
but it is then merely for form’s sake, in accordance with the
requirements of the rites, and the hired coolie who carries it simply
simulates playing.
One rarely hears the Sheng now-a-days, on account, some say, of a
curious superstition that a skilful performer becomes so wedded to
its music, that he is ever playing, and that, as the instrument is
played by suction or drawing in of the breath, a long continuance in
practice brings on inflammation of the lungs; so no performer is
believed to live more than forty years! Others however, and these
are the philosophers, maintain that the ancient music and the
ancient methods of playing are lost, and the construction of the
instrument after the ancient plan is a lost art. This one can well
believe of an instrument belonging in its prime to so early a period
of history. Of all the ancient music nothing remains but abstruse
theories. Van Aalst says:—
The Emperor Che Huang-ti b.c. 246 the destroyer of books came. He ordered the
annihilation of all books with the exception of works on medicine, agriculture, and
divination. The decree was obeyed as faithfully as possible by an uneducated
soldiery, who made it a pretext for domiciliary visits, exactions, and pitiless
destruction. Music books and instruments shared the same fate as every object
which could give rise to remembrance of past times; and a long night of ignorance
rested on the country to such an extent that at the rise of the Han dynasty the
great music master Chi, whose ancestors had for generations held the same
dignity, scarcely remembered anything about music but the noise of tinkling bells
and dancers’ drums.
I have possessed four of these little Sheng organs (pronounced
“sung”) and it became to me a fascinating problem how the
instrument originated. I compared one with the other, and where
one was imperfect, the other possessed the notes to perfect the
scale. At that time but little was known of the instrument, for we had
only some flowery accounts given in Chinese history, and one
description of it very fully set out in Père Amiot’s work on the
Chinese, published in Paris, 1780, in six vols. The description is
found in the sixth volume, but I soon discovered that the good
father had but very imperfect means at his command, and that the
scale he gave was not to be relied upon. For my own satisfaction I
was led to make a closer examination of the instrument, and to
glean whatever particulars I could for the better understanding of
the organ and its place in history.
We are accustomed to regard the Chinese as a very conservative
people, unchangeable in modes and customs, and indisposed to vary
in routine after tradition has fixed it. Closer view of their history
shows that this is a mistake, and we have been drawn into it
because the range of their change has been limited; and in their
inventions, numerous and important as they have been, they
nevertheless seem not to have the aptitude to advance them to
higher grade of utility. Their musical scales have been constantly
fixed, and have been as constantly changing. Mr. A. J. Ellis has
shown that at b.c. 1300 the scale had only five notes, that the
invading Mongols introduced an additional scale, that Kublai Khan
a.d. 1259 combined the two, that in the thirteenth century the Ming
dynasty excluded all semitones, that the Tsing dynasty (which has
existed from 1644), reverted to the former scale; and these are
comparatively modern changes. And yet one may say that ages
earlier changes began, and this Sheng has at various periods been
subject to change; at one time it had nineteen pipes, at another
twenty-four pipes, and now has settled down to the form, still very
ancient, which is illustrated here with seventeen pipes, two of these
being dummies—as some modern organ fronts are—and two are
duplicates of others for convenience, leaving therefore eleven
sounding pipes to represent the working scale of the instrument.
For the origin of the Sheng we must go back beyond these periods
of change. Its history begins with a woman, as is proper in tradition,
and the invention is attributed to a female sovereign in the mythical
age known as Nu-wo. Eve is said to have brought “woe” into the
world, but this lady evidently by her name was of later date, ancient
though that date is. She succeeded the Emperor Fu Hsi, who reigned
4745 years ago, and who was the reputed father of music, for the
Chinese are a people who naturally consider that there is no music
of any account besides their own. Then Hwang Ti “the Yellow
Emperor,” follows, and he takes credit for the invention, its a way
men have: this was about one hundred and fifty years after the
death of the lady aforesaid. Then the great Emperor Shun four
centuries later, he lays some claim; but the probability is that these
two emperors regulated the laws, which till then had not been
formulated into fixed rule. Indeed each emperor had his own
system, and did not agree with his predecessor’s systems. There can
be no doubt that the Sheng is of great antiquity; it is often
mentioned in the great poetical books of the Chinese, the She and
the Shoo-king, and the commentators on ancient musical
instruments invariably mention the great age of the Sheng, and
seem to delight in speaking of it as evidence of the inventive genius
and musical talent of the Chinese.
In my desire to place you abreast with the Chinese knowledge of the
art of music, I give you this beautiful elucidation from the treatise of
J. A. van Aalst:—
According to the Chinese ideas, music rests on two fundamental principles,—the
shên-li, or spiritual immaterial principle; and the ch’i-shu, or substantial form. All
natural productions are represented by unity; all that requires perfecting at the
hands of man is classed under the generic term, wan, plurality. Unity is above, it is
heaven; plurality is below, it is earth. The immaterial principle is above,—that is, it
is inherent in natural bodies, and is considered their pên, basis, origin. The
material principle is below; it is the hsing, form or figure of the shên-li. The form is
limited to its proper shape by shu, number, and it is subjected to the rule of the
shên-li. Therefore, when the material principle of music—that is, the instruments—
is clearly and rightly illustrated, the corresponding spiritual principle—that is, the
essence, the sounds of music—becomes perfectly manifest and the State’s affairs
are successfully conducted.
You will now be able thoroughly to understand something of the
Chinese systems of music, and their rigidly scholastic basis; and
should you think that the explanation that you have read requires to
be supplemented by explication, I may say that the authorities at the
British Museum have now shelved for public use in the King’s Library
the five thousand and twenty volumes of the Chinese Encyclopædia,
to which I refer you.
This is said to be the only complete copy known in Europe of a work
commenced how many centuries ago I forget; and as the Chinese
had at hand four hundred and eighty-two learned treatises on music,
no doubt the subject is exhaustively drawn out, and will repay your
search in the various sections and sub-sections. It is said that in
2277 b.c. there were twenty-two authors on dance and music,
twenty-three on ancient music, twenty-four on the playing of the kin
and the chi, twenty-four on solemn occasions, and twenty-six on
scale construction. The sages alone comprehend the canons, and
the mandarins of music are considered superior to those of
mathematics. The College of Mandarins at Pekin is within the
imperial palace. The head musician in China represents the five
capital virtues,—humanity, justice, politeness, wisdom and rectitude.
How very old these people are! Certainly, we have colleges—a few!
—but for some reason or other we are not sufficiently advanced to
have such a head musician; and, in consequence of lack of such
representation, the profession may possibly be minus some of the
virtues in these ways: which, as the saying goes, accounts for it.
You know that old Confucius wrote about the ancient music in the
Shoo-king, and that was about 551 b.c., or about the time when Ezra
was occupied in collecting the parchments of the laws of Moses. In
the great destruction of books all copies of Confucius disappeared,
but happily one complete copy was found secreted in the wall of the
house that he dwelt in; and that was in 140 b.c., when the house
was pulled down. But you must think of a time far back, far as the
times of the Pharaohs who built the pyramids, a time when the
Chinese were already writing learned works on the music and the
instruments, the existence of which necessarily implied long periods
of early civilization. The earliest Chinese book that we know of is
“The Book of Changes,” 1150 b.c. Ah, and what changes since! All
history is a record of changes.
CHAPTER XVI.
By the Yellow River.

THE EVOLUTION OF THE SHENG.

The Sheng as the parent of organs, the original exemplar of free


reeds, always greatly interested me, and I was desirous of obtaining
a knowledge of its scale and methods; but I found such
contradictory statements, such confusion of different systems of
succeeding times, that the unravelling seemed hopeless. No doubt,
as time went on, certain accommodations were made to conform to
new orders and imperial decrees, and the pedants of the schools
seem to have been chiefly concerned in the demonstration of
doctrines of similitude, and contrasts, and affinities, and mystical
comparisons with all things in heaven and earth, and abstruse
relations with numbers; sometimes one set of teachings gaining
prominence, only to be overturned in favour of the next set that
forced its way into law or custom.
The curious principle of inspiring in order to obtain the action of the
reed, and the still more peculiar characteristic of closing the aperture
at the side before the sound could form itself in the tube, raised a
multitude of questions of origin and purpose, and therefore I set
about the investigation with the idea of working out the evolution of
the Sheng from the evidence, so to speak, of its own skeleton that
to-day is living.
I want to take you back in imagination ages beyond these dates, to
find the man who made this little organ, this little Sheng that to-day
can arrest our attention with absorbing interest. There was some
first dreamer, inventor, originator; some one who played and toyed
with the bamboos that grew beside his path, and thought out this
little thing that was to descend from generation to generation, and
become a household name in huts and palaces and temples. In the
far east the bamboo is everywhere the resource of man for the
supply of his daily needs. With it he hunts and fishes, and builds his
house and ploughs his land; he is as much beholden to it now as in
most primitive days of nomadic life.
There are whole forests of bamboo in China and immense quantities
are floated down the great rivers to the towns and cities; the
province of Shantung is celebrated for the small hard sort, which for
certain uses has a preference. Just as in Greece we alluded to a kind
specially sought for musical purposes. It would, we can understand,
be natural for the early tribes to settle down beside the river; and,
when a plot of land was selected, the house was built with bamboo,
and furnished with domestic articles of bamboo, and the implements
of husbandry and fishing were all made of this wonderful plant. With
the river to give him fish, and the land to yield him crops of millet
and rice, the man was happy. The custom obtains to the present day
to devote some portion of land round the house on which to
cultivate the bamboo. This portion is surrounded by a ditch filled
with water supplied from the river by a tiny canal, and here these
luxuriant grasses grow; for the bamboo is but a gigantic grass, and
the domestic wants find this grove a perpetual storehouse of supply.
Conceive such a picture: the man after his day’s toil sitting beside
this grove, not in lazy ease, but intently engaged upon a heap of
little bamboo sticks, measuring, cutting, comparing, and pondering
over some problem, some scheme upon which his mind is fixed; only
now and then looking upward and catching sight of the grey turtle
doves and their little rose coloured feet clinging to the branch stems
above him. No sound disturbing the great silence of the plain, only
the doves mildly cooing as if in answer to the sounds that come from
his lips in intervals of meditative musing; and the sounds of the bees
in the flowers; and the softer sounds of the flowing of the broad
river in the distance. As the sunshine lights up his good humoured
face, what is the thought that makes it brighten with his smile, and
tells of satisfied attainment? Well may he feel content. He has
perfected an idea; he has laid the foundation of the Sheng. And a
very simple process it is, as I shall show you; for although it
occasioned him serious pondering, once the idea had risen in his
mind, the working out of the scheme was assured.
Some tribes in remote places in the east still have a rude prototype
of the instrument, consisting of a hollow lump of clay with four or
five pipes irregularly stuck in, and beyond that they have not
proceeded; and such may have been the stage at which our ideal
man with an order loving brain set about thinking. Now, truth to tell,
I imagined myself to be this Chinaman, and wondered how, in such
a position as his, and with only his means and his purposes, I should
evolve such an instrument. Curiously enough, as it turned out, I hit
upon the right idea, or as near proof of rightness as imagination
need come to. Until I had worked out the scheme on this primitive
basis, the instrument had been a puzzle to me, and it did not seem
to me that any writer rightly understood it; and even the
descriptions by musical experts were obviously erroneous when
examined without prepossessions of the scholastic kind. The first
instrument that came into my hands was perfect in structure, but
incomplete in reeds, not more than four or five metal tongues
remaining. The pitch of these I ascertained, and the relations
happened to be useful for comparative deductions. It had long been
a creed with me that disease and death are our best teachers; they
cause us to question natural mechanism, injury and disorder, and
make us desire to know relation and purpose in artificial mechanism
also. Thus my poor Sheng incited me to wish to know its structural
meaning, to ask how it came to be what it is.
Music was a pastime ages before it became an art. Religion is earlier
than priesthood. I go therefore to the man who first made this form
of instrument; question why he made it, how he took his first step,
how he came to take his second, how he by process of thinking
formed an instrument for himself and for others to play. His
ancestors, I consider, came from the south, and in the early period
would have used reeds with tongues cut in them after the fashion of
the Arghool; but this man is an artificer, has more civilised ways in
communities of industry, and is influenced by the beginnings of
commerce. China is rich in mines of iron and copper and zinc, and
her people were a deft fingered race, expert in delicate working of
metals, and, at this stage of advance in simple arts the tongues of
reed would be superseded by tongues of metal, thin and elastic, and
free from the disadvantages of swelling by moisture and of the need
of frequent renewals. Hence, in cutting such substitutes by the
minute chisels they are so clever in using, the tongue or reed would
naturally, and without design, turn out to be a free reed. A discovery
having far reaching consequences, albeit long limited to the land of
this peculiar people, due to the special deftness they have in the fine
working of copper; for these reed plates are of little more than paper
thickness. Just three cuts of a thin chisel, and the tongue is formed
in the little brass plate; and the plate is fixed in its place with
beeswax.
Let us imagine our worker to live at this particular period of growth
of a civilised community, when music was scarcely more than a
chirping of birds, or the aimless sounds which arose as rhythmical
ebullition in dancing; when musical art was personal, unformed and
any system of musical sounds as yet unthought of. Such a time there
must have been in the history of every early race. Always, as I
imagine, that the instrument coming, before the system, originates
that liking in the human sentiency which heredity and custom
confirm. The peculiarity of Chinese music corroborates this notion of
mine; for although, so far as we can tell, the structure of musical
ears is the same—yet likings of the ear vary widely with the
difference in race.
One of the first needs of men in relation to one another in
communities is a standard of measure of length, such as a cubit, a
foot, etc. The oldest standard with the Chinese is the thumb’s
breadth, and ten thumbs’ breadths make one Chinese foot; and they
had a measure of millet seed, as we have our three barley corns
making one inch. Our worker then had his measure of the foot, for
that is the standard he sets out with for his longest pipe, from which
all the rest originate. It is 9-7/8in. of our measure; and by the same
custom the longest pipe of the twelve lüs which are mythically
attributed to the Yellow Emperor, is of like length. So the Chinese
foot predetermined the standard both for the reed pipe of bamboo
with a tongue of metal, and for the reed pipe blown across as the
pandean pipe is blown across: which pipe from immemorial days has
remained in the imperial archives, as the unalterable standard of
pitch—unalterable because nature does not alter.
I had a metal organ-pipe made to the precise length and diameter of
this imperial standard, and it proved to be what we call e flat; which,
as I found out, has a significant relation, for our free reed pipe of
this length gives a sound one fourth lower exactly—namely B flat.
And this relation of the fourth dominates everything in the evolution
of music. Our worker found this out; though knowing nothing of the
interval of the fourth, he fixed it by natural evolution,—by measure,
not by music: yet the measure afterwards made the music and the
law of the music. I see him cut reeds as our country boys do from
our grasses and spiers, and split a tongue on the side of one, as his
ancestors had done centuries before, and make a piping-bird sound
from it. He has some knowledge of the working of metals; is an
adept at it; has by socialisation and its wants become an artificer in
brass. The split reed becomes spoilt after frequent use, so he
conceived the thought of making a substitute in metal.
Let us picture him first as taking a bamboo reed, cutting it a foot
long in Chinese length (9-7/8in.), and from this obtaining a note;
then cutting other reeds promiscuously, until at last he is attracted
by one exactly half its length, giving a baby note exactly the same in
seeming as the other, and blending into it. This is what we call the
octave,—a civilized perceptivity not yet dawning on his mind; to him
it is the man’s voice and then the woman’s voice. The higher
repetition of the same sound. He has halved the length and obtained
unwittingly the octave; why not halve the other half between? This
he does, and from the three quarter length of pipe obtains a new
sound, which, sounded with his prime gives a pleasing concord;
thus, he begins to recognise the new fact,—the family relationship.
After this fashion of halving and quartering I imagined that the
Sheng grew and became an instrument; and, placing myself in this
mood of representative thought, I also try and work the thing as he
would have worked it out, and see if I can get coinciding results.
The half and the half again seem to me so natural; the repetition is
so akin to the Chinese tendency. A two thirds is a more artificial
notion, and comes of later discernment. How natural too, it is on
finding more that two pipes inconvenient within the mouth, to seek
the first substitute similar to the mouth in size, such as a little bowl,
a half gourd, or perhaps the same calabash that served him for a
drinking cup. Except the four or five reeds that spoke in my
specimen, I did not know what the notes should be as the scale of
the instrument; I only knew that the scheme as told me by the
writers with authority was wrong, and was also misleading; for the
comparative speaking length of the pipes was at variance with the
assumed musical system, and I could not make head or tail of the
instrument until I resorted to the question of primitive design. Then
everything fell into proper place with unlooked-for significance. So I
took a number of slips of wood (easier to cut than bamboo), and
proceeded to transmigrate myself into a dweller in “far Cathay.”
Adopting the measure of the Chinese foot to start with, I cut a slip
to that length, and then cut one to half of that, and then cut one
between these at the half of the half, and so on by progressive steps
halving and half halving and doubling, and obtained a connected
series of thirteen slips to represent the speaking pipes of my most
mysterious little Sheng. I argued with myself that in some such
simple way our worker would have evolved the instrument; that it
was by no means the outcome of a system of music, but was built
up on a visible relation of proportions; that the eye made it and that
the ear accepted it. Steadied by faith, I drew my bow at a venture,
and, lo and behold!—my arrow went home true, and I was
astonished as one who sees his prophecy fulfilled and wonders how
it came to pass. For when I came to compare and to measure the
actual pipe lengths, they corresponded length for length with the
series I had evolved by my archaic process. I confess that the
situation was bewildering as I gazed upon the evidence before me,
for it seemed too good to be true, and one had a fleeting suspicion
of magic or hallucination of some kind. But no; reason and time only
increased the strength of my conviction that in this process the
Sheng was constructively worked out; indeed, I do not see how by
any other way the peculiar scale of the instrument could have
originated.
Sequence of Evolution of the Pipes of the Sheng.

Remember that at the time of my investigation—now thirty years


ago—I had no means of knowing what the scale should be, and I
had to calculate from the relative lengths of the thirteen slips what
the notes of the speaking pipes would be; and when in after years I
came to possess other specimens of the instrument, I found that all
my conclusions had been correct.
A very impressive result is the discovery that the old Chinese musical
basis was that of the Greeks,—the tetrachord; and the complete
scale of this, one of the most ancient of Chinese instruments,
consists of two conjunct tetrachords and one disjunct tetrachord;
which scale, as I have said, being founded upon a natural law of
progression from or through a connected series of proportional
lengths, exhibits unchanged its record of evolution. For pipes of
certain length give now the same tones and the same actual pitches
as they gave thousands of years ago. They do not change, though
modes and customs, peoples and empires change. How remarkably
suggestive is this taken with the presence of the Pan’s pipes and the
Phœnix, to which your attention was given in a previous chapter, as
pointing to a common origin in some ancient era ere history began.
Helmholtz notes that Olympos (circa b.c. 660-620), who introduced
Asiatic flute music into Greece and adapted it into Greek tastes,
transformed the Greek Doric scale into one of five tones, the old
enharmonic scale,
‿ ‿
b c— — e f— —a
This, he says, seems to indicate that he brought a scale of five tones
with him from Asia. And this same scale you will find in the scale of
the Sheng. I gave all this evidence respecting the scale of the Sheng
more than twenty-five years ago, to Mr. Ellis; but it was a long time
before he could bring himself to believe that Amiot and other leading
writers had given altogether misleading statements. He went and
pored over the big folio volumes of Amiot’s “Mémoires des Chinois”
(1780), utterly confused; and only in later times, when investigating
for his work of marvellous patience, “On the Musical Scales of
Various Nations,” did he see that truly the tetrachord was the basis
of Asiatic music as it was of Greek music.
How was it that Amiot, living with the Chinese, gave a wrong
drawing of the free reed used in the Sheng? How came he to say
with authority that its thirteen pipes were a succession of
semitones? How came he to select f as the tonic of the scale? Engel
falls into the same notion of thirteen pipes giving the same octave of
semitones as ours, but says that the e and b were exceptional notes,
only used occasionally.
Order of the Pipes as they Stand in the Sheng.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like