GithubHelp home page GithubHelp logo

mccarthy-m-g / musicians-compendium Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 4.44 MB

The Musician's Compendium: a book

Home Page: https://musicianscompendium.netlify.com

License: Other

R 60.70% TeX 26.67% CSS 11.51% HTML 1.12%
music music-theory music-composition r bookdown

musicians-compendium's Introduction

musicians-compendium

.github/workflows/build-book.yaml Netlify Status

This is the work-in-progress repository for the book The Musician's Compendium by Michael McCarthy. The Musican's Compendium is a comprehensive educational resource of all things music, covering music theory, performance, recording, and much more. If you would like to support my work on the book you can make a small donation to me.

It is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. However, the musical works in this book are not under this license. Their ownership is retained by their respective copyright owners.

The book is built using bookdown.

musicians-compendium's People

Contributors

mccarthy-m-g avatar

Stargazers

 avatar  avatar

Watchers

 avatar

musicians-compendium's Issues

Display method for in-text accidentals

Displaying sharps, flats, and other music symbols in-text is an important feature for this book. Although I could write sharps with # and flats with b, this is less accurate and attractive than using the ♯ and ♭ music symbols. So far I have found two options for rendering these music symbols in bookdown:

  1. Mathjax.
  2. Unicode, as I'm doing in this post.

Both methods support some of the symbols I need, however, I've encountered problems implementing them (see below). Any help or alternate suggestions would be appreciated.

Mathjax problems

  • Mathjax does not allow me to prepend a music symbol to plain text (e.g., ♭3); a space must exist between the music symbol and the plain text.
    • This code $\flat$3 does not work in the body of my document, it renders like $$3.
    • A workaround for this, following the example code, is to include the 3 within the equation (i.e., $\flat 3$).
    • However, doing this will force me to use Mathjax's renderer for alphanumeric characters and superscripting, which will complicate the writing process. And Mathjax only seems to support the basic Tex font in bookdown, which clashes with the appearance of the HTML version's typeface.
    • It is possible to use a sans-serif font with Mathjax using the following code $\sf 3$, however this doesn't support boldface.

Unicode problems

  • Only the most basic rendering is available; size, boldface, etc., are not available.
  • The symbols only seem to render in HTML versions, not PDFs. This means unicode isn't a viable option unless I use different symbols for the HTML and PDF versions.

Using different renderers for different outputs

I could use different renderers for HTML and PDF if the best solutions are HTML or PDF specific. If I have to go this route there is the musicography package for LaTex I could use (assuming it can be installed in my GitHub actions build; I'd have to figure that out).

Install LilyPond in Github Actions build

LilyPond needs to be installed in order to use tabr's engraving functions. Otherwise the build won't work.

It should be installed during the Github Actions build in the .github/workflows/build-book.yaml file. Something like this should work:

- name: Install LilyPond
        run: |
          brew cask install LilyPond

But it does not work because lilypond is 32-bit, which is now unsupported in OSX Catalina.

Run brew cask install lilypond
==> Downloading http://lilypond.org/downloads/binaries/darwin-x86/lilypond-2.20.0-1.darwin-x86.tar.bz2
##[error]Error: This cask does not run on macOS versions newer than Mojave.
==> Verifying SHA-256 checksum for Cask 'lilypond'.
##[error]Process completed with exit code 1.

Solutions:

  1. wait for 64-bit lilypond (this seems unlikely to happen soon)
  2. do all the tabr and lilypond engraving locally, and embed pictures or lilypond's HTML output instead of using the output of R code chunks
  3. try this https://kylebaldw.in/posts/2019/running-lilypond-on-catalina/ or https://gitlab.com/marnen/lilypond-mac-builder
  4. Use a different OS for the GitHub Actions build (not sure if this will cause problems since I'm using OSX locally)
  5. try the macports version port install lilypond-devel

Create chord charts, scale tables, and other reference materials

One of the main reasons I'm writing this book is to create a user-friendly, open-access resource of useful scales, chords, voicings, rhythms, etc. Although these exist in other places, they are often behind a paywall or are less thorough than they could be. An easy way to help with this book is to populate the resources section with these references.

Some ideas for resource pages include, but are not limited to:

  • scales and modes
  • chords, their inversions, and voicings
  • key signatures
  • EQing for different instruments
  • etc.

Ideally the resource pages will match up with the sections and topics in the book.

If you'd like to start a new resource page, create a new resource-topic.Rmd file (e.g., resource-scales.Rmd) for it in the root directory.

At the moment, some of these will be limited to guitar (e.g., chord voicings) because that is the instrument I have the most expertise with and because r tabr can output chord charts and guitar tablature. tabr has support for other stringed instruments too, so mandolin, banjo, etc. are also on the table. You can learn how to use tabr here.

I'd also like to do piano, but will have to decide how to go about it (sheet music is sufficient for voicings, but a keyboard diagram would be more beginner friendly. I don't think a keyboard diagram R package exists though).

If there end up being instrument-specific resource pages then the resource page files should take the following form: resource-topic-instrument.Rmd.

R package updates mess with output

The GitHub actions runner currently uses the most recent releases of the R packages I'm using to write the book. However, my local machine is using earlier versions as I update infrequently. This leads to discrepancies in output between my computer and the GitHub actions runner. I should decide whether to restrict what package versions can be used by the GitHub actions runner, or whether to update my computer's R packages more frequently.

I noticed this with my most recent push, as now Fig 1.1 in the preface is messed up in the web build.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.