# A little present: dynamitec UltraArp EXTENDED & LE [+ sourcecode]



## Dynamitec (Oct 31, 2006)

Hi everybody!

After beeing here a while without sharing it's time again:

Here we go:

dynamitecUltraArp EXTENDED v1.6 &
dynamitecUltraArp LE v1.6

Full source. But you need Nils Editor to compile.

I going to upload some presets and a NKP tomorrow. And a short describtion how to use this script 

Have fun. Maybe you could need it


----------



## Dynamitec (Nov 1, 2006)

*Re: A little present: dynamitec UltraArp EXTENDED & LE [sourcecode]*

...


----------



## Frederick Russ (Nov 1, 2006)

*Re: A little present: dynamitec UltraArp EXTENDED & LE [sourcecode]*

Good job Benjamin! Sounds very interesting - can't wait to try it out. Will probably be in a day or two so I'll get back to you on this.


----------



## Thonex (Nov 1, 2006)

Hey Dyn,

Thanks for sharing  

I'm a little slammed with work right now... but I look forward to trying it when I get a chance... and especially looking at the source code 

I always like looking how you guys (the real programmers) use functions and whatnot with Nils' editor.

It's great having you here.

Cheers Benjamin.

T


----------



## topaz (Jan 19, 2009)

thanks for these, looks interesting but I cannot get them to compile without errors.


----------



## Dynamitec (Jan 19, 2009)

I'll fix it tomorrow. They were done a long time ago and i can' tell you right now why they can't be compiled anymore.


----------



## Dynamitec (Jan 19, 2009)

Ok here is a quick manual:

Here some notes how to use it and a small instrument with some presets that show you how to use it:

*Features:*

- 16 Steps (EXTENDED Version: 32)
- 6 Presets (EXTENDED Version: 12)
You can switch presets via keyboard if you held the keyswitch key and press a note 4 notes above this keyswitch key. Keyswitch + 4 = preset 1, keyswitch + 5 = preset 2 and keyswitch + 6 = preset 3 and so on.

Different Loop Modes (Forward, Backward and Ping Pong)
You can switch a loop mode if you held the keyswitch key and press a note 1 to 3 above this key. Keyswitch + 1 Key above = Forward, Keyswitch + 2 Keys above = Backward and Keyswitch + 3 Keys above = Ping Pong.

6 Patterns
Each pattern is triggered by the number of notes you play in a chord or a cluster.
For Example: If you play C Dur with C, E & G you'll trigger pattern 3.
If you play C Dur with C, E, G & C you'll trigger pattern 4. And so on.
Each pattern has 16 steps. Every step can set to a number from 1 to the number of the pattern + 1. This number stands for the number of the note in the chord. For example: You play C, E,G. In this case 1 means C, 2 means E and 3 means G. So you can build a pattern and the numbers will be replaced by the notes you play in a chord.
If you set the number to pattern + 1 you'll trigger the whole chord. So for example: You play C, E and G => pattern 3 and you set on step to 4. In this case this step will play the whole chord.
Every pattern has 4 paramter lines. You can edit: Velocity (0 to 127), Duration (-2 means half, -4 means a quarter, etc., 2 means double, 4 means fourtimes, etc.), Octave and Send CC (0, 127). You set setup the CC to which this paramter is send in options menu.

You can setup a lot more different options. Just play around Smile Have fun.

+ Solo Mix Mode
If you play single notes pattern stops. if you play a chord pattern starts

+ Retrigger Loop
On Key
On Bar, on 1.5 Bars, 2 Bars, etc...
On Keyswitch

+ Signatures and Tempo
Patterns are following your time signature if you are working in a sequenzer like Cubase! Very interessting when using "Retrigger on 1.5 Bars" for example. So many different muscial (!) variations can be created with a breeze. And they always fit.

+ Playrange
You can set the playrange. Choose if notes outside will be bypassed or killed. So you can split your keyboard to a pattern and a solo playrange.

+ Transpose
Transpose single notes via octave parameter or the whole pattern

*Here is a small NKI with an example (you need to play more than one note to see what happening :* (Right Click + Save)

http://www.benjaminstelzer.de/ksp/script/Dynamitec_Ultra_Arp_LE.nki (http://www.benjaminstelzer.de/ksp/scrip ... Arp_LE.nki)

*Here is the source code to be compiled with Nils Editor:* (Right Click + Save)

http://www.benjaminstelzer.de/ksp/script/dynamitecUltraArpEXTENDED+LEv1.7.zip (http://www.benjaminstelzer.de/ksp/scrip ... LEv1.7.zip)
_
It's a little bit old  It's from 2006. I'm wondering that anyone still found this thread  But anyway, it should work just fine now! :mrgreen:_

*More scripts can be found here btw:*

http://ksp.dynamitec.de

*I also found my SIPS skins again: (Right click + Save, the TGAs can be used in Kontakt, the jpgs are only for preview)
*
http://benjaminstelzer.de/ksp/skins/


----------



## EvilDragon (Jun 5, 2010)

It is rather complicated at some parts 

Could you give a hand on how would I correct above mentioned errors/bugs? Otherwise it's working perfectly, I'd just want to get rid of tht script error, and make keyswitches actually change presets on the fly. BTW I have added information when a keyswitch is pressed: "Looping mode: Forward/Backward/Ping-pong" and "Switched to preset x", it is useful 

Anyways, I bet it was not easy to come up with such a script!


BTW one more question - I didn't quite figure out what does "retrigger" in Solo Mix section do. I see it's connected to singlenote_retrigger in the script, but I see no difference no matter if it's turned on or off...

And one last noticing - whenever I click on the pattern table when "1 note" is shown, it gets filled with 1's. I expected it would retain the pattern shown there.

Also, it would be MEGA COOL if the pattern table would change depending on how many keys you press, with the subpattern for that number of keys!


*EDIT:* I have managed to correct the script error bug when switching presets via main keyswitch. In KeyswitchCheck function, just removed the i:=11 line and it's gone.

I'm also editing the script by adding some nice key coloring (courtesy of K4!), you're gonna love it! Also I think I could add set_control_help to all elements, with your help on certain features I still don't understand what they do (like above mentioned Retrigger in Solo mix section!)


----------



## EvilDragon (Jun 6, 2010)

Here's how it looks for now (warning: 6.5 MB GIF ensues):

http://img41.imageshack.us/img41/3577/arp.gif

BTW I fixed the bug with the main keyswitch not changing back to normal coloring right after pressing any of the green or yellow keys right after recording this.


----------



## Dynamitec (Jun 6, 2010)

Hehe  Great work! I'm glad you found the time and manged to find the bug. As soon as you are finished with the changes you do, simply upload the code again here. And I'll take a look if I can implenet your other requests!


----------



## EvilDragon (Jun 6, 2010)

I'm trying to find another name for Solo mix feature. Will try to think of something.

What does Retrigger do in that section?


I dunno why preset switching via keyswitches doesn't really work. As you can see in the GIF, the tables don't get refreshed when I switch to a preset.


----------



## Dynamitec (Jun 6, 2010)

Here is how "Single Note Retrigger" works, if I recall correctly. 

You can setup the script so only chords are played with arpeggio. If you play single notes, they are played just as single notes. 

If "Single Note Retrigger" is turned on, playing a single note resets the pattern cursor to it's start position. So next time you'll play a chord, the pattern starts form beginning.


----------



## Dynamitec (Jun 6, 2010)

EvilDragon @ Sun Jun 06 said:


> I'm trying to find another name for Solo mix feature. Will try to think of something.
> 
> What does Retrigger do in that section?
> 
> ...



"Solo Mix" means that you can mix solo with chord playing. So the script kicks in, if a chord is played, but not if single notes are played.


----------



## EvilDragon (Jun 6, 2010)

Hm, I see no difference in the behavior, at least not in K4.0.5. Whether single note retrigger is on or off, the pattern always gets reset to step 1.


----------



## Dynamitec (Jun 6, 2010)

This is really strange. I have to look into that further. I'm also not sure why the presets aren't loaded via keyswitch. That definitely worked in the past. Maybe I've broken something with my K3 compatibility hack...


----------



## Dynamitec (Jun 6, 2010)

Oh, wait a second: have you setup the chord detect time? If chord detect time is 0 the engine can't determine if a chord or a single note is played.


----------



## EvilDragon (Jun 6, 2010)

OK here's the code that I'm using: http://pastebin.com/0gdu5JCa

I probably won't change anything to the mechanics of the script anymore, I'll just add set_control_help for all UI elements, and that would be it.

Also, it would be cool (as I mentioned above) if the tables would switch to appropriate sub-pattern depending on how many keys are played. And if clicking on 1-note sub-pattern wouldn't introduce all 1's in the table, but to retain the pattern there 

In the Retrigger options (On keyswitch, on 1 bars, etc.) it would be cool if "On keyswitch" option would show a value edit field, which would let us choose the number of steps being played, and it would also do set_table_steps_shown along the way! (I'd also change the Preset knob to a value edit fiels so all UI elements would fit in the interface)


Thanks for a really amazing and useful script!


----------



## EvilDragon (Jun 6, 2010)

Dynamitec @ 6.6.2010 said:


> Oh, wait a second: have you setup the chord detect time? If chord detect time is 0 the engine can't determine if a chord or a single note is played.



Chord time is about 35 ms.


----------



## EvilDragon (Jun 6, 2010)

I found out the difference: if "real" retrigger is on, it will ALWAYS retrigger the sequence, disregarding the setting in Solo mix section. If real retrigger is off, then retrigger in Solo mix works almost as intended.

Almost? Well, let's say I play a chord and it goes to step 15. If I now play a single note, sequence moves to step 16, and it should remain on step 15. Another small bug? If Retrigger in Solo mix mode is active, then it first goes one step ahead in the sequence, and THEN retriggers.


----------



## Dynamitec (Jun 6, 2010)

Lol... oh man, I think it would be faster for me to rewrite the whole thing for K4 with a nicer GUI instead of searching for the bugs


----------



## EvilDragon (Jun 6, 2010)

Are you sure? I mean, it's still 2600 lines of code >_> That's a LOT. 

Well, I won't stop you 


Also I just noticed that I forgot to put ColorKeys function in ui_control callback for "keyswitch".


----------



## Dynamitec (Jun 6, 2010)

Well, 2600 is not that much... and with the larger arrays etc. in K4 it's much easier to do such things now than it was back than (not to mention the great features which were added to Nils editor in the meantime e.g. macros und import).

My script for Electri6ity has more than 50.000 lines of code (compiled). The engine alone has more than 15.000 lines of code - uncompiled


----------



## EvilDragon (Jun 6, 2010)

HOLY COW! '


That was some work, I presume! Well the largest thing I did was that ASCII keyboard thingie, it was 1062 lines in Nils' editor, and when compiled, somewhere around 2600 :D


Well, depending on your choice, good luck in rewriting the script  I hope you like my changes in parameter and option renaming, and I'm a sucker for set_key_color so that just had to be done! I think it's cool to show if notes are just bypassed but still available (cyan) or killed completely (white) depending on user choice.

This is one of the most musical scripts I've encountered. So many options and possibilities to create different sequences!

You could also improve the latch loop mode by making it incremental. For example: play one note and release the key - sub-pattern 1 plays. Now while pattern is playing, play 2 more keys, sub-pattern 3 starts playing. Now press first of the "2 more keys" you just pressed, and that key gets subtracted from the sequence, playing sub-pattern 2 now. It's basically that Hold +/- mode from factory arp script, I like it very much.

Hm, this latched mode could color the keys that are latched to red, and when pressed again, keys would go back to blue again! So many possibilities to script...


EDIT: sustain pedal sustains the notes :( Shouldn't it be better if it just latched the arp, and outside the arp range it would work as normal sustain, switchable? Perhaps adding a new menu option for sustain pedal behavior could do nicely...

I should stop with these ideas now. xD


----------



## Dynamitec (Jun 6, 2010)

Well, I think it's worth to rewrite that for Kontakt 4. With a larger UI it would be much less complicated for the user to understand what the script does and to handle it.
I definitely agree about set_key_color. That was an really great addon to KSP! 

I wrote that script to do automatic chord picking, with different picking patterns depending on how many notes a chord consists of (that's why it goes up to 6 for six strings).


----------



## EvilDragon (Jun 6, 2010)

Ah! It's great, really, even for non-guitaresque applications! (No love for 7 or 8 string guitars? )

Anyways I really have a lot of ideas for improving this script, but no idea on how to go about some of them.


(BTW; I found a better name for Solo mix. It's "Play solo" )

What do you say about having an edit bar (which would essentially be another ui_table with only two values, 0 and 1, and it would have the same length as other tables, 32), in which we could draw in a number of steps, and then all the "Tools..." operations would be carried out only on that range?

For example, we have a pattern of 32 steps, and we particularly like the sequence from step 6 to 18, let's say. We draw out steps 6-18 in the edit table, and then select Copy from "Tools..." menu (this all works only for one sub-pattern). Now we switch to another sub-pattern, and clear out the edit table, and fill only the fourth step of the table, and from "Tools..." we select "Paste at edit position"

"Tools..." menu would then consist of:

*Copy*
*Paste* (pastes always from step 1 onward)
*Paste at edit position* (depends on edit table. If more than one step in edit table is filled, it takes only the first filled step into account)
*Fill* (fills from step 1 onward)
*Fill at edit position* (similar to Paste variant, fills from first active edit table step, till the end of pattern)
*Clear*

There would be no need for "Copy first x steps", and the menu would be a lot more stremlined! Of course, if you have an irregular pattern of selected steps in the edit table, those would be copied. For example, if you have this pattern:

00110000111100001111001100111100

it would take all the "1" steps and paste it to wanted positions, but it would LEAVE the old values on the places where edit pattern is 0!


You could also introduce one small ui_table which would show current position in the pattern, similar to what's used in factory scripts.


Should I stop with these ideas now? :D :D (The answer is "no, better prepare some cash for a Paypal donation!" )


----------



## Dynamitec (Jun 6, 2010)

Hehe  I'm quite busy at moment. But I definitely would like to come back to that idea and script!


----------



## EvilDragon (Jun 7, 2010)

Hey, Benjamin, I have found out that the preset switching via keyswitches actually work, BUT...

Let's say that you have the first sub-pattern displayed (1 note). When you change to another preset, ALL presets will be changed EXCEPT the currently shown one. Which means that if you have the first sub-pattern displayed, that one will NOT get loaded from the other preset.

But, as soon as I switch to any other sub-pattern, I CAN play the 1 note sub-pattern! But then again I cannot play the currently shown sub-pattern (to which I just switched!)

Interesting bug, eh? 


Also, when keyswitching the presets, the main Retrigger setting is NOT followed - the pattern always retriggers! It would be better if preset switching followed the Retrigger setting - if it's off, then just continue from the current sequence pointer instead from start.

One more thing (this one is occasional and I can't reproduce it accurately). When I return from free-running mode, the sequence actually never stops after releasing the key! Try this: enter freerunning mode (disable main retrigger). Play a pattern, then stop. Go back to retrigger on key mode, play a pattern. Release the key. Instead of stopping, the patter continues playing! Pressing the stop key, pattern stops, but when playing a pattern again, it doesn't stop upon releasing the key! I have to click on the Panic button to make everything work again...


----------



## EvilDragon (Jul 31, 2010)

Hey Ben, what's up?

Still busy? :lol:


----------



## EvilDragon (Dec 7, 2010)

Bumping up for Benjamin's reference. The latest posts are the most intriguing! :lol:


----------

