Fw: Fw: Pentatonic Diatonic Transposition?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Fw: Fw: Pentatonic Diatonic Transposition?

Trevor D-2
Carl

Mike 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" <[hidden email]>
To: "Trevor Daniels" <[hidden email]>
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 the
delay. I think everything is now cleaned up property.  Along the
way,
I realized it would be very easy to make it a minimally complete
composer'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. It
defines 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,
Mike


On Mon, Jan 24, 2011 at 11:21 AM, Trevor Daniels
<[hidden email]> wrote:

>
> OK, great! I'll look forward to it.
>
> Trevor
>
> ----- Original Message ----- From: "Michael Ellis"
> <[hidden email]>
> To: "Trevor Daniels" <[hidden email]>
> 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
> a
> few days before I send a new version -- I've been neglecting some
> other responsibilities while trying to get up to speed with Scheme
> :-)
> Thanks also for offering to do the doc work and uploading. I
> gladly
> accept!
>
> Cheers,
> Mike
>
>
>
> On Mon, Jan 24, 2011 at 4:02 AM, Trevor Daniels
> <[hidden email]> 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"
>> <[hidden email]>
>> To: "Trevor Daniels" <[hidden email]>; "LilyPond-Devel
>> list"
>> <[hidden email]>
>> Sent: Monday, January 24, 2011 2:08 AM
>> Subject: Re: Pentatonic Diatonic Transposition?
>>
>>
>> On 1/23/11 4:03 AM, "Trevor Daniels" <[hidden email]>
>> 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 the
>> music 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
>> the
>> chance to continue gracefully but with a warning.
>>
>> make-extended-scale has a display-scheme-music call that I think
>> should be
>> eliminated.
>>
>> 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
>>
>>
>>
>>
>>
>
>
>

modal-transpose.tar.gz (31K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fw: Fw: Pentatonic Diatonic Transposition?

Trevor D-2

Ian Hulin wrote Saturday, January 29, 2011 8:44 PM

> On 29/01/11 18:45, Trevor Daniels wrote:
>
>> Mike 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
>>
> Here's a guess.  Is scm/modal-transform-init.scm loaded by
> lily.scm in
> the list where all the others are loaded using ly:load?

Good guess!  That put me on the right track.  Adding
modal-transform.scm
to the list in lily.scm is one thing that needs to be done.  Then I
had to
delete (define-module (scm modal-transpose)) which was at the start
of modal-transform.scm.  Then the test compiled successfully.

But one puzzle remains.  At the end of the log file is:
...
Layout output to `modal-transpose.ps'...
Converting to `./modal-transpose.pdf'...
success: Compilation successfully completed
WARNING: (lily): `_' imported from both (lily) and (scm ps-to-png)

Can anyone suggest why the warning appears?

Trevor
 



---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: Fw: Fw: Pentatonic Diatonic Transposition?

Trevor D-2

Trevor Daniels wrote Saturday, January 29, 2011 10:01 PM

> Ian Hulin wrote Saturday, January 29, 2011 8:44 PM
>
>> On 29/01/11 18:45, Trevor Daniels wrote:
>>
>>> Mike 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
>>>
>> Here's a guess.  Is scm/modal-transform-init.scm loaded by
>> lily.scm in
>> the list where all the others are loaded using ly:load?
>
> Good guess!  That put me on the right track.  Adding
> modal-transform.scm
> to the list in lily.scm is one thing that needs to be done.  Then
> I had to
> delete (define-module (scm modal-transpose)) which was at the
> start
> of modal-transform.scm.  Then the test compiled successfully.
>
> But one puzzle remains.  At the end of the log file is:
> ...
> Layout output to `modal-transpose.ps'...
> Converting to `./modal-transpose.pdf'...
> success: Compilation successfully completed
> WARNING: (lily): `_' imported from both (lily) and (scm ps-to-png)
>
> Can anyone suggest why the warning appears?

OK, I found it.  modal-transform.scm contained (use-modules (lily)).
Deleting this removed the warning and I now get a clean compile.

On to sorting out the formatting ...

Trevor



---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: Pentatonic Diatonic Transposition?

Carl Sorensen
In reply to this post by Trevor D-2



On 1/29/11 11:45 AM, "Trevor Daniels" <[hidden email]> wrote:

> Carl
>
> Mike 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?

You need to add modal-transform.scm to the list of modules to be loaded that
is found in scm/lily.scm.

That should be all..

Carl


---
----
Join the Frogs!