getAttribute(LoopEnd & LoopStart)

  • If I make a reference to my sampler with

    const var CrossFadePiccoloSampler = Synth.getSampler("CrossFade Piccolo");

    I'm supposed to reach the parameters LoopEnd & LoopStart and subtracting the loopStart from the LoopEnd should give me the LoopLength, however both attributes give -1, am I doing something wrong, or is it broken?

    var LoopL = CrossFadePiccoloSampler.getAttribute(CrossFadePiccoloSampler.LoopEnd) - CrossFadePiccolo.getAttribute(CrossFadePiccolo.LoopStart);

  • Won't loop start and end be different for every sample in the sampler?

  • @d-healey yes they would, so how do I get a reference to played sample?

  • @ulrik Ok, I found it, I have to use

    Console.print(parseInt(CrossFadePiccoloSampler.getSoundProperty(CrossFadePiccoloSampler.SampleEnd, 0)) - parseInt(CrossFadePiccoloSampler.getSoundProperty(CrossFadePiccoloSampler.SampleStart, 0)));

    so the "0" is the index of this particular sample (I have only 1 sample in the sampler located at C3, so I guess the index number is not related to at what pitch the sample is located but it's the first (and last 🙂 )
    So if I have several samples how is the samples indexed?
    Ok, they get an ID, I see it here
    Skärmavbild 2020-03-20 kl. 11.36.10.png

  • @ulrik Why does this not work?
    With this I get the SoundProperty 15 = LoopStart, for Sound with index 0, works fine!

    Console.print(CrossFadePiccoloSampler.getSoundProperty(15, 0));

    but if I use this for the same sample

    CrossFadePiccoloSampler.setSoundProperty(0, 15, 2020);

    I will get an error saying

    Line 12, column 49: no sound with index 0 

  • @ulrik Ok, I had to select the sample first, then it works, Heureka!! 🙂


  • Looks like you have to make a selection before you can use that function.


  • @d-healey Yes that's what I figured out, after spending some interesting hours...hehe 🙂

Log in to reply