# Ignore Sustain pedal



## Chaim (Aug 7, 2012)

Hi,

Can I set up a patch in Kontakt 5 so that the patch ignores the incoming cc64 [sustain]?

Thanks so much.

(I'm trying to set up a split keyboard of bass and piano)


----------



## Chaim (Aug 7, 2012)

OK snatched the answer from NI's site.

I found a script there and modified it, and it works.



```
on init  
  declare polyphonic $id    
  declare const $SUSTAINED := $MARK_26
  SET_CONDITION(NO_SYS_SCRIPT_PEDAL) 
end on

on note       
  { sustained generated note played using first group (group 0) }
  disallow_group($ALL_GROUPS)

  $id := play_note($EVENT_NOTE, $EVENT_VELOCITY, 0, 0)    
  
  { unsustained incoming note played using all groups except the first group (group 0) }
  allow_group($ALL_GROUPS)

end on

on release
  { if sustain pedal pressed }
  if (%CC[64] >= 64)
    set_event_mark($id, $SUSTAINED)    
  else
    note_off($id)
  end if  
end on

on controller  
  { if sustain pedal released }
  if (%CC_TOUCHED[64] # 0 and %CC[64] < 64)  
    note_off(by_marks($SUSTAINED))
  end if
end on
```


----------



## Raptor4 (Aug 7, 2012)

> Can I set up a patch in Kontakt 5 so that the patch ignores the incoming cc64 [sustain]?


Yes, here is the simplest code if you want to ignore a given CC# totally:

```
on controller
if($CC_NUM=64)
ignore_controller
end if
end on
```
Regards,

R4


----------



## Chaim (Aug 7, 2012)

Thanks so much.


----------

