[Top][All Lists]
[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:04:43 -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.
>
> 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.
>
Here is a quick way to separate the basenumber from the dots:
(define (Augmentation::process_string input)
(let ((basenote 0)
(numdots 0))
(set! basenote (car (string-split input #\.)))
(set! basenote (string->number basenote))
(set! numdots (length (cdr (string-split input #\.))))
`(,basenote ,numdots)
))
(display (Augmentation::process_string "32..."))
This returns a list containing two number. The first contains the
basenumber the second list item returns the number of dots.
Jeremiah
> 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