[frogs] Fw: Fw: Pentatonic Diatonic Transposition? |
[ Thread Index | Date Index | More lilynet.net/frogs Archives ]
CarlMike Ellis sent me his modal transpose code, now extended to include a couple of other functions. See his note below and tarball attached. I placed modal-transform.scm in /scm and added the three functions in modal-transform-init.ly to ly/music-functions-init.ly, both in my Windows Lily GUB release, and tried compiling his regression test. I get the error:
unbound variable: make-modal-transposer This is a public function defined in modal-transform.scm.Just to be sure I fired up Ubuntu, make the same changes to git and rebuilt LilyPond. As expected, I get the same error.
What am I missing? Trevor----- Original Message ----- From: "Michael Ellis" <michael.f.ellis@xxxxxxxxx>
To: "Trevor Daniels" <t.daniels@xxxxxxxxxxx> Sent: Thursday, January 27, 2011 8:02 PM Subject: Re: Fw: Pentatonic Diatonic Transposition? Hi Trevor, It took longer than I thought to get back to this. Sorry for thedelay. I think everything is now cleaned up property. Along the way,
I realized it would be very easy to make it a minimally completecomposer's toolkit by adding inversion and retrograde functions. Hope
that's ok, I'll be happy to take them out if not. Tarball attached containing the following: -rw-r--r-- 1 mellis staff 1081 Jan 27 14:23 modal-transpose-init.ly-rw-r--r-- 1 mellis staff 567 Jan 27 14:28 modal-transpose-regression.ly -rw-r--r-- 1 mellis staff 393 Jan 27 14:31 modal-transpose-regression.midi -rw-r--r-- 1 mellis staff 28995 Jan 27 14:59 modal-transpose-regression.pdf
-rw-r--r-- 1 mellis staff 8051 Jan 27 14:23 modal-transpose.scm ---------- modal-transpose-init.ly has three music function definitions for pasting into music-function-init.ly. \modalTranspose root-pitch new-pitch scale \modalInversion pivot-pitch scale \retrograde music ----------- modal-transpose.scm now has the correct indentation and the display calls have been removed per Carl's request. Four public functions are defined: (define-public (change-pitches music converter) ;; Recurse through music, applying converter to pitches. ;; Converter is typically a transposer or an inverter as ;; defined above in this module, but may be user-defined. ;; The converter function must take a single pitch as its ;; argument and return a new pitch. These are LilyPond ;; scheme pitches, e.g. (ly:make-pitch 0 2 0) (define-public (make-modal-transposer root-pitch new-root scale) ;;wrapper function for transposer-factory. (define-public (make-modal-inverter pivot-pitch scale) ;;wrapper function for inverter-factory (define-public (retrograde-music music) ;; Copied from LSR #105 and renamed. ;; Returns music in retrograde (reversed) order. Included ;; here to allow this module to provide a complete set of ;; common formal operations on motives, i.e transposition, ;; inversion and retrograding. ------------ modal-transpose-reqression.ly is the simplified regression test. Itdefines a one-measure octatonic motive, then transposes, retrogrades,
and inverts it in succeeding measures. ------------ The pdf and midi files are for your reference to show what the regression should produce.Thanks again for your encouragement. I really appreciate it! Let me
know if you have questions while documenting it. Cheers, MikeOn Mon, Jan 24, 2011 at 11:21 AM, Trevor Daniels <t.daniels@xxxxxxxxxxx> wrote:
OK, great! I'll look forward to it. Trevor----- Original Message ----- From: "Michael Ellis" <michael.f.ellis@xxxxxxxxx>To: "Trevor Daniels" <t.daniels@xxxxxxxxxxx> Sent: Monday, January 24, 2011 1:37 PM Subject: Re: Fw: Pentatonic Diatonic Transposition?Thanks, Trevor. I feel honored! I'll study the style guidelines and apply Carl's suggestions. If this is going into the distro, I'll also want to run it through some better tests to make sure it's solid and at least tolerably efficient on larger samples of music. It may be afew days before I send a new version -- I've been neglecting someother responsibilities while trying to get up to speed with Scheme :-) Thanks also for offering to do the doc work and uploading. I gladlyaccept! Cheers, MikeOn Mon, Jan 24, 2011 at 4:02 AM, Trevor Daniels <t.daniels@xxxxxxxxxxx> wrote:Mike I posted your code on the Lily -dev list and received this reply. We'd like to include it in the Lily distribution. I'm happy to do the doc work and the uploading - would you be prepared to tidy up your code as suggested below? Scheme indentation should follow the style guidelines at http://community.schemewiki.org/?scheme-style Trevor----- Original Message ----- From: "Carl Sorensen" <c_sorensen@xxxxxxx> To: "Trevor Daniels" <t.daniels@xxxxxxxxxxx>; "LilyPond-Devel list"<lilypond-devel@xxxxxxx> Sent: Monday, January 24, 2011 2:08 AM Subject: Re: Pentatonic Diatonic Transposition?On 1/23/11 4:03 AM, "Trevor Daniels" <t.daniels@xxxxxxxxxxx> wrote:The code below seems to satisfy a request seen several times on -user. Assuming the code is good I'd prefer to see this added to the LP distribution rather than the LSR. What do you think?Looks reasonable to me.The code needs to be put in a .scm file (scm/modal-transpose.scm), and themusic function needs to go to ly/music-functions-init.ly. The publically-accessible functions need to be define-public. The indentation isn't right.I think the errors should be turned into warnings. If the transposer pitches aren't valid, the transposer should just return the argument to be transposed without transposition. We shouldn't abort when we have thechance to continue gracefully but with a warning.make-extended-scale has a display-scheme-music call that I think should beeliminated. We need a shortened version of the demo for a regression test. And we need a doc-section written.But the code generally looks good to me. I think we should get it added.Thanks, Carl
Attachment:
modal-transpose.tar.gz
Description: GNU Zip compressed data
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |