Syntax question about negative numbers -

As the question, when I run these two, they work.

d1 $sound "bd" #speed (range 1 2 sine)

d1$sound "bd" #speed "-0.9" 

But this one has an error.

d1 $sound "bd" #speed (range -0.9 2 sine)

The error message is as follows.

    • Couldn't match expected type ‘Pattern Double’
                  with actual type ‘Pattern a1
                                    -> Pattern a1 -> Pattern a1 -> Pattern a1’
    • Probable cause: ‘(-)’ is applied to too few arguments
      In the first argument of ‘speed’, namely ‘(range - 0.9 2 sine)’
      In the second argument of ‘(#)’, namely
        ‘speed (range - 0.9 2 sine)’
      In the second argument of ‘($)’, namely
        ‘sound "bd" # speed (range - 0.9 2 sine)’

Can anyone help me :smiling_face_with_tear: What am I missing? I can't find any discussion about it on the forum :sweat_smile:
Thanks in advance! :melting_face:

the negative number just needs to be put in quotations like in your second example

d1 $ s "bd*32" # speed (range "-0.9" 2 sine)

also helps to have a bunch of events so you can hear the sinewave actually moving up and down


Thank you so much!
By the way,
Do you know how to stop the long samples and cycles immediately?
I used hush and command+. It still takes the whole cycle to stop the sound.
My sound sampling time is 8 seconds and I use the function $ LooAt

d1 $loopAt 8 $ s "sample*2" #speed "<-0.1,0.15>"

if you use legato it should help a lot with the long samples after you execute a hush

d1 $ loopAt 4 $ s "bev" # legato 1

one way to think about legato is this: if you are familiar with hardware or software samplers, imagine if you had the decay and sustain cranked up all the and the release dialed all the way back to 0 and you held down a pad/key for the total duration of the sample and it cuts off the second you release your finger.


I get it! You described it very well! Thanks so much!