Kyma Forum
  Tips & Techniques
  really simple SmallTalk/Capytalk question

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   really simple SmallTalk/Capytalk question
phillipm
Member
posted 20 June 2015 12:23         Edit/Delete Message   Reply w/Quote
I want to set a scripted loop in motion where a variable (say pitch) changes with the each new iteration of the loop. For example it could be a script of bit of CapyTalk that would create a descending chromatic scale from a single note. Play note 60 and each time through the loop subtract 1 from the previous value.

I suppose it could be done by subtracting successively higher numbers from the original not played, but I think it would be more useful for me to know how to do it by feeding the result of the previous iteration of the looping code into the next iteration.

60
60-1 = 59
59-1 = 58, etc.

or

x
x-1
(x-1) - 1
((x-1) - 1) - 1 ... etc.


IP: Logged

gustl
Member
posted 21 June 2015 00:49         Edit/Delete Message   Reply w/Quote
What about
(60 - ((1 bpm: !BPM) countTriggersMod: !Mod)) nn
?

If you really need to store the previous value have a look at EventVariables.

Best,
Gustav

p.s. Off Kyma now, hope the expression is right

IP: Logged

SSC
Administrator
posted 21 June 2015 10:05         Edit/Delete Message   Reply w/Quote
Another variation on Gustl's suggestion:


(!KeyNumber - ((!KeyDown bpm: !BPM) nextIndex))) nn

IP: Logged

phillipm
Member
posted 21 June 2015 10:37         Edit/Delete Message   Reply w/Quote
Thanks.

It looks promising. I often forget how useful countTriggersMod can be. It certainly appears that this line would generate a chromatic scale. Of course that's not quite what I had in mind ;-) But it might be expandable (with a little extra help from nextRandom or something like that) to get where I want to go.

Thanks again.

IP: Logged

gustl
Member
posted 21 June 2015 11:22         Edit/Delete Message   Reply w/Quote
You can also define the intervals if that's what you're after:

(!KeyNumber - (((!KeyDown bpm: !BPM) nextIndexMod: 7) of: #(2 4 5 7 9 11 12))) nn

or you can make Arpeggiators, or you can,...

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c