Qirky / FoxDot

Python driven environment for Live Coding
http://foxdot.org
Other
1.03k stars 134 forks source link

How do I import my own kit into FoxDot #40

Open Miserlou opened 6 years ago

Miserlou commented 6 years ago

I have my own kit of sounds, organized like

/808s
/Kicks
/Snares
/Hats
/Crashes
/Sweeps

etc - what's the best way for me to load this kit (or any kit) into FoxDot? I looks like the samples are just kind of thrown in random letters of the alphabet..

Qirky commented 6 years ago

You can either add / replace samples by going to "Help & Settings" from the IDE menu and then "Open Samples Folder" which should open up your default file explorer to the directory where the samples are stored. In here there are folders for each character and within them each case (upper and lower). The filenames should be alphabetically ordered if you have a preference of how to select them using the sample keyword in FoxDot. Samples mapped to non-letters are in the _ folder and each character is named e.g. "exclamation" for "!". To see a rough estimation of how samples are split up you can use print(Buffers.Samples). I personally use "x" for kicks, "-" and "=" for hihats, "o" and "i" for snares and "#" for crashes. After that it's a bit of a free for all.

If you want to only use your samples but don't want to delete the existing ones, the easiest way is probably to copy and paste all the folders into a new directory and then replace the samples. You can open the FoxDot config file by going to "Help & Settings" -> "Open Config File (advanced" and change the "SAMPLES_DIR" entry to the path where your new samples are stored.

Sorry for the long answer - hope that helps.

Miserlou commented 6 years ago

Ah, gotcha, thanks!

So - to me, manually changing a samples directory seems kind of counter to the point of programmatic music!

It'd be much more useful if I could build (and share!) FoxDot-specific "kit" directories (with x/-/=/o/i/#) but then load them programmatically from the FoxDot environment, so that I can combine elements of "trapkit" with "stompkit" and "rockkit", etc, without having to modify the whole environment's samples directory path.

Does that make sense to you?

Another issue is the ability to have multiple sounds for a given kit, ex: x[3] or random.choice(x) - something like that..

Miserlou commented 6 years ago

Now that I'm thinking about it, the ability to have string patterns in the kit would also be helpful so that I could load up trapkit.basic which would load up (['x_o__xox'],['--------']), etc..

Qirky commented 5 years ago

Long delay but I've added a --dir command line argument that lets you specify an alternate folder for looking for samples (which will need to contain folder called "x/lower" etc). For the trapkit.basic I would create a Python file with a kit class and then create kits from it e.g.

class Kit:
    pass

trapkit = Kit()
trapkit.basic = "<x_o__xox><---->"

And load it in like this:

from my_kits import trapkit

d1 >> play(trapkit.basic)
jrparadis commented 4 years ago

I have a suggestion for this - would it be possible to have the --dir path be associated with a different play function? like play() is always there with the default samples, the first --dir would be play2(), a second --dir might be play3() and so on? that would be pretty useful. I've been writing scripts to make tiny samples and there's a huge amount I'd like to import, I'd like to be able to still use the default samples along with importing hundreds of my own. Thanks!

Qirky commented 4 years ago

It's a nice idea but it would take quite a bit of work. FoxDot is a result of lot's of small changes and workarounds which means that the play synth is kind of hard coded in there at the moment so there isn't much flexibility. I'd like to move a lot of the logic out of the Player class into the SynthDef class but it's quite a big task and I haven't really got the time or energy at the moment. When I do manage to move the logic around it will be a lot easier to do this sort of thing though