Python Forum
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Music Notation
#11
You should take a look at lilypond. It has become almost a standard for textual music notation
You can find sheet music all over the web that is written in lilypond format. In addition, there are
some very sophisticated music editors that output lilypond format. Frescobaldi (http://frescobaldi.org/)
is the one that I use. I was good enough at lilypond script at one point that I could write an entire score
in it using emacs and LaTex.

Frescobaldi also has midi input and output. I have used it with my piano, using midi into Frescobaldi. I
had to touch it up some, but not a lot.

My wife and two sons play music, oldest son attended Berkley School of Music but then went on to become
a pharm-D.

My program actually does translaton to lilypond format, and creates an intermediate file. Here's the one that
created the last screen shot:

Output:
\version "2.18.2" #(define (naturalize-pitch p)   (let ((o (ly:pitch-octave p))         (a (* 4 (ly:pitch-alteration p)))         ;; alteration, a, in quarter tone steps,         ;; for historical reasons         (n (ly:pitch-notename p)))     (cond      ((and (> a 1) (or (eq? n 6) (eq? n 2)))       (set! a (- a 2))       (set! n (+ n 1)))      ((and (< a -1) (or (eq? n 0) (eq? n 3)))       (set! a (+ a 2))       (set! n (- n 1))))     (cond      ((> a 2) (set! a (- a 4)) (set! n (+ n 1)))      ((< a -2) (set! a (+ a 4)) (set! n (- n 1))))     (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))     (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7))))     (ly:make-pitch o n (/ a 4)))) #(define (naturalize music)   (let ((es (ly:music-property music 'elements))         (e (ly:music-property music 'element))         (p (ly:music-property music 'pitch)))     (if (pair? es)        (ly:music-set-property!          music 'elements          (map (lambda (x) (naturalize x)) es)))     (if (ly:music? e)        (ly:music-set-property!          music 'element          (naturalize e)))     (if (ly:pitch? p)        (begin          (set! p (naturalize-pitch p))          (ly:music-set-property! music 'pitch p)))     music)) naturalizeMusic = #(define-music-function (parser location m)   (ly:music?)   (naturalize m)) \header {   title = "Major and Minor Scales - Ghana Heptatonic  (alias for Major)"   composer = "Created By McNote ver. 1.0.0" } music = \relative c' { c d e f g a b c \bar "|." } \score {   \relative c' { c \mark "C Ghana Heptatonic" d e f g a b c \bar "|." } } \score {   \relative c' { cis \mark "C# Ghana Heptatonic" dis eis fis gis ais bis cis \bar "|." } } \score {   \relative c' { des \mark "Db Ghana Heptatonic" ees f ges aes bes c des \bar "|." } } \score {   \relative c' { d \mark "D Ghana Heptatonic" e fis g a b cis d \bar "|." } } \score {   \new Staff {     \naturalizeMusic     \transpose c dis {       \mark "D# Ghana Heptatonic - Theoretical Key"       \music     }   }   \layout { \override NonMusicalPaperColumn.page-break-permission = ##f } } \score {   \relative c' { ees \mark "Eb Ghana Heptatonic" f g aes bes c d ees \bar "|." } } \score {   \relative c' { e \mark "E Ghana Heptatonic" fis gis a b cis dis e \bar "|." } } \score {   \new Staff {     \naturalizeMusic     \transpose c eis {       \mark "E# Ghana Heptatonic - Theoretical Key"       \music     }   }   \layout { \override NonMusicalPaperColumn.page-break-permission = ##f } } \score {   \new Staff {     \naturalizeMusic     \transpose c fes {       \mark "Fb Ghana Heptatonic - Theoretical Key"       \music     }   }   \layout { \override NonMusicalPaperColumn.page-break-permission = ##f } } \score {   \relative c' { f \mark "F Ghana Heptatonic" g a bes c d e f \bar "|." } } \score {   \relative c' { fis \mark "F# Ghana Heptatonic" gis ais b cis dis eis fis \bar "|." } } \score {   \relative c' { ges \mark "Gb Ghana Heptatonic" aes bes ces des ees f ges \bar "|." } } \score {   \relative c' { g \mark "G Ghana Heptatonic" a b c d e fis g \bar "|." } } \score {   \new Staff {     \naturalizeMusic     \transpose c gis {       \mark "G# Ghana Heptatonic - Theoretical Key"       \music     }   }   \layout { \override NonMusicalPaperColumn.page-break-permission = ##f } } \score {   \relative c' { aes \mark "Ab Ghana Heptatonic" bes c des ees f g aes \bar "|." } } \score {   \relative c' { a \mark "A Ghana Heptatonic" b cis d e fis gis a \bar "|." } } \score {   \new Staff {     \naturalizeMusic     \transpose c ais {       \mark "A# Ghana Heptatonic - Theoretical Key"       \music     }   }   \layout { \override NonMusicalPaperColumn.page-break-permission = ##f } } \score {   \relative c' { bes \mark "Bb Ghana Heptatonic" c d ees f g a bes \bar "|." } } \score {   \relative c' { b \mark "B Ghana Heptatonic" cis dis e fis gis ais b \bar "|." } } \score {   \new Staff {     \naturalizeMusic     \transpose c bis {       \mark "B# Ghana Heptatonic - Theoretical Key"       \music     }   }   \layout { \override NonMusicalPaperColumn.page-break-permission = ##f } } \score {   \relative c' { ces \mark "Cb Ghana Heptatonic" des ees fes ges aes bes ces \bar "|." } }

I've decided to put the code on Github tomorrow. It will be a work in
progress because as I stated before, the code is crude and developed
as I want along and was learning python.

Perhaps it will be liked enough that others will halp to bring it up to par.
Reply


Messages In This Thread
Music Notation - by Larz60+ - Feb-21-2017, 11:22 AM
RE: Music Notation - by metulburr - Feb-21-2017, 01:13 PM
RE: Music Notation - by Larz60+ - Feb-21-2017, 01:28 PM
RE: Music Notation - by Skaperen - Mar-05-2017, 04:05 AM
RE: Music Notation - by Larz60+ - Mar-05-2017, 07:09 AM
RE: Music Notation - by Skaperen - Mar-06-2017, 06:47 AM
RE: Music Notation - by Larz60+ - Mar-06-2017, 04:01 PM
RE: Music Notation - by Larz60+ - Mar-06-2017, 09:02 PM
RE: Music Notation - by j.crater - Mar-07-2017, 06:15 AM
RE: Music Notation - by Skaperen - Mar-07-2017, 07:09 AM
RE: Music Notation - by Larz60+ - Mar-07-2017, 07:56 AM
RE: Music Notation - by Larz60+ - Mar-07-2017, 07:44 PM
RE: Music Notation - by Larz60+ - Mar-07-2017, 10:00 PM
RE: Music Notation - by Skaperen - Mar-08-2017, 02:37 AM
RE: Music Notation - by Larz60+ - Mar-09-2017, 12:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Video Rendering math notation with ASCIIMath within Nodezator KennedyRichard 0 1,238 Sep-18-2023, 03:58 PM
Last Post: KennedyRichard

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020