How do you play a note of a certain length?



  • I need to play a note of a certain length for an arpeggiator. How do I do that?


  • administrators

    You can add a timestamp which delays the event by a fixed amount.



  • I need a script example :'(

    Looking through messages, event ids, play notes, end note functions, I just can't see the connection.

    I tried this and it doesn't work, and of course some of these functions might not even exist
    Synth.addNoteOff(this.lastEventId.getChannel(), this.lastEventId.getNoteNumber(), this.lastEventId.getTimestamp() + Engine.getSampleRate() * 0.5);



  • ...bump...



  • My humaniser script might give you some clues, it uses timestamped delays/offets - http://forum.hise.audio/topic/151/humaniser/3


  • administrators

    HiseSnippet 1053.3oc4Ws0aaaCElx1BqVcNXcnCXOJXrGb.xLjRujADLzbowEFq4Bhxx5acLRT1DklzihxsdE4+39oz+AaGJJaI6pkXm0sArYD6.9ctnOdHOej5LoHjjjHjHq6ewzwDj0maGLkqFd3PLki5+bj0F1GiSTDoqA5foiwIIjHjkU8WnArZ1.k84CO6.LCyCIEPHzkBZH4kzQTUA5Ou2OPYrd3HxEzQk79w60OTvOTvDo.epa6gFiCeCd.4Dr1sZ1nITxaSPVd1OZ6tx23e0ute2k9L8xgvuwKhiBSkRBWcIDNxx152gOV1GEQUBYfBqHPNabfHZZvPwa4lG8kzD5ULhdfOJ.3jAtmfEom7ZTzgCornylUBSPPtOqnfV2TPen8wzH5b7hB6WjYvsHhxkVqZ2D87uc54UE8rJQuFF58.6fPIcrpvhlaeYN5eB6LFQ0dUMaGXIKQ4NAKcOHUoDb2u28PAWAk6t3nHCVm1l+2dKWee3q2l65XP5lPTcZqHuSA1ZCyVop8l61xokCkynbhabJOTQgzNlgmdhPQ5vgeNIczUD4VtLBefZXe9wvFJZBA3RTxlsbdeKmlLQHlM2g.7nwLRBPti3Cf71c.Qki0SHyBOvDdmJyIPolveY8F54klImx6.Slxzwe6c1x0Ky4E8LNdYWWhXPA45cmOWE777uoy6cZ5bsyxVf7UgIccWJXLhrJq5lsbCyqkO0SuZXXbk4pCOmuSvrTRVvz3NlAPL5BcQ11Y6hrkW.RzqnlmrW2m.yxlWqMBeIrDRY+DiyIHTIbfcvKt+2Y01+GZ14UxQAuOmpNcLIuudVo8iPhiKCUTJKilwvJbaFTUZBn7tAc6Wt6fqprluMxayL8BHJzbcO67AY03xRonOt4EjPDQoLrZQcEstbtAXwbgN29ZtjPUSKqauFhMdqrV3pR2GXeFUENrZ9VqB9BEx+t4atzcK6ihiIgpBx1vt2qtq5z2MprggJ22N.Tsx5UxHxWkM18mvSHtufvIRcQ8FNb929ze37ogJ3oegDySFKRVHwAjQzKDbcAo.7GSH8jje4b8hbY7CEXYkl9vy5AywJiI.qRkY6V1ejHkqVX2wRRG1qlzwhMMk7+VNxuw+BG4+ouK7utnQ8Uit2xsR9rYbLfpOW7H9DBS.HFkhmShwoL0bzakj6qTvUHKPd3dmSXDb4cqeyduD1kgkvbmbGme9q976lVC9ZaCcc0cdt+2P.u9+OEvOWjpn7AGiUR56.IH3VeAfvYHAXBmCW8Q+ZH0zhelwd5wFkSdj2r2QI2nudrUtQ+YF+G4YLBGJEuNzbsE8d46kg.yad16j0Dd4PXrq+rqqnqMi.MtWGFpK1eKTcpNhsW6HdzZGwiW6HdxZGwSW6H1Ysi36tgHzGnrepRLxz5gP+A.KWjDd
    

    The most important part:

    inline function playNote(noteNumber, lengthInMilliseconds)
    {
        local lengthInSamples = Engine.getSamplesForMilliSeconds(lengthInMilliseconds);
    	
        Synth.addNoteOn(1, noteNumber, 127, 0);
        Synth.addNoteOff(1, noteNumber, lengthInSamples);
    };
    

Log in to reply

Looks like your connection to How do you play a note of a certain length? was lost, please wait while we try to reconnect.