I understand Haskell syntax.
I want to curry (partially apply) a function called "play-note", and pass one argument "manually," and the second with a map.
If I could write it in Haskell, I'd say:
playNote :: Time -> Instrument -> Int -> Int -> Int -> Int -> Music -- made up, but just to give you an idea
notes = [46, 47, 35, 74]
loopGo = True
loop time = do mapM_ (playNote' time) notes
if loopGo then (loop (time+(second/2))) else return () -- time element removed
playNote' time pitch = playNote time drums pitch 80 11025 9 -- ignore extra args
In Scheme, here's the best I've got:
(define notes '(46 47 35 74))
(define *loop-go* #t)
(define play-note-prime
(lambda (time2)
(lambda (pitch)
(play-note time2 drums pitch 80 11025 9)))) ; drums is another variable
(define loop
(lambda (time)
(map (play-note-prime time) notes)
(if *loop-go*
(callback (+ time (/ *second* 2)) 'loop (+ time (/ second 2)))))) ; time element is more sophisticated here
The Scheme version "compiles," but doesn't do what I expect it to (curry the 1st arg, then the 2nd). Help? Thanks!
Edit:
The essence of my problem is not being able to define a function which takes two arguments, in a way that the following code produces the right result:
map ({some function} {some value; argument 1}) {some list; each element will be an argument 2}