Welcome @Jose_Mendes to the TidalClub!
Short Answer: use up
instead of speed
or n
Longer Answer:
The function up
speeds the sample in the same way as speed
. This means that the sample will be shorter when you increase the pitch and longer when you decrease the pitch. With short samples this is perfectly fine for writing "fast" melodies. I am currently researching ways for TidalCycles to independently change the pitch or length of a sample (which usually requires more calculations than just changing the playback speed).
Another possibility to realise something like this I show/discuss under Custom functions and in this topic.
If you follow the link for custom function, you will also find a video of me showing exactly what you have in mind (just replace the speed'
with up
)
Note: Professional sample packs store a separate sample for each note.
Because when changing pitch or duration of a sample independently, artifacts occur when the changes are " heavy ".
Hope this helps!