# Crossfade script



## kotori (Sep 21, 2006)

Hi everyone,
I have written a http://nilsliberg.se/ksp/scripts/Nils_Crossfade_Script_1_03.zip (crossfade script) to make it possible to turn any instrument into a mod-wheel controlled velocity layer blended one:







To use it do this:
 Set the number of velocity layers 
 Set the top velocity of each velocity layer (these values can be seen in the Mapping Editor)
 Set the CC that should control the velocity layer blending and if you want set a CC to control when the script is active (the value 0 means always on)
 Set the type of crossfade - linear or cosine
 In the Amplifier section of the instrument turn the velocity modulation slider down to 0%.
 Set the Modslider to whatever the velocity modulation slider was set to before you changed it.
 Play and use the mod-wheel (or some other CC) to control the blending between velocity layers.

The default values for the velocity layer boundaries are set to fit most VSL instrument with four layers.

Cheers,
Nils


----------



## Thonex (Sep 21, 2006)

Whooooaaaa.... why didn't I think of that!!!!!!

This is definitely going to be a GREAT tool!!!!!!

Instantly turn a velocity layered instrument inòƒQ   EpðƒQ   EpñƒQ   EpòƒQ   EpóƒQ   EpôƒQ   EpõƒR   EpöƒR   Ep÷ƒR   EpøƒR   EpùƒR   EpúƒR   EpûƒR   EpüƒR   EpýƒR   EpþƒR   EpÿƒR   Eq ƒR   EqƒR   EqƒR   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   Eq	ƒS   Eq
ƒS   EqƒS   EqƒS   Eq ƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS   EqƒS


----------



## synergy543 (Sep 21, 2006)

Wow, this looks very interesting! However Nils, could you please post a zip version for Mac users (dropping text into the script doesn't seem to work).

Also, how would you compensate for different levels where there isn't equal power? Would altering the top velocity level work?

Also I wish there were a way to displace or somehow alter the shape of the curves to provide a few variations. But of course this is just a theoretical "wish" as I haven't tried it yet!

Thanks,

Greg


----------



## kotori (Sep 21, 2006)

synergy543 @ Thu Sep 21 said:


> Wow, this looks very interesting! However Nils, could you please post a zip version for Mac users (dropping text into the script doesn't seem to work).
> 
> Also, how would you compensate for different levels where there isn't equal power? Would altering the top velocity level work?
> 
> Also I wish there were a way to displace or somehow alter the shape of the curves to provide a few variations. But of course this is just a theoretical "wish" as I haven't tried it yet!



Hi Greg
I made some updates to the script and changed the link in the first post above to refer to the zipped 1.02 version. I'm not sure exactly what kind of adjustments of the curves you would be interested in doing. Please elaborate.

I added a Modslider knob which replaces the velocity controlled volume modulation slider which I recommend setting to 0%.


----------



## Thonex (Sep 21, 2006)

Thanks Nils for making all the changes! 

This is great stuff!!!!!

Cheers,

T


----------



## JacquesMathias (Sep 21, 2006)

Guys, you are genius!!!!!! Thanks for sharing!!! 
I'm a lazy to learn these things. I'm always thinking, ok let's learn it, but it seems i wasn't born to write scripts :mrgreen: My luck guys like you get it!

Thanks again for these amazing scripts :smile:


----------



## synergy543 (Sep 21, 2006)

Thanks for the update Nils. I'll play around with it first before making further comments (brainstroming ideas is always fun though). Maybe it will do the trick just as is.


----------



## TD (Sep 21, 2006)

Wow, now that's a really nice idea 

Would be possible to set an initial and final volume so for example the softest dynamic would start at say a 10% of the volume, the loudest dynamic end at 100% of the volume instead of the softest dynamic at 100% and the loudest dynamic at 100%? I'm not sure if you understand what I mean. So all the peaks ramp up (like 1st peak at 10%, second peak at 30%, third peak at 50%... instead of them all at 100%


----------



## kotori (Sep 21, 2006)

TD @ Thu Sep 21 said:


> Wow, now that's a really nice idea
> 
> Would be possible to set an initial and final volume so for example the softest dynamic would start at say a 10% of the volume, the loudest dynamic end at 100% of the volume instead of the softest dynamic at 100% and the loudest dynamic at 100%? I'm not sure if you understand what I mean. So all the peaks ramp up (like 1st peak at 10%, second peak at 30%, third peak at 40%... instead of them all at 100%



I think I see what you mean, but doesn't the Modslider knob already do that? (it doesn't set the final volume though but that's easy by just raising the volume)


----------



## SvK (Sep 21, 2006)

GUys...

I'm on a MAC ...I dropped the file into my presets/scripts folder and I can access the script in Kontakt 2...

however when I try to type a number into ANY field the result is always "-6" ????

Also my script interface looks nothing like the one above....mine has seven vel. fields and i do not have a selector for cosine/linear and I do not see the curves....just entry fields.


thanx,

SvK


----------



## Thonex (Sep 21, 2006)

SvK @ Thu Sep 21 said:


> GUys...
> 
> I'm on a MAC ...I dropped the file into my presets/scripts folder and I can access the script in Kontakt 2...
> 
> ...



What version of K2 are you running? You probably need to be running K2.1.1.001.

T


----------



## Frederick Russ (Sep 22, 2006)

Congrats - looks like a very useful script Nils. I'll be putting it through its paces this weekend.


----------



## SvK (Sep 22, 2006)

Thonex,

Thanx..Updated Kontakt it worx now!

SvK

ps: Nils...thanx for this 

SvK


----------



## Big Bob (Sep 24, 2006)

Hey Nils,

I finally had a chance to try this script and I think it's very well implemented and it sounds quite good on the instruments I've tried it with so far. I'm sure this will be a very useful tool.

I know Andrew has already remarked about your spiffy display with its moving cursor that tracks the Mod Wheel. But I wonder how many people have picked up on the clever use of eye-integration to highlight the overlapping regions?

Thanks for all your generous contributions Nils, we're sure blessed to have you around!

Bob


----------



## kotori (Oct 5, 2006)

Hi everyone,
I think the version number of this script might have been a bit misleading. There are still a few problems to be resolved:
* the equal-power crossfade not working properly 
* the volume response not completely accurately emulating that of K2
* the math for the modulation slider (not visible on the image above but added in the latest version) being wrong

I'll try to solve all these and maybe also add an easy way to activate volume curve compensation for libraries converted from gig-format. Bob also noted that Kontakt's velocity -> volume response is a bit strange since in some velocity ranges a change in velocity might result in volume changes so small that they are difficult to perceive. Maybe it would be possible to develop something that better takes advantages of the rather limited range of velocities (1-127) so that each change in velocity results in an audible change in volume. I'm still looking into this matter.

After implementing this I'm thinking of going commercial with this script. As much as I like to share ideas and techniques some income could help me motivate spending so much time on scripting. I hope you won't mind. I don't know what form would be best. I would like to strike a balance between as many as possible using the script and me getting some extra incentive to develop it. Some possible models could be:
* volontary donations
* pay if used for anything more than personal pleasure (like the license for Kornel's resonance scripts)
* everyone who use it has to pay for a copy

Maybe the middle one would work best in practice (if not too many are dishonest), but I could also consider the first. Do you have any opinions regarding what would be a reasonable price? I'm thinking of $15-$20 with updates included. What do you think?

Cheers,
Nils


----------



## mathis (Oct 5, 2006)

You know, if I'd have had this script before I reprogrammed my patches painstakely over a couple of days 20$ would have been such a bargain...


----------



## Moonchilde (Oct 5, 2006)

I like this script, so far it seems to DXF better than doing it by hand. I don't think I'd pay anymore than $15 either. I think Donation or purchase for professional use would be best. I also wouldn't pay for a script I can't try out, and I'd want more than 15 days, maybe 20 because I don't always use my computer. As a consumer I'd also want to know if it would interfere in any way with any other scripts I might use, so a warning before hand would be nice or a list of what you can/can't chain the script with.


----------



## Big Bob (Oct 5, 2006)

Hi Moonchilde,

Regarding cascaded script interference, see my other post to your thread asking about this matter.

Bob


----------



## Moonchilde (Oct 5, 2006)

Right, but I think if a script goes for sale then people should know before hand on the sale page. Just so that users don't start to complain and demand refunds because their scripts are "broken"


----------



## kotori (Oct 6, 2006)

Sorry about the confusion, but I changed my mind: this script will remain free. I received some very useful info from Bob and it feels wrong to use this commercially and also to change the terms after the script was presented here. Besides I could use some feedback to improve the script and that would feel more natural if the script is free. Maybe I'll add some option to donate a small sum for those who feel the script is useful but this won't be required to use it.

Cheers,
Nils


----------



## midphase (Oct 6, 2006)

Nils,

While I think charging for a single script might not be as appealing to end users, I do believe that if you had a collection of scripts for sale that would make it more appealing.

Don't get me wrong, I think it's great that these fantastic scripts are being shared to the community at no charge!

I think a donation-ware model is probably the best approach (similar to Ambience, and V.I. Control). That way people who feel that this script is worth $30 can give you that, and people who feel it's worth $5 will give you that. 

I think you should make sure that you let people know your PayPal name (perhaps as part of the script itself) so that sending you some $$ is simple.

I also think that NI ought to "hire" guys like you and Bob so that scripts like these can become part of K2's built-in capabilities. Arpeggiators and Transposers and nice and cool....but this is way more useful.

One last thought is that you ought to offer a custom version of your script to guys like Sonivox and others who use K2. Perhaps they could pay you a license fee which would probably be much more financially rewarding than what you would make from selling it to users directly.


----------



## kotori (Oct 6, 2006)

Hi midphase,
Thanks for your comments. Very good points. 
Btw. I checked out your site. A very nice one and lots of impressive material!

Cheers,
Nils


----------



## Moonchilde (Oct 11, 2006)

Hey Kotori, I was using the second edition of this script the other night, and I couldn't figure out how to get layer 1 to crossfade with layer 2 without changing volume. I just wanted to fade between 2 layers without the volume getting quieter as the slider moved left (or modwheel down). Any suggestions?


----------



## kotori (Oct 13, 2006)

Moonchilde @ Wed Oct 11 said:


> Hey Kotori, I was using the second edition of this script the other night, and I couldn't figure out how to get layer 1 to crossfade with layer 2 without changing volume. I just wanted to fade between 2 layers without the volume getting quieter as the slider moved left (or modwheel down). Any suggestions?



Hi, I'm not at home at the moment. I'll have a look at this when I return.

Nils


----------



## Moonchilde (Oct 13, 2006)

Nils, I have uploaded a patch I made. I hope you have QLSO Gold... this will pull samples from whatever your QLSO folder has them. There are 2 samples loaded. 1 is a string sample and one is brass, for ease of hearing the cross fade. In this case, between 2 layers, the crossfade doesn't even work. Unless I am doing something really wrong :( I've tried to add the velocity bar, set it to 100%, set it to 0%.. didn't change anything. Set it to -100% and it went silent. I got rid of it, same issue.

It does seem to work for 3 or more layers, definitely 4 works. I do not know if the first layer is working though... I have not tried it that extensively.


----------



## Moonchilde (Oct 17, 2006)

Any update on this? Anything I can do to help?


----------



## Moonchilde (Oct 18, 2006)

Hey Nils. I just tried it out, I am still having issues. This time, both samples play at the same time rather than cross fade. But at least the first sample velocity is playing... but no cross fading. I tried putting the velocity knob in all sorts of positions and tried adding/subtracting a velocity modulation.

Sorry to be a pest!


----------



## Mr. Anxiety (Oct 20, 2006)

Great script Kotori - Bravo!

I'm applying it to the Flute Sus V from Westgate Winds, not the new one with legato.
I've set the CC Active to CC83, things work fine for a bit, then notes start sticking.
Not sure why.

I do have SIPS in slot 2 and Crossfade 1.02 in slot 3. Slot 1 is empty.

Any thoughts?

Thanks Again,

Mr. A.


----------



## kotori (Oct 22, 2006)

Hi guys,
I'll check out these problems when I return in a few days (I'm currently not a home).

Cheers,
Nils


----------



## mathis (Nov 2, 2006)

Mr. Anxiety @ Sat Oct 21 said:


> Great script Kotori - Bravo!
> 
> I'm applying it to the Flute Sus V from Westgate Winds, not the new one with legato.
> I've set the CC Active to CC83, things work fine for a bit, then notes start sticking.
> ...



Yes I have the same problem combined with SIPS. Notes hang. SIPS in slot2, Crossfade script in slot3.

But anyway, great script! It would be great if you could sort out this problem.
Thank you!
- Mathis


----------



## lee (Dec 19, 2006)

Any chance we´ll see a new enhanced version of the crossfade script soon, Nils?(Version 3 is the latest right?)

Snäääälllaaa....  <---Swedish

/Johnny


----------



## kotori (Dec 19, 2006)

lee @ Tue Dec 19 said:


> Any chance we´ll see a new enhanced version of the crossfade script soon, Nils?(Version 3 is the latest right?)
> 
> Snäääälllaaa....  <---Swedish
> 
> /Johnny



Hi Johnny!

I hope to find some time after Christmas to do this. It should be a lot easier now thanks to Bob's excellent math library.

/Nils


----------



## lee (Dec 19, 2006)

Thank you Nils! Are you some kind of Scripters Saint or something?

/Johnny


----------



## Thonex (Dec 19, 2006)

lee @ Tue Dec 19 said:


> Thank you Nils! Are you some kind of Scripters Saint or something?
> 
> /Johnny


Yes... he is...

Saint Nils.


----------



## kotori (Dec 19, 2006)

Nah, I'm no _Saint_, although the new script editor release has a little of _Santa _feeling. :wink:


----------



## Dynamitec (Dec 19, 2006)

Oh yes it has!!! :roll: Thanks again Nils! I worked the whole afternoon with the new release! Great!


----------



## Thonex (Dec 19, 2006)

kotori @ Tue Dec 19 said:


> Nah, I'm no _Saint_, although the new script editor release has a little of _Santa _feeling. :wink:



You're right.... St. Nick is just an incorrect translation of St. Nils that happened during the middle ages. Thanks for being our "Santa Nils":


----------



## lee (Dec 21, 2006)

Nils, do you think that you could make a version of your future Big Bobs mathlibrary enhanced crossfading script that you can use together with your ks-remapped opus instruments? I saw that you had maybe planned a keyswitch for x-fade on the picture you have on your homepage.

http://www.nilsliberg.se/ksp/scripts/opus_remapping/mapping_small.gif (http://www.nilsliberg.se/ksp/scripts/op ... _small.gif)

Merry Christmas!

Edit: I deleted the last part by mistake: Nils, have you thought about putting a donation pay pal on your website? I´m sure many want to show their appretiation, including me.


----------

