denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] GetNoteDuration


From: Jeremiah Benham
Subject: Re: [Denemo-devel] GetNoteDuration
Date: Sun, 19 Jul 2009 22:07:44 -0500

On Sun, 19 Jul 2009 23:52:33 +0200
Nils Gey <address@hidden> wrote:

> I am not sure how to handle GetNoteDuration in scheme.
> The problems are dots.

This one looks a little cleaner then the last one I sent:

(define (Augmentation::process_string input)
  (let ((basenote 0)
        (numdots 0)
        (list #t))
        (set! list (string-split input #\.))
        (set! basenote (car list))
        (set! basenote (string->number basenote))
        (set! numdots (length (cdr list)))

        `(,basenote ,numdots)
        ))

Jeremiah
> 


> If I take the return string and convert it to number I can test it,
> test it with dot but not further than one dot.
> 
> I tried to use 
> 
> (string-ref (d-GetNoteDuration) 0)) 
> 
> this returns char. I can test this with case, but then I struggle
> when it comes to two-digit entries like 16 or 32.
> 
> And I can't tell on which positions the dots will start. 2nd? 3rd?
> even 4th? (if there is a 128).
> 
> The only thing which comes to my mind know, with limited
> programming-experience, is to loop through the string and check each
> step if its a number and create a number after that. U
> 
> The second option is that GetNoteDuration returns two strings. First
> is the duration number, second the number of dots. But I guess this
> only generates the same problems, only in C.
> 
> 
> Any suggestions?
> 
> Nils
> 
> 
> _______________________________________________
> 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]