Toggle samples with button


#1

Maybe someone can help me to build a patch. I have several one shot drum samples, I want to change them with a button and control pitch with a knob. Is it possible to do and how to do this?


#2

At what stage are you atm? Have you prepared the samples to "Axoloti format"? Do you have the sampler working?

There are many steps in what you want to achieve. WOuld be nice to know where you are at, to be able to help you :wink:


#3

I have prepared samples and did hardware connections. Now I want to make a patch, but don't know from what to start. May be there are some examples or similar patches in community library?


#4

Try this patch, I think this is the easiest way, but I'm also new to Axoloti so I could be wrong.

Set the size, then click the choose button to load a sample, and away you go. Just use the button object to trigger the sample, and the dial beneath it, to adjust the pitch of the sample.

You can also adjust the master pitch using the dial on the table play object. So from here you can basically copy this for as many different samples as you wish to use, then combine it all together using a mixer object or whatever.


#5

You should not use wav files. The problem is with wav files, in Axoloti context, that the table will playback the header(.wav), which results in a click every time the sample is re-triggered. You should convert all audiofiles to .raw files. A free program that does this is Audacity. Before you export the file from Audacity make sure that the file format bit rate is correct:

Things to remember, as highlighted on the picture:
1. For a table the file MUST be mono. There are currently no stereo tables. Only stereo wave players.

  1. File MUST be 16 bit 48khz (remember to check the "Project Rate" too).

  2. When exporting, you go to file "Export audio" and choose "other uncompressed files". And then select "raw(Headerless) & "signed 16 BIT PCM".

Then the files are "optimized" for Axoloti. And also remember the filenames CANNOT be more than 8 character. Like "axolotis.raw" And dont use any fancy "#€% stuff in the names either :wink:


#6

I actually do have that file as RAW in the same location. I must have imported the wav by accident. That said, I did forget about the eight character limit, so it's coincidence that "rawsound" is eight characters long :stuck_out_tongue_winking_eye:


#7

Thank you for your example axoman and jaffasplaffa for explanation how to prepare samples. Now I think that I explained my question not so clear. I apologies for that. I waned to ask how to change sample with a press of a button in axoman example if it possible? Is it possible to store samples in a sample table and toggle them with a press of a button?


#8

I haven't gotten around to that stuff yet, but this might help a little because it uses logic to select from four different samples.

To use it, load four different samples into the slots, and don't forget to set the size large enough for each one while you're at it or the samples will be cut short. Once you have the samples loaded, you have a button on the top-left called "Selector". Each time you click on the selector button it will trigger a different sample, or in other words, allow you to rotate through the samples to select one.

I've put a little indicator next to each sample slot so you can see what's going on. The mixer on the right lets you choose the level of each sample, and the other knobs do the same as before, allowing you to change the pitch of each sample independently.

There's many ways to do what you want, and I'm sure I saw specialised objects you could use, but I've not really touched the sampling stuff much yet so can't help in that respect. So yup, it's not exactly what you want, but if you pull it apart and examine it, it'll at least give you ideas of how to mess around with basic logic and math objects in order to run through a selection.

Here's the patch to save you having to build it:
SampleSelector.axp (9.1 KB)


#9

Looks a bit complicated:) thank you. I think it should work. The only thing will it be posible to use one potentiometer to controll the pitch of all samples?


#10

It's more complicated than it needs to be, that's for sure :blush:

I spotted some objects not long after I posted that, like a timer/trigger object with a settable maximum, so that would have simplified it for starters. Anyway, you're too kind, I really shouldn't have posted it at all. I'm still finding objects that are constantly changing the way I would go about doing things. Like I said, I thought you were a complete beginner or I would never have posted it.

Regards controlling the pitch of all samples with one knob, haha, well now I know you're taking the piss :grin:


#11

Ignore that last sentence, I see you're referring to external "potentiometer".

Yes, you can do that by using gpio/in/analog which will allow you to select whatever pin you have the potentiometer hooked up to. If I recall, you have to filter it though, so be sure to look up info on it before you go connecting hardware to the board.