# How to make the loop work ???



## jorgefernando86 (Sep 23, 2020)

Hello friends
I have tried many times to use $ LOOP_PAR_START to configure the beginning of the loop, which will be variable. However, in all my attempts the loop did not obey the commands and always starts from 0 (zero).
Does anyone have any sense of how to make this work??


----------



## EvilDragon (Sep 23, 2020)

Did you first enable the loop in code?


----------



## jorgefernando86 (Sep 23, 2020)

EvilDragon said:


> Did you first enable the loop in code?




Hello Would it be this way? 


> on init
> declare ui_button $start
> declare $zone
> $zone:= find_zone("BAIXO MAIOR E MENOR")
> ...


----------



## soundtrax (Sep 24, 2020)

It works only with user zones - at least that's what the KSP manual says.


----------



## EvilDragon (Sep 24, 2020)

Yes, only works with user zones.


----------



## jorgefernando86 (Sep 24, 2020)

soundtrax said:


> It works only with user zones - at least that's what the KSP manual says.





I don't understand when you say "user zone". Is it a specific callback? Do I need to specify in any way? I did not find anything that specifies user zone in the manual ....
And the way I put the code just doesn't work.


----------



## jorgefernando86 (Sep 24, 2020)

EvilDragon said:


> Yes, only works with user zones.





I don't understand when you say "user zone". Is it a specific callback? Do I need to specify in any way? I did not find anything that specifies user zone in the manual ....
And the way I put the code just doesn't work.


----------



## EvilDragon (Sep 24, 2020)

Read KSP reference, it is mentioned over there.


----------



## soundtrax (Sep 24, 2020)

And maybe check out the new KSP factory script "Single Sample Drop". Every step is really well explained / commented in this script.


----------



## jorgefernando86 (Oct 1, 2020)

EvilDragon said:


> Read KSP reference, it is mentioned over there.



I understand that I have to declare in the user zone "set_num_user_zones", and that with that I must use the% NI_USER_ZONE_IDS [] array ...
However nothing happens ... I tried it in different ways ... the last one I used was this one. Does anyone have any idea how to fix these codes?


> on init
> make_perfview
> 
> declare ui_button $start
> ...


----------



## jorgefernando86 (Oct 1, 2020)

soundtrax said:


> And maybe check out the new KSP factory script "Single Sample Drop". Every step is really well explained / commented in this script.



I understand that I have to declare in the user zone "set_num_user_zones", and that with that I must use the% NI_USER_ZONE_IDS [] array ...
However nothing happens ... I tried it in different ways ... the last one I used was this one. Does anyone have any idea how to fix these codes?


> on init
> make_perfview
> 
> declare ui_button $start
> ...


----------



## soundtrax (Oct 1, 2020)

You actually need to declare some more user zone parameters to make it work. If you need one group for each sample, something like this would work:

```
set_num_user_zones(3)
$i := 0
while ($i < $NUM_GROUPS)
set_zone_par(%NI_USER_ZONE_IDS[$i], $ZONE_PAR_GROUP, $i)
set_zone_par(%NI_USER_ZONE_IDS[$i], $ZONE_PAR_LOW_KEY, 0)
set_zone_par(%NI_USER_ZONE_IDS[$i], $ZONE_PAR_HIGH_KEY, 127)
set_zone_par(%NI_USER_ZONE_IDS[$i], $ZONE_PAR_LOW_VELO, 1)
set_zone_par(%NI_USER_ZONE_IDS[$i], $ZONE_PAR_HIGH_VELO, 127)
set_zone_par(%NI_USER_ZONE_IDS[$i], $ZONE_PAR_ROOT_KEY, 60)
inc ($i)
end while
```

And you will also have to specify the paths and file names of the samples you want to load into the user zones.


----------



## jorgefernando86 (Oct 1, 2020)

soundtrax said:


> You actually need to declare some more user zone parameters to make it work. If you need one group for each sample, something like this would work:
> 
> ```
> set_num_user_zones(3)
> ...



Hi
Did it work with you?
Not with me yet. I'm going to add the file, in case you want to hear what I'm trying to do. I need to make this sample become a loop, and its start and duration are variable.
Thank you in advance !!!



> on init
> make_perfview
> 
> declare ui_button $start
> ...


----------



## soundtrax (Oct 1, 2020)

- You should start with a fresh nki (don't manually load your sample in a group/zone)

- If you want to use TM-Mode, you should select it in the source module, not in the wave editor (doesn't work).

If you add this after you set up the user zones, the nki will load the samples into the user zones. For zone 0 for example:

```
set_sample(%NI_USER_ZONE_IDS[0], "Vi control test Samples/BAIXO MAIOR E MENOR.wav")
```

- You must save the nki (patch only) , because it will look for the sample in a folder called "Vi control test Samples" next to the saved nki.

- I'd also recommend to switch to "List View" in the Mapping Editor, to see if the sample is actually loaded.

- The loop mode and loop points script lines will only work if you put them after the load samples line.


----------



## jorgefernando86 (Oct 10, 2020)

soundtrax said:


> - You should start with a fresh nki (don't manually load your sample in a group/zone)
> 
> - If you want to use TM-Mode, you should select it in the source module, not in the wave editor (doesn't work).
> 
> ...




I swear I still haven't managed to make it work this way ... I've been looking for other random ways to do it. But this one that would be the most ideal I could not make it work !!! I'm even sad about this situation.


----------



## soundtrax (Oct 10, 2020)

Sorry to hear that you couldn't make it work - but your script with the added set_sample line actually works here:


----------



## jorgefernando86 (Oct 15, 2020)

soundtrax said:


> Sorry to hear that you couldn't make it work - but your script with the added set_sample line actually works here:


@soundtrax you are simply a GENIUS !!!
I created a new NKI and put the codes as you indicated and it WORKED PERFECTLY !!!
Thank you so much friend !!!
Based on your guidance, I managed to advance a lot in my project and move forward in several stages. However, an unknown factor occurred to me ... I need to make the beginning of the loop and consequently the sample alternate according to the result of "$ played_chord / 12". Since the value of this variant is declared in “on note”, however, if I bring the code “set_loop_par (% NI_USER_ZONE_IDS [find_group (" Low ”)], 0, $ LOOP_PAR_START, 0” for this region seems to lose its function. ..
Summing up...
How do I get the start to receive the desired variation?

Thank you in advance !!!

```
on init

    declare $bass
    declare $drum_1
    declare $nota_0
    declare $lm
    declare $ll
    declare $ls
    $ls:= 11190000
    declare $tom
    declare $i
    declare $j
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}
make_perfview
declare ui_label $gp(2, 1)
declare ui_label $chord_name(2, 1)
declare ui_switch $start
declare ui_knob $TEMPO(40,240,1)
make_persistent ($TEMPO)
read_persistent_var($TEMPO)
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}

set_text($chord_name,"")
declare !note_names[12]
!note_names[0] := "C"
!note_names[1] := "C#"
!note_names[2] := "D"
!note_names[3] := "D#"
!note_names[4] := "E"
!note_names[5] := "F"
!note_names[6] := "F#"
!note_names[7] := "G"
!note_names[8] := "G#"
!note_names[9] := "A"
!note_names[10] := "A#"
!note_names[11] := "B"

declare const $NUM_CHORDS := 5
declare %chords[$NUM_CHORDS*12]
$i := 0
while ($i<=11)
declare %_notes[4]
%_notes[0] := ($i+0) mod 12
%_notes[1] := ($i+4) mod 12
%_notes[2] := ($i+7) mod 12
%_notes[3] := -1 mod 12
sort(%_notes,0)
%chords[0*12+$i] := sh_left(%_notes[0],0)+sh_left(%_notes[1],4)+sh_left(%_notes[2],8)+sh_left(%_notes[3],12)
%_notes[0] := ($i+0) mod 12
%_notes[1] := ($i+3) mod 12
%_notes[2] := ($i+7) mod 12
%_notes[3] := -1 mod 12
sort(%_notes,0)
%chords[1*12+$i] := sh_left(%_notes[0],0)+sh_left(%_notes[1],4)+sh_left(%_notes[2],8)+sh_left(%_notes[3],12)
%_notes[0] := ($i+0) mod 12
%_notes[1] := ($i+2) mod 12
%_notes[2] := ($i+7) mod 12
%_notes[3] := -1 mod 12
sort(%_notes,0)
%chords[2*12+$i] := sh_left(%_notes[0],0)+sh_left(%_notes[1],4)+sh_left(%_notes[2],8)+sh_left(%_notes[3],12)
%_notes[0] := ($i+0) mod 12
%_notes[1] := ($i+4) mod 12
%_notes[2] := ($i+7) mod 12
%_notes[3] := ($i+10) mod 12
sort(%_notes,0)
%chords[3*12+$i] := sh_left(%_notes[0],0)+sh_left(%_notes[1],4)+sh_left(%_notes[2],8)+sh_left(%_notes[3],12)
%_notes[0] := ($i+0) mod 12
%_notes[1] := ($i+4) mod 12
%_notes[2] := ($i+7) mod 12
%_notes[3] := ($i+11) mod 12
sort(%_notes,0)
%chords[4*12+$i] := sh_left(%_notes[0],0)+sh_left(%_notes[1],4)+sh_left(%_notes[2],8)+sh_left(%_notes[3],12)
inc($i)
end while
declare !chord_names[$NUM_CHORDS]
!chord_names[0] := ""
!chord_names[1] := "m"
!chord_names[2] := " sus2"
!chord_names[3] := "7"
!chord_names[4] := " maj7"
declare $played_chord
declare %played_notes[12]



{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}   
declare %tmp[221] := (166376,169966,173568,177186,180821,184477,188155,191858,195590,199353,...
                                203152,206988,210866,214790,218765,222794,226882,231036,235262,239565,...
                                243953,248435,253019,257717,262539,267500,272615,277904,283386,289089,...
                                295043,301288,307871,314853,322316,330368,339162,348922,360006,373035,...
                                389284,412279,500476,587416,609947,625644,638056,648467,657507,665539,...
                                672791,679418,685532,691216,696531,701528,706247,710718,714970,719024,...
                                722899, 726612, 730176, 733604, 736906, 740092, 743169, 746146, 749029, 751824,...
                                754536, 757170, 759731, 762223, 764649, 767014, 769319, 771568, 773764, 775908,...
                                778005, 780055, 782060, 784023, 785945, 787828, 789673, 791483, 793257, 794998,...
                                796707, 798384, 800032, 801651, 803241, 804805, 806342, 807854, 809341, 810805,...
                                812245, 813664, 815060, 816435, 817790, 819125, 820441, 821737, 823016, 824276,...
                                825519, 826746, 827956, 829149, 830327, 831490, 832638, 833771, 834891, 835996,...
                                837088, 838166, 839232, 840285, 841325, 842354, 843370, 844375, 845369, 846352,...
                                847324, 848285, 849235, 850176, 851106, 852027, 852938, 853840, 854732, 855616,...
                                856490, 857356, 858213, 859061, 859902, 860734, 861558, 862375, 863183, 863985,...
                                864778, 865565, 866344, 867117, 867882, 868640, 869392, 870137, 870876, 871608,...
                                872334, 873054, 873768, 874475, 875177, 875873, 876563, 877248, 877927, 878601,...
                                879269, 879932, 880589, 881242, 881889, 882532, 883169, 883802, 884430, 885053, ...
                                885671, 886285, 886894, 887499, 888099, 888695, 889287, 889874, 890458, 891037, ...
                                891612, 892183, 892750, 893313, 893872, 894427, 894979, 895527, 896071, 896612, ...
                                897149)

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}

declare %tune[13]:=(500000, 513888, 527776, 541664, 555552, 569440, 583328, 430560, 444448, 458336, 472224, 486112, 666656)
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}   
        



{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}
set_num_user_zones(16)
$drum_1 := find_group("Bateria 1")
set_zone_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], $ZONE_PAR_GROUP, $drum_1)
set_sample(%NI_USER_ZONE_IDS[find_group("Bateria 1")], "FERATESTE Samples/Loop bateria barões 86.wav")
set_zone_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], $ZONE_PAR_LOW_KEY, 0)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], $ZONE_PAR_HIGH_KEY, 127)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], $ZONE_PAR_LOW_VELO, 1)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], $ZONE_PAR_HIGH_VELO, 127)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], $ZONE_PAR_ROOT_KEY, 0)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], $ZONE_PAR_VOLUME,3000)
set_loop_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], 0, $LOOP_PAR_MODE, 1)
set_loop_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], 0, $LOOP_PAR_LENGTH, 492229)
set_loop_par(%NI_USER_ZONE_IDS[find_group("Bateria 1")], 0, $LOOP_PAR_START, 492228)



$bass:= find_group("Baixo")
set_zone_par(%NI_USER_ZONE_IDS[find_group("Baixo")], $ZONE_PAR_GROUP, $bass)
set_sample(%NI_USER_ZONE_IDS[find_group("Baixo")], "FERATESTE Samples/BAIXO MAIOR E MENOR.wav")
set_zone_par(%NI_USER_ZONE_IDS[find_group("Baixo")], $ZONE_PAR_LOW_KEY, 0)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Baixo")], $ZONE_PAR_HIGH_KEY, 127)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Baixo")], $ZONE_PAR_LOW_VELO, 1)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Baixo")], $ZONE_PAR_HIGH_VELO, 127)
set_zone_par(%NI_USER_ZONE_IDS[find_group("Baixo")], $ZONE_PAR_ROOT_KEY, 0)

set_zone_par(%NI_USER_ZONE_IDS[find_group("Baixo")], $ZONE_PAR_VOLUME,1000)
set_loop_par(%NI_USER_ZONE_IDS[find_group("Baixo")], 0, $LOOP_PAR_MODE, 1)
set_loop_par(%NI_USER_ZONE_IDS[find_group("Baixo")], 0, $LOOP_PAR_START,0 ){492228}
set_loop_par(%NI_USER_ZONE_IDS[find_group("Baixo")], 0, $LOOP_PAR_LENGTH, 492229)

end on

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}
on ui_control($TEMPO)
        
set_engine_par($ENGINE_PAR_SPEED,%tmp[$TEMPO-40],find_group("Bateria 1"),-1,-1)
set_engine_par($ENGINE_PAR_SPEED,%tmp[$TEMPO-40],find_group("Baixo"),-1,-1)
set_knob_defval($TEMPO,86)
    end on


function play
$nota_0:=play_note(0, 127,0 ,-1)

end function
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{BOTÃO START/STOP}
on ui_control ($start)

if ($start = 1)
call play
else
fade_out($nota_0, 10000, 1)
end if
end on

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}

on note
ignore_event($EVENT_NOTE)
ignore_event($EVENT_ID)
$i := 0
while ($i<num_elements(%played_notes))
%played_notes[$i] := -1
inc($i)
end while
$j := 0
$i := 0
while ($i<=11)
if (%KEY_DOWN_OCT[$i]=1)
%played_notes[$j] := $i
inc($j)
end if
inc($i)
end while
%_notes[0] := %played_notes[0] mod 12
%_notes[1] := %played_notes[1] mod 12
%_notes[2] := %played_notes[2] mod 12
%_notes[3] := %played_notes[3] mod 12
sort(%_notes,0)
$played_chord := sh_left(%_notes[0],0)+sh_left(%_notes[1],4)+sh_left(%_notes[2],8)+sh_left(%_notes[3],12)
$played_chord := search(%chords,$played_chord)
%_notes[0] := %played_notes[0] mod 12
%_notes[1] := %played_notes[1] mod 12
%_notes[2] := %played_notes[2] mod 12
%_notes[3] := %played_notes[3] mod 12
sort(%_notes,0)
if ($played_chord # -1)
set_text($chord_name,!note_names[$played_chord mod 12] & !chord_names[$played_chord/12])
else
set_text($chord_name,"")
end if
$tom:= %tune[$played_chord mod 12]
if ($played_chord mod 12 = -1 )
    exit
    
end if
set_engine_par($ENGINE_PAR_TUNE, $tom,2,-1,-1)
set_text($gp, $played_chord mod 12)
end on
```


----------



## soundtrax (Oct 16, 2020)

Not really sure what you are trying to do here, but $LOOP_PAR_START runs asynchronously if not used in the init CB, so it can't be changed in real time by the on note CB.
It is possible to tweak loop start points in real time with a modulator in the source module, but unfortunately this only works in sample mode (and not in TM).


----------



## jorgefernando86 (Oct 16, 2020)

soundtrax said:


> Not really sure what you are trying to do here, but $LOOP_PAR_START runs asynchronously if not used in the init CB, so it can't be changed in real time by the on note CB.
> It is possible to tweak loop start points in real time with a modulator in the source module, but unfortunately this only works in sample mode (and not in TM).



Hi !!! Happy to "see you" !!!
I'm trying to make a loop that can be switched in the middle of playback. understood? 
I noticed that "$ LOOP_PAR_START" is changed if I use "wait_async". The problem is that the sound stops being reproduced when the change is made. I am studying something alternative like directing the CURSOR to the desired position ... but I haven't found it yet. Do you know anything about this parameter?


----------



## soundtrax (Oct 16, 2020)

I see. Yes, that's exactly the problem with $LOOP_PAR_START: The audio engine stops when you change its value.
As I said, you could use source modulators instead (all modulators work in real time) but a Loop Start mod is only available in 'Sample' Mode.


----------



## jorgefernando86 (Oct 16, 2020)

soundtrax said:


> I see. Yes, that's exactly the problem with $LOOP_PAR_START: The audio engine stops when you change its value.
> As I said, you could use source modulators instead (all modulators work in real time) but a Loop Start mod is only available in 'Sample' Mode.


I'm using a button to test ... if 1, go to "492228" for example ...
But even though it is in “sampler mode” the audio player stops working ...


----------



## soundtrax (Oct 16, 2020)

I meant these modulators (which can be accessed via script too):


----------



## jorgefernando86 (Oct 16, 2020)

soundtrax said:


> I see. Yes, that's exactly the problem with $LOOP_PAR_START: The audio engine stops when you change its value.
> As I said, you could use source modulators instead (all modulators work in real time) but a Loop Start mod is only available in 'Sample' Mode.



Understood friend @soundtrax.
Until you reach an alternative to this situation, please clarify a doubt ... In the way that you guided me to define the "user zone", is it possible only one instrument per group? Because I created a new group to add other instruments, being that only 1 (one) instruments was defined in the user zone, that is, of two instruments in the group, only 1 (one) was possible to configure the loop ...


----------



## soundtrax (Oct 16, 2020)

Yes, you can set up more than one user zone in one group (if that is your question).

The set_loop parameters are:
set_loop_par(<zone-id>,<loop-index>,<parameter>,<value>)

So, you should NOT try to target a group with this line, but the specific user zone. You'll find the (user-) zone-IDs of your nki in the Kontakt Browser in Expert > Zones when you are in edit mode.

Here's an example of the Expert tab with the zone IDs of a Spitfire nki - these are the numbers you will have to address with set_loop_par:


----------



## jorgefernando86 (Oct 18, 2020)

soundtrax said:


> I meant these modulators (which can be accessed via script too):


My God !!! Friend @soundtrax ... I found that in "sampler mode" my "time knob" does not work, and when changing the "tune" the speed is also changed !!! WOW!! how desperate !! This destroys all other stages of my work! :( : (...

Come on...

Is it possible to change the tune without changing the speed in this mode?

what about speed ... can I create a "speed control knob"?

There are times that it seems that the kontakt gives and takes away at the same time lol

Thanks in advance for your help!


----------



## soundtrax (Oct 19, 2020)

When you are in sampler or DFD mode, changing the pitch always changes the speed of a sample. That's how it is supposed to work and that's how it works in any classic hardware sampler.

If you use Time Machine mode (or TM II or TM Pro), the sample will keep its length/speed, you can script a speed knob that even works in real time, but: real time tweaks of the loop points are just not possible in these modes (Hopefully we'll get this in Kontakt 8 ).


----------



## jorgefernando86 (Oct 22, 2020)

soundtrax said:


> When you are in sampler or DFD mode, changing the pitch always changes the speed of a sample. That's how it is supposed to work and that's how it works in any classic hardware sampler.
> 
> If you use Time Machine mode (or TM II or TM Pro), the sample will keep its length/speed, you can script a speed knob that even works in real time, but: real time tweaks of the loop points are just not possible in these modes (Hopefully we'll get this in Kontakt 8 ).



Hello friend, @soundtrax
Kontakt 8 ??? KKKKKKK: D: D: D ... I hope I finished my sequencer project by then kkkkkk
In the meantime we go for alternatives ...
I put the battery in "loop" manually and I pause it with "note_off - wait - play_note", in order to attack with another note ("fill"). However, I have been having trouble “fitting” that note during the loop pause. See if you can help me?

- This note (“fill”) must be fired and fit within the pause given by the loop;
- If it is played outside the strong tempo, the rest of the sample must be played (not from the beginning).

It should have been easy, but I have tried several alternatives during that time, but I have had few results.

Thanks!!!


----------



## jorgefernando86 (Nov 16, 2020)

soundtrax said:


> I see. Yes, that's exactly the problem with $LOOP_PAR_START: The audio engine stops when you change its value.
> As I said, you could use source modulators instead (all modulators work in real time) but a Loop Start mod is only available in 'Sample' Mode.


Hello friends!!

Especially the friend @soundtrax who helped me a lot during this walk!

I was finally able to get around the difficulty of starting the loop at different times ... I divided the sample into larger ones in different notes and I trigger them using "FADE_OUT", "FADE_IN" and "NOTE_DURATION []", which returns the note at the exact moment that the other ended !!!!! It was difficult ... slow ... but with a little creativity it was possible !! Thank you very much @soundtrax for that !!
However, I am now behaving an unexpected behavior with a zone and I still could not understand to solve ...By "transforming" the note into "USER ZONE", my zone had its size changed. See in the images:









In image 1, the note is in its original size. In image 2, the note, in “USER ZONE”, ended up being reduced in size. Why does it happen? Better ... how to prevent this from happening? I thank you all!!


```
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_GROUP,0)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_LOW_KEY, 1)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_HIGH_KEY, 1)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_ROOT_KEY, 1)

set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_LOW_VELO, 1)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_HIGH_VELO, 127)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_SAMPLE_MOD_RANGE, 1028658)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_SAMPLE_END, 1028658)
set_zone_par(%NI_USER_ZONE_IDS[2], $ZONE_PAR_SAMPLE_START, 0)
set_sample(%NI_USER_ZONE_IDS[2], "Bumbo reto 2.wav")
set_loop_par(%NI_USER_ZONE_IDS[2], 0, $LOOP_PAR_MODE, 2)
set_loop_par(%NI_USER_ZONE_IDS[2], 0, $LOOP_PAR_LENGTH, 984270)
set_loop_par(%NI_USER_ZONE_IDS[2], 0, $LOOP_PAR_START, 0)
```


----------



## soundtrax (Nov 16, 2020)

Hello again - great to hear that you could make it work!

Well, this looks weird...are you sure these are the same audio files? I've never had issues like that when dealing with user zones. I guess I would double (or triple) check if the sample is the right one.


----------



## jorgefernando86 (Nov 19, 2020)

soundtrax said:


> Hello again - great to hear that you could make it work!
> 
> Well, this looks weird...are you sure these are the same audio files? I've never had issues like that when dealing with user zones. I guess I would double (or triple) check if the sample is the right one.



Hello @ soundtrax !!
Anyway I found out ... there must be some problem with the sample .... I edited and renamed it and so it worked normally.
Thanks!


----------



## jorgefernando86 (Nov 19, 2020)

soundtrax said:


> Hello again - great to hear that you could make it work!
> 
> Well, this looks weird...are you sure these are the same audio files? I've never had issues like that when dealing with user zones. I guess I would double (or triple) check if the sample is the right one.


 
With the loop created in this way (by means of "USER ZONE"), I have not yet been able to count the repetitions, a function I need to know the number of measures. Is there a way to count the repetitions of these loops?


----------

