[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] GetNoteDuration
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] GetNoteDuration |
Date: |
Mon, 20 Jul 2009 09:45:10 +0100 |
On Sun, 2009-07-19 at 22:07 -0500, Jeremiah Benham wrote:
> 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)
> ))
>
great - good to see someone getting to grips with scheme, I have to look
up what `, etc mean each time...,
One suggestion, this function is not special to Augmentation, it quite
general for Denemo, and could therefore be in denemo.scm (equivalent of
utils.c) under a general name.
(define (GetBasedurationAndDots)...
which would internally use (d-GetDuration), rather than taking a
parameter called input.
Is the naming conventions for Denemo scheme written up at all?
Augmentation::process_string would be for a function to be used by the
Augmentation command, internally, other scripts should not use it
because the author of Augmentation would be entitled to change it...
Richard
> 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
>
>
>
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel