How to import your own original audio sample on FoxDot

@ryan: I did a few interesting experiments by following your suggestions, and thought it would be helpful for sharing to anyone who would like to explore/use his/her own audio sample to play around on FoxDot. If you want to hear your original sound, there are a few trick points that require attention:

  1. Set up the duration: after trying a few times, dur=32 seems perfect to hear the original sound. The audio file I embedded in the folder is about 8-bars length. After experimenting different lengths of duration, 32 seems the best match for this 8-bars length of piece. (e.g., if I put 8,16, 24 as the length of duration setting, you always hear something wrong.)
  2. Sample=1 (Sample =3 seems not working for this case after trying your code, if I put Sample=3, and what I heard is the default percussive sound in this folder under"T". )

Now the only minor issue is the latency, from the time I execute the code to what I can hear is about 6-8 seconds and sometimes I need to press twice.

I attached my code here.

Feel interested to further this topic and gain more related knowledge(I will read the article you recommend very soon.)

Many thanks!

Best regards,

Yang

Unfortunately there isn’t really a way of triggering a sound immediately, it’s all based on loops. It’s something I’d like to do include in FoxDot at some point though. What’s happening when there is latency is that when you specify the duration as 32, FoxDot will start looping at the start of the next 32 beat cycle. So it’s probably waiting the remaining beats before starting your sound.

For longer audio clips, i.e. a few seconds or more, you’ll want to look at the loop synth which lets you cut it up into smaller chunks and you could start playing it half way through or calculate the position to start immediately. You can check the docs here and you might also find this topic useful.

@ryan: many thanks and no problem! In fact, I will go further by absorbing all information/articles you recommended with different experiments.
In another subject, if there any chance that I can get your email address? This will be a project description with a private manner.
Thanks again and Foxdot offers me such a fascinating learning coding experience! And greatly appreciate your guidance all the time!

Best regards,

Yang