denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] scheme_change_chord_notes


From: Richard Shann
Subject: Re: [Denemo-devel] scheme_change_chord_notes
Date: Tue, 14 Jul 2009 09:12:17 +0100

On Mon, 2009-07-13 at 20:57 -0500, Jeremiah Benham wrote:
> I created a new function that I pushed to git. It is called 
> scheme_change_chord_notes. It is in view.c. 
> 
> The cursor must be over a chord (more than one note at once). It allows you 
> to respell the notes in the chord. It takes a list as an argument. 
> 
> Test with:
>    (define list '("a" "b" "c"))
>    (d-ChangeChordNotes list)
>    (d-RefreshDisplay)
> 
> The octave does not seem correct though. I will have to adjust this.
I think I would have stuck to strings, just to keep things uniform
(everything passes in strings, so you don't have to look up an API to
guess how to use the function). But I did already allow the
d-DirectivePut functions to pass in int fields...

What is the behavior if the number of notes passed in is different from
the number of notes in the chord? You could use "r" as a note value,
meaning delete that note...
>  
> 
> I created this to help facilitate the transposition script to change chord 
> tones. Should I document this function in the manual in git or should it go 
> onto the wiki?
The manual, assuming its siblings are there already, I think they are.
> 
> I was about to create anouther function similar to GetNotes. Before I did 
> that I was going to ask if there was an easy way to seperate the out put of 
> GetNotes into a list.
yes, this is standard scheme stuff transforming strings to lists and
vice versa. Do this in scheme rather than introducing more API.
>  If not I would write a similar function returning a list instead of a 
> string. This is also needed for the transpose script. It needs to be able to 
> read the note names in a chord then it has to determine what the destination 
> note will be and send this to the d-ChangeChordNotes procedure. Would it be 
> called a function or a procedure if its written in c but interfaced via guile?
> 
> Jeremiah
> 
> ps. While looking through the code I came across two functions that do the 
> exact same thing. 
???? they have different numbers of arguments for a start!
they show their signs of age by using "tone" for "note" - this is
original Hiller code I suspect from the 1990s, hacked by people ever
since. Yes, it does need tidying up, but you have to be soooo careful,
there are many hidden assumptions in this code, it is rather like our
reptilian brain.


> They are removetone(...) and tonechange(...).
was this a slip of the pen - they are pretty different?
Richard

>  tonechange seems to be more widely in the code. removetone is only used by 
> commandfuncs.c. To make things worse removetone is in chordops.c where you 
> would expect this function to be. tonechange(...) is used commandfuncs.c were 
> you would not expect it to be. I propose we remove removetone(...) and move 
> tonechange(...) to chordops.c. The code in commandfuncs.c calling 
> removetone(...) should be be updated to use  tonechange(...). I just thought 
> I would give a heads up to make sure that this was not done on purpose. 
> 
>   
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

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