# Changing source from DFD to TimeMachine Pro



## BRUNO VALENTI (Jun 12, 2018)

Hi everyone,
Glad to be part of this group!
I am pretty new in the Kontakt editing world so please forgive me if I am making a silly question.

I am trying to edit some Patches from Kontakt. To be specific, what I am trying to do is to change the Source from DFD to Timemachine Pro. I was able to do it in some patches but in most of them this is the message that I receive (see image).

Does anyone knows how can I fix this? I am pretty newbie to this one so if you can explain step by step that will be super appreciated!

Thanks a lot in advance!

Bruno


----------



## P.N. (Jun 12, 2018)

Hi, there. Welcome to the forums.

Your instrument has lots of groups and either:

- Has some sort of control (menu, file selector, etc) that loads/unloads groups (that's what the purge means);
- Or the instrument is part of a larger set of NKIs and contains unused groups.

If you can access the script, go on to "on_persistence_changed" and add this line after everything else:

(You'll need an iterator type variable, in the example - "$count")


```
$count:=0
    while($count<$NUM_GROUPS)
        purge_group($count,1)
        inc($count)
    end while
```

After this, you may select all groups, change them all to TMP, and delete the temporary code from the script.


If you can't access the script, you need to "load" each individual group (or sets of groups - that will depend on the script) in order to be able to change it into TMP.

If the script doesn't allow this (and the groups are just unused remains from other NKI), you can still play some notes and see which groups are activated so that you can go, one by one, change them into TMP.
(You'll have to turn off "Edit all groups" for either case.)

Hopefully you can sort all this out.

Best regards,

Paulo.


----------



## EvilDragon (Jun 12, 2018)

I have made a simple (Un)Purger! script exactly for this sort of stuff. Put it in an empty script slot, then choose if you wanna (un)purge a single group or a range of groups, then do your thing.


```
on init
   set_script_title("(Un)purger!")

   declare const $MAX_GROUPS := 4096

   declare $i
   declare !txt[2]
   !txt[0] := "Mode: Single"
   !txt[1] := "Mode: Range"

   declare ui_button $Mode
   declare ui_button $Purge
   declare ui_button $Unpurge
    declare ui_value_edit $Start (0,$MAX_GROUPS - 1,1)
    declare ui_value_edit $End (0,$MAX_GROUPS - 1,1)

   $End := $NUM_GROUPS - 1

   move_control($Start,2,2)
   move_control($End,3,2)

   set_text($Mode,!txt[$Mode])
   if ($Mode = 0)
       set_text($Start,"Group")
   else
       set_text($Start,"Start")
   end if
   hide_part($End,16 * (1 - $Mode))

   set_listener($NI_SIGNAL_TIMER_MS, 100000)

   message("")
end on


function PurgeMode()
   set_text($Mode,!txt[$Mode])
   if ($Mode = 0)
       set_text($Start,"Group")
   else
       set_text($Start,"Start")
   end if
   hide_part($End,16 * (1 - $Mode))
end function


on listener
   if ($NI_SIGNAL_TYPE = $NI_SIGNAL_TIMER_MS)
       if ($Purge = 1)
           $Purge := 0
       end if

       if ($Unpurge = 1)
           $Unpurge := 0
       end if
   end if
end on


on ui_control ($Mode)
   call PurgeMode()
end on

on ui_control ($Purge)
   if ($Mode = 0)
       purge_group($Start,0)
   else
       $i := $Start
       while ($i <= $End)
           purge_group($i,0)
           inc($i)
       end while
   end if
end on

on ui_control ($Unpurge)
   if ($Mode = 0)
       purge_group($Start,1)
   else
       $i := $Start
       while ($i <= $End)
           purge_group($i,1)
           inc($i)
       end while
   end if
end on

on ui_control ($Start)
   if ($Start >= $End)
       $End := $Start
   end if
end on

on ui_control ($End)
   if ($End <= $Start)
       $Start := $End
   end if
end on
```


----------



## BRUNO VALENTI (Jun 12, 2018)

Wow guys!
Thank you very much for the very soon reply!
You are the best!

I tried to edit the script but for some reason is not letting me doing it. I am sure that I am doing something wrong :/
Do I have to do it from the same Kontakt or I have to edit the .txt?

Also, I am not sure if I have to edit Note Handler, Sample Handler, Function Handler, etc (image attached).

Also, I Couldn´t find the "on_persistence_changed". I am sure that I am not looking on the right place.

Sorry for these questions but I am soooo beginer on this..

I REALLY APPRECIATE ALL YOUR SUPPORT!!


----------



## BRUNO VALENTI (Jun 12, 2018)

EvilDragon said:


> I have made a simple (Un)Purger! script exactly for this sort of stuff. Put it in an empty script slot, then choose if you wanna (un)purge a single group or a range of groups, then do your thing.



Actually I was able to put it in an empty slot but is still giving me the same error :/


----------



## BRUNO VALENTI (Jun 12, 2018)

Thanks guys! Apparently I did it  

You are the best!! )))))


----------



## Consona (Dec 25, 2018)

EvilDragon said:


> I have made a simple (Un)Purger! script exactly for this sort of stuff. Put it in an empty script slot, then choose if you wanna (un)purge a single group or a range of groups, then do your thing.
> 
> 
> ```
> ...


I tried to use this script on CineSamples libraries since I get the "this group contains purged samples playback mode cannot be changed" message when trying to switch from DFD to Time Machine Pro, but without any success although it looks like it works. Is there any way to make the switching from DFD to TMP work? What's the problem when the message appears. I tried some small Soundiron libraries and it changes those modes no problem.


----------



## EvilDragon (Dec 26, 2018)

That script should work regardless of library. What you could also try is bypassing all other existing scripts before you add the (un)purger script.


----------



## BRUNO VALENTI (Mar 20, 2019)

Hi everyone! The (un)purger script worked great!

The only problem with it is that some patches that used to weight around 60mb now are around 600mb :/

The goal of unpurging is to make the Time Machine 2 possible in certain patches.

Question is: Is there anyway of going back to the purged version once I processed it with the (un)purger script?

If I press the "purge" button it gets rid of everything.

Thanks a lot in advance!


----------

