lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I create from my custom drum note to a pitch? (for fransposi


From: Bernard
Subject: Re: How can I create from my custom drum note to a pitch? (for fransposing)
Date: Fri, 01 Apr 2016 09:33:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 01-04-16 00:31, Thomas Morley wrote:

2016-03-31 22:41 GMT+02:00 Bernard <address@hidden>:

Well, let's see whether I understood correctly.

A)
You want to create your own drum-style, with custom-drum-note-names
and a certain appearence when printed.

For the names you did:
           drumPitchNames.dbass      = #'dbass
           etc
Ok, this is fine
Correct.

For the appearence you did
           #(define djembe '(
                   (dbass            default   #f           -2)
           ;; etc
           )
Ok, fine as well
Correct.

Later on you LilyPond to use the above with
           drumStyleTable = #(alist->hash-table djembe)
Also fine, here we're done.
Correct,

B)
Then you want the new stuff to be used in midi.
In general, follow the same route.

Assign pitches to the names:
          midiDrumPitches.dba = ##{ g #}
          etc

Tell Lilypond to use them:
          drumPitchTable = #(alist->hash-table midiDrumPitches
Woh! Thomas, if this would work, it would be really perfect. Simple and accurate.
Lilypond is really powerful. Such an important change could make so easy.


In general you're done now. Below a full example.
Because I don't know all your settings I used random ones. For the
drum-pitches I tried to follow yours, but I'm not always sure about
the octave you may need to change it.

\version "2.19.36"

drumPitchNames.dbass = #'dbass
drumPitchNames.dba = #'dbass
drumPitchNames.do  = #'do
drumPitchNames.ds  = #'ds
drumPitchNames.dbm  = #'dbm
drumPitchNames.dom  = #'dom
drumPitchNames.dsm = #'dsm

#(define djembe
   '(
     (dsm   default  #f  -6)
     (dom   default  #f  -5)
     (dbm   default  #f  -4)
     (ds    default  #f  -3)
     (do    default  #f  -2)
     (dba   default  #f  -1)
     (dbass default  #f  -1)
    ))

midiDrumPitches.dba = g
midiDrumPitches.do =  a
midiDrumPitches.ds =  b
midiDrumPitches.dbm = fis
midiDrumPitches.dom = gis
midiDrumPitches.dsm = ais

one = \drummode { r4 dba4 do ds dbm dom dsm }

\score {
   \new DrumStaff
     \with {
       drumStyleTable = #(alist->hash-table djembe)
       drumPitchTable = #(alist->hash-table midiDrumPitches)
     }
     \one
   \layout {}
   \midi {}
}

Looks good. There is only one voice and used in both layout and midi. In the midi file I can hear the result except the first note. I use LMMS to view and edit the imported midi file. I can not see the second note, after the rest, at all. Also not an octave higher or lower.
In my test all note's where visible, and could be heard, in the midi file.

You used random settings, so I adjusted it to my custom, good looking layout setting. To my surprise this resulted in an empty midi file. So I made an error somehow, but I could not find out where. I disabled the staff instrumentName but this made no difference.


\version "2.18.2"

%{
drumPitchNames.dbass = #'dbass
drumPitchNames.dba = #'dbass
drumPitchNames.do  = #'do
drumPitchNames.ds  = #'ds
drumPitchNames.dbm  = #'dbm
drumPitchNames.dom  = #'dom
drumPitchNames.dsm = #'dsm
%}

drumPitchNames.dbass      = #'dbass
drumPitchNames.dba        = #'dbass  % db seems to be in use
drumPitchNames.dbassmute  = #'dbassmute
drumPitchNames.dbm        = #'dbassmute
drumPitchNames.dbassopen  = #'dbassopen
drumPitchNames.dopen      = #'dopen
drumPitchNames.do         = #'dopen
drumPitchNames.dopenmute  = #'dopenmute
drumPitchNames.dom        = #'dopenmute
drumPitchNames.dopenopen  = #'dopenopen
drumPitchNames.dslap      = #'dslap
drumPitchNames.ds         = #'dslap
drumPitchNames.dslapmute  = #'dslapmute
drumPitchNames.dsm        = #'dslapmute
drumPitchNames.dslapopen  = #'dslapopen


#(define djembe '(
         (dbass            default   #f           -2)
         (dbassmute        default   "stopped"    -2)
         (dbassopen        default   "open"       -2)
         (dopen            default   #f           0)
         (dopenmute        default   "stopped"    0)
         (dopenopen        default   "open"       0)
         (dslap            default   #f           2)
         (dslapmute        default   "stopped"    2)
         (dslapopen        default   "open"       2)
         (sidestick       cross     #f           -4)))


midiDrumPitches.dba = g
midiDrumPitches.do =  a
midiDrumPitches.ds =  b
midiDrumPitches.dbm = fis
midiDrumPitches.dom = gis
midiDrumPitches.dsm = ais

one = \drummode { r4 dba4 do ds dbm dom dsm }

\score {
   \new DrumStaff
    \with {
      \override StaffSymbol.line-count =  #3
      instrumentName = #"Djembe 1"
      drumStyleTable = #(alist->hash-table djembe)
      drumPitchTable = #(alist->hash-table midiDrumPitches)
    }
    \one
  \layout {}
  \midi {}
}

Where did I go wrong?

Thanks a lot of all your effort. I do appreciate also you try to improve documentation so people can solve there problems as much as possible.

With regards,

Bernard





HTH,
   Harm

P.S.
The most difficult part for me was how to tell LilyPond to use the new pitches.
There's a hint in performer-init.ly, but:

git grep "midiDrumPitches"
ly/drumpitch-init.ly:midiDrumPitches =
ly/performer-init.ly:  drumPitchTable = #(alist->hash-table midiDrumPitches)

is not what I'd called "well documented"

Maybe worth a bug report.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]