addPitchFade() bug?
-
In this example I set each note in an array (pressed keys) to start with a delay (d) , the delay will increase for every new note, like this:
The delay work as expected (making a strumming effect) but the addPitchFade function will only have effect on the first note in the array (it should make a pitch fade on all notes since the "id" change for every new note
local d = DelayKnb.getValue(); for (n in keysdown) { local count = keysdown.indexOf(n); local id = Synth.addNoteOn(1, n, 60, d*count); Synth.noteOffDelayedByEventId(id, 100000); Synth.addPitchFade(id, 1000, PitchFadeKnb.getValue(), 0); }
To test the snippet, hold down more than 2 keys and press the "PLAY" button.
HiseSnippet 1452.3ocyX0saaaCElJ1pn1csXcnanWRTrKTFLbs255FPwVchSRgQaZLhSSWwvPGiDkMQjHUnnRi2PA5k68Y6tc4dA1iReC1NjR1hN0IywHqaB1AljmOd9N+vCOJ8kBeZZpPhbps23DJx4CbGLlqF0cDgwQ81.4bc2.ZDYLldLkqPqONgjlRCPNNUdjVDmZUQlm29v0IQDtOsbJDZeAym9DVLSUNa+NOlEEsEIftGK1R560omuf2UDIx.5TwsEJg3eHYH8oDsXq3hbtxlALkPNPQTzTjS00EAiGLR7Jdt76yRYGDQ0CZiF.aT9zaIhBzLVOKp6HVTP+IlcJB431uzITI2IbK2sYAroyW5L9PyB3RD19CmUlkdUlgdssoWKK5MGJ4XQop4T5ltC7krDU4JZ9bM2dbEUFR.2tMUxkEsxGW0sq.jfqZFSNjtkDFLEg28a0pAF9ypOndcv0mpvGSj3Mzg6GyO.+M3IXGRUcEwIBNLv6NSD3N.tRX8YJ+Q5n54A0VHMb3QRGhOjNNM.7S.tu+GdP8ICaJooT4wTu1FJV+t2sVhNULkdTFExzpy3QLNEGlw8ULAGK38g0GPOZcEWS.oHxyeh1a.zLJitZ8etdMVH1qXTMXXsHgOIBG.5ehwoI99ZI7.UWqVnPh83XFeJWAjFnEX8EYbEfeJ2Y7.5I6D5wM3KjhoUg4.VSRPvSEJ5Nbu1MvbcbnAN3yLaSNhbw3ZYBCMzhFr93M0GC6E3wBZfa2R+jKs9q1+ncv3PvCiGQRA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ol615w31uaurPqKrW56O6V8N.+7kE3Wrr.u2xB7KWVf2eYA9UKKvu9eFn9Rn0xTh37ilHz182z7tGNNaxIPVt4DA5ugf+mFG
-
I think because
id
is declared within the loop it is overwritten each time. Putid
outside the loop and make it an array, one element per note. -
@d-healey it doesn't help I'm afraid, and yes the id should be different for each note and the pitchFade function will get the right id before it's changed
-
@ulrik i don't hear anything when pressing play
-
@d-healey you have to hold down some keys on your keyboard at the same time
-
@ulrik It works here. If I turn the pitch knob to max, hold two notes, and press play both notes are pitched up 12 semi-tones.
I'm working on a guitar strummer at the moment. I hadn't thought of using delayed notes, it's a clever idea. I'm doing it using the synth timer.
-
@d-healey can you try with some delay set as well?
-
@ulrik I have the delay set to 7092
-
@d-healey said in addPitchFade() bug?:
@ulrik I have the delay set to 7092
and all pressed notes were affected? Wow, why does it not work for me, strange
-
@d-healey which commit are you on?
I'm on latest develop commit -
@ulrik Yeah
-
-
@ulrik not working -in the same way yours isnt - here - so add the delay - set a pitch fade, hold down two notes, press play - only the first note is re-pitched...
-
@Lindon Thank you for confirming! Which commit are you on?
-
@ulrik oh its quite old - I await teh filter display fix before I can move to anything recent.
-
@ulrik ok so the culprit is this:
id = Synth.addNoteOn(1, n, 60, d*count);
the pitchfade apparently doesnt happen until the note is playing...and as you are delaying the onset of the note - its not playing so its not happening..
if you replace that line with this:
id = Synth.addNoteOn(1, n, 60,0);
it works as it should
-
@Lindon unfortunately yes, it would be great to assign the pitch fade to the event before it happens and it will remember that when fired
@Christoph-Hart would it be possible? -
@ulrik in other words
we have the opportunity to set NoteOn and NoteOff delayed
local id = Synth.addNoteOn(1, n, 60, amount of delay in samples); Synth.noteOffDelayedByEventId(id, amount of delay in samples); Could we have Synth.addDelayedPitchFade(id, fade time, pitch, fine pitch, amount of delay in samples)
or is it possible to achieve this, if so, how?
-
@ulrik said in addPitchFade() bug?:
or is it possible to achieve this, if so, how?
Why not use a timer?
-
@d-healey yes that is possible but I think it would be more accurate to work with sample delays as in above examples