# Help with group-crossfade and VR_to_ep function



## slim boy fat (Feb 11, 2013)

Hello everyone,

at first i want to say that this is a really nice and good forum! It already helped me out sometimes, as i am writing my first script...
Most of the things that i wanted to realize worked out so far, but now i am stucked with a hughe problem:
For the instrument i want to control paired groups (00+01;02+03) with a crossfade-slider. The problem is, that i would like to use only one volume-knob (a) for the first two groups (00+01) and one knob (b) for the other ones (02+03) and hide the original volume-knobs of the group. So that in the end the volume-knobs set the value for the slider (have a look at the attachment, it contains an image and a small script of the current situation). During this course i came along this topic: 
http://www.vi-control.net/forum/viewtopic.php?t=25980
It says, crossfading between groups is no problem, but using the VR_to_ep function will be much better regarding the volume-dip in the center.
But i couldn´t get both things together, the crossfade slider with variable values and and nice sounding crossfade using the Math Library...
Could someone please help and give me a direction? I know that this is a very large question to ask (at least in my opinion), but my skills are obviously not that advanced, that i can adapt the VR_to_ep function for my needs...

Many many thanks in advance!

Danny

Here´s the code for the current situation:

on init
make_perfview
set_script_title("Groups")
set_ui_height(4)
message("")
declare $first_volume
declare $second_volume
declare $group_00_volume
declare $group_01_volume
declare $group_02_volume
declare $group_03_volume
declare ui_slider $first_slider (100,0)
move_control_px ($first_slider,100,50)
make_persistent ($first_slider)
declare ui_slider $second_slider (100,0)
move_control_px ($second_slider,420,50)
make_persistent ($second_slider)
declare ui_knob $first (0,10000,1)
move_control_px ($first,100,1)
set_knob_unit ($first,$KNOB_UNIT_DB)
set_knob_defval ($first,6308)
set_knob_label ($first,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
set_text ($first,"first")
make_persistent ($first)
declare ui_knob $second (0,10000,1)
move_control_px ($second,420,1)
set_knob_unit ($second,$KNOB_UNIT_DB)
set_knob_defval ($second,6308)
set_knob_label ($second,get_engine_par_disp($ENGINE_PAR_VOLUME,2,-1,-1))
set_text ($second,"second")
make_persistent ($second)
declare ui_knob $group_00 (0,1000000,1)
move_control_px ($group_00,10,100)
set_knob_unit ($group_00,$KNOB_UNIT_DB)
set_knob_defval ($group_00,630859)
$group_00 := _get_engine_par ($ENGINE_PAR_VOLUME,0,-1,-1)
set_knob_label ($group_00,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
set_text ($group_00,"Group 00")
make_persistent ($group_00)
declare ui_knob $group_01 (0,1000000,1)
move_control_px ($group_01,180,100)
set_knob_unit ($group_01,$KNOB_UNIT_DB)
set_knob_defval ($group_01,0)
$group_01 := _get_engine_par ($ENGINE_PAR_VOLUME,1,-1,-1)
set_knob_label ($group_01,get_engine_par_disp($ENGINE_PAR_VOLUME,1,-1,-1))
set_text ($group_01,"Group 01")
make_persistent ($group_01)
declare ui_knob $group_02 (0,1000000,1)
move_control_px ($group_02,340,100)
set_knob_unit ($group_02,$KNOB_UNIT_DB)
set_knob_defval ($group_02,0)
$group_02 := _get_engine_par ($ENGINE_PAR_VOLUME,2,-1,-1)
set_knob_label ($group_02,get_engine_par_disp($ENGINE_PAR_VOLUME,2,-1,-1))
set_text ($group_02,"Group 02")
make_persistent ($group_02)
declare ui_knob $group_03 (0,1000000,1)
move_control_px ($group_03,500,100)
set_knob_unit ($group_03,$KNOB_UNIT_DB)
set_knob_defval ($group_03,0)
$group_03 := _get_engine_par ($ENGINE_PAR_VOLUME,3,-1,-1)
set_knob_label ($group_03,get_engine_par_disp($ENGINE_PAR_VOLUME,3,-1,-1))
set_text ($group_03,"Group 03")
make_persistent ($group_03)
end on

on ui_control ($group_00)
set_engine_par($ENGINE_PAR_VOLUME,$group_00,0,-1,-1)
set_knob_label ($group_00,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
end on
on ui_control ($group_01)
set_engine_par($ENGINE_PAR_VOLUME,$group_01,1,-1,-1)
set_knob_label ($group_01,get_engine_par_disp($ENGINE_PAR_VOLUME,1,-1,-1))
end on
on ui_control ($group_02)
set_engine_par($ENGINE_PAR_VOLUME,$group_02,2,-1,-1)
set_knob_label ($group_02,get_engine_par_disp($ENGINE_PAR_VOLUME,2,-1,-1))
end on
on ui_control ($group_03)
set_engine_par($ENGINE_PAR_VOLUME,$group_03,3,-1,-1)
set_knob_label ($group_03,get_engine_par_disp($ENGINE_PAR_VOLUME,3,-1,-1))
end on
on ui_update
$group_00_volume := get_engine_par($ENGINE_PAR_VOLUME,0,-1,-1)
$group_01_volume := get_engine_par($ENGINE_PAR_VOLUME,1,-1,-1)
$group_02_volume := get_engine_par($ENGINE_PAR_VOLUME,2,-1,-1)
$group_03_volume := get_engine_par($ENGINE_PAR_VOLUME,3,-1,-1)
end on
on ui_control ($first_slider)
set_engine_par($ENGINE_PAR_VOLUME,$first_slider*$first_volume,1,-1,-1)
set_engine_par($ENGINE_PAR_VOLUME,(100-$first_slider)*$first_volume,0,-1,-1)
set_knob_label ($group_00,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
set_knob_label ($group_01,get_engine_par_disp($ENGINE_PAR_VOLUME,1,-1,-1))
end on
on ui_control ($second_slider)
set_engine_par($ENGINE_PAR_VOLUME,$second_slider*$second_volume,3,-1,-1)
set_engine_par($ENGINE_PAR_VOLUME,(100-$second_slider)*$second_volume,2,-1,-1)
set_knob_label ($group_02,get_engine_par_disp($ENGINE_PAR_VOLUME,2,-1,-1))
set_knob_label ($group_03,get_engine_par_disp($ENGINE_PAR_VOLUME,3,-1,-1))
end on
on ui_control ($first)
$first_volume := $first
set_engine_par($ENGINE_PAR_VOLUME,$first_slider*$first_volume,1,-1,-1)
set_engine_par($ENGINE_PAR_VOLUME,(100-$first_slider)*$first_volume,0,-1,-1)
if ($group_00_volume >= $group_01_volume)
set_knob_label ($first,get_engine_par_disp($ENGINE_PAR_VOLUME,0,-1,-1))
else
set_knob_label ($first,get_engine_par_disp($ENGINE_PAR_VOLUME,1,-1,-1))
end if
end on
on ui_control ($second)
$second_volume := $second
set_engine_par($ENGINE_PAR_VOLUME,$second_slider*$second_volume,3,-1,-1)
set_engine_par($ENGINE_PAR_VOLUME,(100-$second_slider)*$second_volume,2,-1,-1)
if ($group_02_volume >= $group_03_volume)
set_knob_label ($second,get_engine_par_disp($ENGINE_PAR_VOLUME,2,-1,-1))
else
set_knob_label ($second,get_engine_par_disp($ENGINE_PAR_VOLUME,3,-1,-1))
end if
end on


----------



## Big Bob (Feb 11, 2013)

Hi Danny,

I'll try to help you if I can but my time for this sort of fun thing is rather limited. 

So I don't have to 'reverse-engineer' your script and try to figure out what you are trying to do, could you explain more precisely what you want the six knobs and two sliders to do? Better yet, why don't you make a new, empty (no samples) instrument containing the groups and such that you want to control, together with your script as it is now. Then attach the .nki to your post along with an explanation of what it is doing now and what you want it to do.

Rejoice,

Bob


----------



## slim boy fat (Feb 12, 2013)

Hey Bob,

thank you very much for your kind respond and offer! I appreciate it very much.
Maybe i will take another approach to explain the situation (as i was re-reading my first post, i realized that it is written quite confusing indeed - sorry for that!)...
I was looking at your BalanceSlider you posted in the thread i linked in my first post.
This little, but great script uses one slider for two groups. Your slider goes from 0 db to mute for the first group and vice versa for the second group. I am looking for a possibility to add a knob, which gives the possibility to set the max-amount for the slider. So if i turn that knob to lets say -6db, that the slider´s new max-value is now -6db instead of 0db. And so that the first group now is controlled from mute to -6db and for the second group its from -6db to mute...
Unfortunately there are several groups i have to deal with - but i think when i have a hint, how to realize it for the first two groups, i can (hopefully) easily adapt it for all the other groups. Do you think that this is possible?
Hopefully i explained myself a little bit better...
My script is still a mess, i have to clean it first a lot before showing it to someone else, i hope thats ok.
Once again many thanks for your effort!

Best greetings, 
Danny


----------



## Big Bob (Feb 12, 2013)

Hi Danny,



> Your slider goes from 0 db to mute for the first group and vice versa for the second group. I am looking for a possibility to add a knob, which gives the possibility to set the max-amount for the slider. So if i turn that knob to lets say -6db, that the slider´s new max-value is now -6db instead of 0db. And so that the first group now is controlled from mute to -6db and for the second group its from -6db to mute...



OK, I think I understand what you are shooting for. As soon as I get a little extra free time, I'll try to post an illustrative example of how you might do this. It may take a few days before I can get to this so hang in there. :lol: 

To be continued ...

Bob


----------



## slim boy fat (Feb 12, 2013)

Hi Bob,

thanks a lot in advance! It´s good to hear that it seems to be solveable.
You are a real life-saver!

happy Danny thanks again! :D


----------



## Big Bob (Feb 13, 2013)

Hi Danny,

Please give the attached demo instrument a test drive to see if this is the sort of thing you wanted to implement. This demo uses a simple control panel with 4 control sets for groups 0/1, 2/3, 4/5, and 6/7 respectively. These groups are of course empty in this demo but you can watch what the group amplifier volume controls do when you adjust the Volume or Balance. Or, if you want, you can load some samples into a pair of groups and give a listen.

While this demo just assigned the groups contiguously, the source code is written to allow you to easily assign groups to the control sets in any scrambled order you wish. The source code also allows you to declare any arbitrary number of such control sets. Currently I have limited the max number of control sets to 10 but you can easily change that by changing the constant named* MaxPairs*. 

I wasn't sure how you wanted to display the crossfade setting when it changes. For example you could just display 0..100% or something like that but I thought that might be a little ambiguous. See what you think of the way I did it.

For the Volume knob, the max is of course +12dB but I wasn't sure what you might want for a minimum so, I set it at -20dB. However you can also easily change this by changing the constant named *MinVo*l.

If this .nki functions the way you wanted, then take a look at the commented source code and see if you can follow it well enough to customize it to your specific application. If not, please let me know and I'll try to clarify it for you. 

On the other hand, if I didn't quite hit the mark, let me know and maybe I can modify the script a little to make it the way you actually wanted it, provided of course that I didn't *totally* miss the mark :lol: 

Rejoice,

Bob

BTW The *VR_to_ep* function is now *epVR* in V450 of the Math Library. It functions the same way as *VR_to_ep* but the syntax is a little different as you can see by examining the source code.


----------



## slim boy fat (Feb 14, 2013)

Hi Bob,

wow! :shock: 
Thank you so much for your script! It is really amazing!
And also that you created it so fast...i didn´t expect it even this week!
It really fits my needs more than perfect and your display of the balance (40%/60%) is unbeliveable!
When my instrument is done, i would like to thank all the individuals, who helped me.
And at least now you belong to that people...so would it be ok for you, if i mention you too? (Don´t know if you prefer your forum-name or -if you are ok with that afterall- your real name?)
Just one more questions (not really related to this subject):
As this is my first script/instrument i am quite shure that there are some unnecessary and clumsy written codes in it. When i am done with the interface/GUI i wanted to look for someone skilled who reviews my code. My first thought was that i will look for someone in Germany (maybe even Berlin), because it would make an easier communication. But as you are already helping me and a very good scripter, i wanted to ask you...
There would be just one big hook! As i am working on that instrument for some month now, my income is accordingly low/nothing right now. And the only way to pay someone that job is to ask him for the favour to be paid, when the first money from selling that instrument comes in. I know that this is a big favour, as it is definitely risky (I even don´t know if that instrument will sell...) My only chance to convince somone is to make some kind of contract, where all this is written down. Also that person would have my address and my complete code, if thats something like an insurance :? 
You said that you don´t have much free time, so (with all the bad circumstances i mentioned) i think you will probably pass. But i wanted to ask you first, before i make an official request...
If you are interested, we can exchange more details.

But nevertheless you helped me so much with your script!
Once again many thanks!

Have a nice day,

Danny


----------



## Big Bob (Feb 14, 2013)

Hi Danny,



> It really fits my needs more than perfect and your display of the balance (40%/60%) is unbeliveable!



I'm glad you like the way I did it but, I'm even happier that it was functionally what you wanted it to be. :D 

But you haven't said anything about whether or not you think you can easily adapt it to your specific situation? I mean do you understand the source code well enough that you can select the precise number of control sets you want and position them where you want them on your panel, etc. In other words were the comments sufficient that you can now take this over and integrate it into your project? 

If you do have any questions, it would be easier for me to answer them now while it's fresh in my mind. I'm an old goat and my memory fades fast. :lol: So if you ask me something about this script a month from now, I probably won't be able to answer you easily :roll: 

As to 'reviewing your code' it would depend on how big of a job that turns out to be and how much time I'll have available at that time. It really has nothing to do with your budget because earning money is of no interest to me, the Lord has already supplied all my needs in that area. Think of me as being independently wealthy :lol: 

However, my health state is rather fragile and I never know from one day to the next whether I can accomplish what I set out to do. I just try to help others when I have the energy, there's no schedule pressures, and I find the project interesting. So it might be in your best interest if you can find someone else that will be more dependable. But I wish you every success with your project and please let me know if you have any questions about the scripting I did.

God Bless,

Bob


----------



## slim boy fat (Feb 14, 2013)

Hey Bob,

yes, I didn´t mention the source code, because I immediately tried out your completed version first and now had a look at your source code.
I successfully added the desired amount (and panel-structure) of the pairs for my needs. I think that it will be also quite easy to change the positions of the sliders after generating the code with the KSPEditor, I will have to check this out later (but the pixel-accourate definition of the slider is visible in the final script, so this should work).
I also tried to combine fragments from your MathLibrary some weeks ago, but as "Use old compiler version" was active in the editor, I always ran into errors (sometimes its good to read a little bit more, to avoid stupid mistakes like this). :roll: 

So now everything works fine, but there is actually one question:
Is there a possibility to set the MinVol to a value, that makes the Volume-Knob behave like an ordinary one? I mean that the lowest value would be -infintiy (I don´t know how to say this, but the normal Volume-Knobs start from minus infinity and the first real value that comes up is -171,4 dB). 
I am asking, because there are several other Volume-Knobs in my script (that control only the Volume of only one group) and I created my own knobs - so that all of them together have the same "direction", when set to 0 dB.
I hope i expressed myself well enough so that you understand what I mean... 
I tried several MinVol-values, but nothing worked out yet, but maybe I find a good solution.

Also I wanted to express my sympathy for your health state, thats really sad to hear!
That you still do stuff like this, impresses me even more! At least you have your living without the trouble that often comes along, when you struggle with money-stuff...

Last year was also a quite bad year for me regarding my health. But fortunately the reason was found after a really long search - in the end it was a bad tooth that should have had removed years ago, but so I "poisened" myself for quite a while...
I just tell people about this, so that they are aware of things like that.

Your help was already so generous, that it is hard for me to ask you that...
The instrument I am creating is still in progress and I don´t have a fixed day for releasing it or so - I am also still recording and doing the graphics for the GUI.
So if it would be ok for you, I would like to send you my instrument and if your time and health allows it, maybe you can have a look at it?
It is still work in progress, but I hope that you understand that i would prefer it, when I can email it to you. 
So if you like, send me a private message with your email and I will send you the NKI along with some explanations and the graphic (so that you can see, how it should be in the end). I think that it is (hopefully) an interesting project, as it has more to do with post-productions of films than with musical instrument.
With the help of your script, nearly everything is done feature-wise, now its time to set the controls and re-arrange some groups.

But I can understand absolutely when you say no...
As I said: it is nearls too much to ask for!

Thank you so so much, Bob.

All the best for you,

Danny


----------



## Big Bob (Feb 14, 2013)

Hi Danny,

I wondered about the *MinVol* thing but then decided maybe you just wanted a typical audio work range. I guessed wrong :lol: 

If you actually want the volume knob to look like all the others, I will have to modify the script for you. This may take a few days depending on how my other work flow is progressing.

I want to also point out a few things about moving the controls around on the panel. When you create a control set (by control set I mean the knob, slider and the pair of labels used for each crossfade pair), you specify the pixel coordinates for the x,y position as two of the parameters when you invoke the macro named *declare_pair*. These coordinates are for the Vol knob which of course sits at the top of the control set. The macro takes care of positioning the other controls in the set relatively to the knob.

Also, keep in mind that when you create a control set, you must assign an *index* to it (the first macro parameter) which is used internally to both name the controls and as a means of runtime referencing. The only other place you need to use this index is when you use the *on_pair_change* macro to build the corresponding callback handlers. 

The index parameter you supply to the macros must be specified as a *literal* constant (such as 1 or 8 or 4), ie you cannot use a variable or named constant for this parameter. However, even though the demo assigns these indices in order from 0 to 3, you need not assign these indices in any special order. They must however lie in the range from 0 to *MaxPairs* - 1. With *MaxPairs* defined as 10, you must specify your indices in the range from 0 to 9. However, you can easily increase this range by just editing the *MaxPairs* constant.

I'll get back to you with the Volume knob change as soon as I can. Meantime if you want to email me, please PM me with your email address and I will send you a return email with mine.

To be continued ...

Bob


----------



## slim boy fat (Feb 14, 2013)

Hi Bob,

I think it´s to other way around...


> I wondered about the MinVol thing but then decided maybe you just wanted a typical audio work range. I guessed wrong Laughing


If have to apologize for a just assuming instead of mentioning.
The fact that there are some more single-grouped Panels and all the Volume-Knobs for the Groups on this page shall show the Volume in the same way was unfortunately kept in my head! Sorry for causing you double trouble... :( 
When I see your scripting-skills and knowledge, I get the feeling that there are so many things to learn in order to create a good and short code. And i thought that I scooped nearly all you can do with the KSP. >8o 
But there are so many clever ways to code hughe processes into smaller functions.

The things with MaxPairs and the index i figured out, that was comprehensible for me.
Fortunately your MaxPairs of 10 fits perfect, as I am having exactly 20 groups that needed to be paired (00-19). The rest of the 7 groups on this page are single ones, so thats perfect.
I attached a picture with the modified script.
I will take a closer look at the positioning of the control sets. This whole script is a really great way to learn a lot (I bought a book about KSP Scripting, but this is so much better!  Much appreciated!
And please take your time with the Knob-Volume!

I try to create a comprehensible version of the current instrument and a documentation. But I assume that this will also take some days, I guess.

Thanks again, I am already really happy!

Have a nice day,

Danny


----------



## Big Bob (Feb 14, 2013)

Hi Danny,

Looking at your control panel above I see you have used some rather wide captions that don't fit in the allowable label width (such as Groups 18/19). There are several ways you can fix this.

(1) Use shorter captions like maybe name it Grps 18/19, etc.

(2) Remove the ornamental prefix and suffix in the declare_pair macro, I think it's line 77 which currently looks like this:

```
set_text(Cap_#index#,'- ' & caption & ' -')  { vol/bal caption }
and change it to:      set_text(Cap_#index#,caption)  { vol/bal caption }
```

(3) Widen the label used for the caption.

Choice (1) Suffers from less clarity and (3) has the disadvantage of making it wider than the other controls in the vertical stack and therefore may be more limiting in how close you can put the stacks to each other.

So, I think for your specific situation, Choice (2) would be the best solution. So if you like I will change it in the next version I send you with your requested Volume knob changes. But, you might like to get your feet wet and try editing your copy in the meantime :lol: 



> Thanks again, I am already really happy!



I'm always glad when I can make someone happy :wink: 

Rejoice,

Bob


----------



## slim boy fat (Feb 14, 2013)

Hi Bob,

I forgot to say that the picture just shows the current status.
In the end I have to put the description/name of the group not into a label, I have to put it fixed in the background, because some of the groups have quite long names.
So I think finally there is even no need for me to use that labeling.

But nevertheless thanks for the hint and the 3 (!) solutions!  

I will hurry on the documentation for my script - a lot will be much clearer then, I hope. 

All the best,

Danny


----------



## Big Bob (Feb 14, 2013)

If you are going to caption the control sets on your wallpaper, it might still be best to remove the ornamental prefix/suffix. Then, you can just change the caption text to null (ie '') when you have the wallpaper ready. This will simply put a transparent placeholder where the caption label is now. Of course if you want to just drop the label caption enitrely you can also edit the macro and reposition the other three controls as desired.

However, it might be convenient to keep the caption label so that you can use it temporarily to identify things when the wallpaper isn't present. So, in the next version I'll just remove the prefix/suffix and then you can just use an empty string for the caption when you don't want to see it.



> I will hurry on the documentation for my script - a lot will be much clearer then, I hope.



Don't hurry on my account, it probably won't affect anything I'm going to do. I expect to have a little block of time tomorrow so I'll probably post a revised script sometime before the end of the day (the Good Lord willing).

Rejoice,

Bob


----------



## Big Bob (Feb 15, 2013)

Hi Danny,

Take the attached demo (using V101 of the script) for a test drive and see if this is now what you want regarding full-range Volume control. The code logic used with V100 of the script couldn't be extended to full-range volume control so I had to change the technique a little. Some of the new code is a little trickier to understand so I added some additional comments. But, as always, if you can't decipher something, please let me know.

God Bless,

Bob


----------



## Big Bob (Feb 15, 2013)

Whoops!

I just realized that I failed to round the conversion from mdB to dB in the Show_dB routine in V101. Here's a revised script, V102 that corrects this error. Both V101 and V102 should work OK it's just that the Volume knob display doesn't track quite as accurately with Kontakt's when no rounding is used.

Sorry about that :oops: 

Rejoice,

Bob


----------



## slim boy fat (Feb 24, 2013)

Hi Bob,

i think i adjusted something wrong in my Control Panel for this forum, because i did not receive a mail when you answered. Sorry for my late answer!
Thanks you so much for the revised script - everything is working like a charme!
Unbelievable your skills. I am happy to say that i digged into your script during the last days and i understood quite some stuff, so that i could use your script to add the corresponding graphics. That´s so amazing to define things in your way, it makes things so easy and relieable. When i look at my script, i am feeling like i could spend two more years to improve it... :( 
I am nearly done with the GUI, there appeared unfortunately some bugs that i have to fix. But i don´t think that it has something to do with the implementation of your code into my script.

I will let you know, when its done.

I attached a picture, so that you can see the result of your wunderful lines!
Now all the knobs look the same and give the same value (have the same behavior).

Once again, so many thanks Big Bob - you helped me so much!
Very much appreciated!

Have a nice day,

Danny


----------



## Big Bob (Feb 25, 2013)

Hi Danny,



> Thanks you so much for the revised script - everything is working like a charme!



Glad I could help. And, I'm so glad to see that you are OK. I was beginning to think that something bad may have happened to you.

Rejoice,

Bob


----------



## slim boy fat (Feb 25, 2013)

Hey Bob,



> I was beginning to think that something bad may have happened to you.


Thank you for your thoughts! Thats very nice of you.
Honestly: i was in quite the same situation..  
When i mis-adjusted my settings ("Send me an e-mail when a reply is posted") and there came no mail for days, i was some kind of hoping that you are also doing fine, since there were ("obviously") no new messages from you.
I just found your answer, when i directly browsed this forum two days ago...
So to say i am also glad to see that you are ok. :D 

Btw, the image makes more sense with the background, but it shows at least the successful usage of your script.

If i could, i would take you out for a beer at least, but so it´s digital for the moment.

o-[][]-o 

Thank you!
Have a nice day and all the best to you,

Danny


----------



## slim boy fat (Feb 26, 2013)

Hi Bob!

One last thing occured to me.
I think it´s just a small thing, as i am overlooking something obviously.
As you may have seen on the picture, i am using my own knobs and sliders.
Therefore i need an extra label in order to show the Volume of the groups.
This is working so far, but only for the first four groups (your setup from your script) correctly.
My other 6 groups are also showing the amount, but in a different way.
And i can´t figure out why and it drives me nuts that i miss that point...
I tried several things, but nothing worked out so far.
Could you maybe have a look at my script and eventually you will see what i don´t... 
o 
I guess it´s (hopefully) just one line i am missing.

Thanks a lot!

When this is working, i think i am almost done.
The gui is also nearly finished and the bugs are also fixed.
Disregarding that my code is years away from being good, the instrument is working so far and that makes me really happy!
0oD 
I am confident to write some lines in the doc this week also, so i will let you know when i am done.

Have a nice day Bob!

Thank you,

Danny


----------



## Big Bob (Feb 26, 2013)

HI Danny,

I haven't had time yet to study your edited script but I loaded it into K4 and looked at its behavior. I'm not sure I understand what you have said in your last post about some difference between the first 4 volume sliders and the remaining 6. They seem to work the same here, at least superficially.

It might help if you emailed me your knob and slider graphics so I can see the panel as you see it. But, maybe you should point out specifically what you think is different about the first 4 groups and the last 6.

It may be several days before I can take the time to examine your script but in the meantime why don't you PM me with your email address. Then I'll send you mine and you can then email me your graphics. Do you also have your wallpaper ready? If so, it might also help for me to have that so I can see everything in context. 

I also should tell you that whenever you modify someone else's script you should clearly identify it as such with some additions to the header comments. You can use something as simple as: Original Script Modified by Danny on 2-21-13, last revised 2-26-13. Otherwise things will get very confusing very fast.

Rejoice,

Bob


----------



## slim boy fat (Feb 26, 2013)

Hi Bob,

yes you are right that a was pretty unspecific in my previous post.
I am really sorry for that!
:oops: 
So to (hopefully) clearify my thought:
The first four volume-sliders always show their value. When they are set to zero, the corresponding text-labels show that value (-oo) and the first very low values (-94.3) are also visible.
And that´s the difference to the other 6 volume-sliders:
Here, the corresponding text-labels (that i inserted) get invisible when the slider reaches a too low value.
I think it maybe has something to do with 
{ Below -60dB, 'ping' left group to use Kontakt's formatting }
because the last visible value shown in the text-labels is (-58.3) and then the values disappear, when setting the volume-slider to zero...

I am still looking for an answer and so as soon as i found a solution, i will let you know.

Thank you Bob,

Danny


----------



## Big Bob (Feb 26, 2013)

Ok I know what your problem is related to then. This is a rather tricky area so maybe you shouldn't spend too much time on it now until I can help you a little. But meanwhile, *I still want your graphics* so PM me with your email address ASAP.

Rejoice,

Bob

BTW what is the little button or indicator to the left of each volume knob? Since there is one of those for each xfade pair, you should probably include it in the declare_pair macro. That way, it will automatically be positioned relative to the upper-left corner of the control set. And since you have rearranged the ordering of the slider relative to the knob, the Balance slider should probably be assigned at X,Y now instead of the Volume knob. I'll have a better picture of this once I have your graphics in hand.

Also, have you considered labeling the Volume knob similarly to the Balance slider with a caption below it that reads 'Volume' until changed and then displays the dB setting or does your wallpaper provide the 'Volume' caption.

This whole thing will be a lot clearer to me when I see your graphics so get them to me soon.


----------



## slim boy fat (Feb 26, 2013)

Hey Bob,

i am really sorry that my PMs did not reach you...i don´t know whats going on!
I already sent you three PM, but obviously none of these reached you. (?)
Have a look at the attached picture - it shows my Outbox with the messages.
Maybe there is something wrong with my settings, i have to take a look at the User Control Panel again.

So as this is not really working, here is it for digital messages:



When we write each other via email, i will edit this post and delete the line above, to avoid spam-roboters.

Again, please excuse the miscommunication. :( 

If everything goes wrong, have a look at my website: www.tonage.de
There is also a possibility to send emails...

Thanks,

Danny


Edit:

The buttons are used to allow/disallow the corresponding groups (first button for the groups 00 and 01, the second for 02 and 03). 
They are created by hand in the "old part" of my script, but thats ok for me.
Your idea to use the same text-label to show "Volume" and then the value, when it is changed, is really good.
I will have a look at your script therefore.

Thanks for the input!


----------



## Big Bob (Feb 26, 2013)

Hey Danny,

I just took another look at the behavior of your script and I don't see the problem you just described. :roll: 

I wonder, does your test instrument have groups above the first 4? In order for the 'ping' to work properly, there has to be an instrument group (even if empty) because the script reads the volume knob setting for the left group from Kontakt (for volume levels below -60dB.

I'm testing here with a simple, sample-less default instrument but I added 19 empty groups to bring the total up to 20 groups.

to be continued ...


Bob

EDIT: Evidently, I'm having the same forum issues as you :lol: I just now 'discovered' 3 PMs from you that I didn't get notified of. I already sent you my email address so you can edit your post because I have your email address in my book now.


----------



## slim boy fat (Feb 26, 2013)

Hey Bob,

this was my problem:


> I wonder, does your test instrument have groups above the first 4


I am so stupid!!!
The test-instrument for your script was using just 8 Groups and i added all the controls etc. without adding the appropriate groups! :x 

After checking with the reight amount of groups - everything works all right.
I am so sorry for causing so many trouble - but thats the problem of being a beginner - you sometimes do not see the obvious!

Many many thanks Bob!

Oh, is just get your message.

All the best,

Danny


----------



## Big Bob (Feb 26, 2013)

Glad that fixed your issue but, *I still want your graphics * :lol:


----------



## ScoringFilm (Mar 4, 2013)

Hi Bob,

Took an interest in this script, however when I come to compile the script I get an error message:



> Syntax error (line 1247)
> 
> else
> 
> KSPMathV450.txt: 2405



Regards,

Justin


----------



## Big Bob (Mar 4, 2013)

Hi Justin,

If you are referring to the script I posted, *XFadeDemoV102*, it compiles without error for me.

Are you using V152 of the KSE? Do you have V450 of the Math Library alongside the XFadeDemeV102 when you compile it?

Are your KSE options set correctly?

*Use old compiler version* must be *Unchecked* (and the the KSE must be reloaded if you had this setting checked previously).

*Compact outpu*t should be checked
*Optimize compiled cod*e should be checked

Rejoice,

Bob


----------



## ScoringFilm (Mar 4, 2013)

Hi Bob,

I was using Nils Editor v1.5.1; after I installed v1.5.2 the error message is no longer.

Great script (as usual)!

I wonder if it would be possible for this to be adapted/modified so that when the balance slider is moved from left to right:

groups a,b,c x-fade from zero up to the set (max) volume for those groups

and groups x,y,z x-fade from a separate (max) volume down to zero.

Regards,

Justin


----------



## Big Bob (Mar 4, 2013)

Of course it would be possible :lol:


----------

