I made a simple portamento function:
func portamento(oldNote:Double, newNote:Double){
if oldNote < newNote {
while oldNote < newNote {
oldNote += 1
}
} else {
while oldNote > newNote {
oldNote -= 1
}
}
}
this works but after pressing a few notes theres is major delay/lag time and it continues to perform until the number of times I pressed the note is complete. How can I avoid lag/delay in processing this function in realtime?