Sample drop NKA Problem

Options
Reylon
Reylon Member Posts: 23 Member
edited May 2022 in Scripting Workshop

Hi guys,

This is one of the hardest things I'm trying to figure out.

Im using the sample drop feature with a NKA file browser and im trying to save/load the the samples. For now the script will clear any sample as soon as the NKA is loaded. I assume its because of the call functions.

The code is just an overview to see if you can point me on the right direction.

  declare @samplePath
  @samplePath := get_folder($GET_FOLDER_PATCH_DIR) & "MultiSampling/"
  make_persistent(@samplePath)




on persistence_changed
  call MULTISAMPLING
  call MULTI_CLEAR

  if (is_zone_empty(%NI_USER_ZONE_IDS[61]) = 0)
  call SampleAdded__Keyboard_Range_Label
  end if

  if($ClearKeyboardRange = 1)
  call ClearKeyboardRange
  end if
  $ClearKeyboardRange := 0
end on




on ui_control ($Keyboard_Range)
  if ($NI_MOUSE_EVENT_TYPE = $NI_MOUSE_EVENT_TYPE_DRAG)
  message("MOUSE OVER CONTROL: " & $NI_MOUSE_OVER_CONTROL)
  end if
  if ($NI_MOUSE_EVENT_TYPE = $NI_MOUSE_EVENT_TYPE_DROP)
  if (num_elements(!NI_DND_ITEMS_AUDIO) = 1)
  wait_async(set_sample(%NI_USER_ZONE_IDS[61], !NI_DND_ITEMS_AUDIO[0]))
  @samplePath := !NI_DND_ITEMS_AUDIO[0]
  call SampleAdded__Keyboard_Range_Label
  end if
  end if
  %preset[1015] := $Keyboard_Range
end on


on ui_control($ClearKeyboardRange)
  if($ClearKeyboardRange=1)
  call ClearKeyboardRange
  end if
  $ClearKeyboardRange := 0
  %preset[1016] := $ClearKeyboardRange
end on





on async_complete
  if ($NI_ASYNC_ID = $load_arr_id)
  $load_arr_id := -1
  if ($NI_ASYNC_EXIT_STATUS = 1)
  call MULTISAMPLING
  call MULTI_CLEAR
  end if
  end if
  if ($NI_ASYNC_ID = $save_arr_id)
  $save_arr_id := -1
  $Save := 0
  end if
end on


Answers

  • Reylon
    Reylon Member Posts: 23 Member
    Options

    Also the loaded sample will be always the last one used...bummer

    Please let me know if anyone can help with this

Back To Top