denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] draft of real-transposition script


From: Jeremiah Benham
Subject: Re: [Denemo-devel] draft of real-transposition script
Date: Mon, 01 Dec 2008 08:18:31 -0600

On Mon, 2008-12-01 at 07:45 +0000, Richard Shann wrote:
> Jeremiah - I just noticed this email in my in-box, it seems I didn't
> reply, sorry. Did you resolve the issues you mentioned by now?

yes. I have a popup asking:
Write in the a note how it appears on the screen and then the note it
shall be transposed to. So the users enters in:
c d 
for a Major 2nd. 

> Was my email about scripts calling scripts too terse? 

I don't think so. I read it and I believe I understand. I am going to
think about it and the re-usability of it and then push it to git. Is
the xml around the scheme code hand written? Unfortunately I planned on
working on it but did not get a chance since last Thursday. We are on
holiday here in the states. I thought I would get a break from the
family visiting and gluttony but I couldn't. Its over now. 

> If so, I can write
> the script to apply your transpose function to the selection, as that
> will be as quick as any longer explanation of what I have in mind. 

Ok. I will attach it because I am sure you have a clearer plan with it.
In its current state it does not work for chords that have multiple
notes. I was thinking that we can create variables in the script to save
information like $(lilypond-directive, chord symbol, figured bass,
ornament, etc...) then delete the object then add it with the new notes
and apply the additional $i. 

real_transposition2.scm is older and has code in it to apply to the
entire staff. In real_transposition3.scm I removed the code to apply to
entire staff. It was an attempt to begin consolidation, clarifying, and
separating the procedures that apply the transposition from the code
that tells denemo where to apply it. 

> (And,
> it will have the advantage of not being just theoretical). (Can you
> check in your transpose command in that case?)
> I think I have understood now how to combine MIDI filters as well.

Thats awesome!

Jeremiah

> Richard
> 
> On Mon, 2008-11-24 at 10:32 -0600, Jeremiah Benham wrote:
> > On Mon, 2008-11-24 at 14:46 +0000, Richard Shann wrote:
> > > On Sun, 2008-11-23 at 18:59 +0000, Richard Shann wrote:
> > > > Jeremiah - what is this construct all about?
> > > > 
> > > > (define (pitch::semitone pitch)
> > > >   (+ (* (car pitch) 12)
> > > >   (vector-ref pitch::semitone-vec (modulo (cadr pitch) 7))
> > > >   (caddr pitch)))
> > > Oh, I see, it is a shorthand for a lambda form, creating a procedure
> > > with the name pitch::semitone, with formal parameter pitch and body rest
> > > of the stuff.
> > 
> > 
> > Here is my latest script. 
> > 
> > I am not sure about this part:
> > (define
> >   (text2pitch x)
> >         (modulo (- (char->integer x) 99) 7)
> >   )
> > 
> > I am not sure if this works for international users or not. It returns a
> > number 0-6 corresponding to the pitches c,d,e,f,g,a,b.
> > 
> > This version has one popup dialog asking the current pitch and what the
> > user would like that pitch to appear as. So if the user wants to
> > transpose up a M2 the would type in: 
> > c d
> > d e
> > etc ....
> > 
> > If the user wants to transpose into a flat key:
> > c des
> > If the user wants to transpose into a sharp key:
> > c cis 
> > 
> > octaves also work. If a user wants to transpose it up three octave:
> > c c'''
> > Or down and 2 octaves
> > c c,,
> > 
> > Some issues I am having is that I would like to know how to get the
> > arguments from the string better. I am currently using string-split "c
> > c,,," #\space. Unfortunately if the user uses more than one space it
> > will not work. I can replace string-split with my own function but was
> > wondering if there is something more standard that I could use for this.
> > Something similar to an argv in c. 
> > 
> > Also Some of the functions I would like to learn how to use let or
> > something in order to use only local variables. Unfortunately I don't
> > see a way to modify a local variable once it has been defined in let
> > (like adding 1 to the variable). 
> > 
> > 
> > Jeremiah
> > 
> > > Richard
> > > 
> > > 
> 

Attachment: real_transposition2.scm
Description: Text Data

Attachment: real_transposition3.scm
Description: Text Data


reply via email to

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