Wav Trigger with banks

The issue i was running into was that changing the samplerate does so for all tracks.

So pitch-shifting with a keyboard press would have to be “trigger track, pitch shift the track”. But this means that while you could play multiple tracks, their pitch shifts are locked to the same shifts. Its also the chipmunk style pitch shifting that changes the duration of the sample.

Whats really made me question whether to go through the trouble of doing this is, im thinking the end result wouldnt necessarily be better than just triggering samples that are pre-pitch shifted.

The better way to do this might be to write some middleware that takes a sample, creates pitch shifted versions, and dumps them into banks to trigger for the ini (we already have middleware made to dump banks of drum samples, so this proof of concept works). Then, you have the arduino logic load in the banks as you play them. Theres a lot going against this idea too, since you effectively have 16 notes of buffer to play with, but its possible that you could use the 16 available tracks like 16 note poly with the usual voice drop logic.

If this last method is going to work, it will take some planning to get it manageable.

The pitch on the WAV trigger can be set to a value between -32767 and 32767, so you can just map whatever you want to set that value. I have 0V setting the pitch to 0, and then + and -ve voltages offsetting it from there.

2 Likes

Those 24 jacks are gate / trigger inputs, which correspond to the push buttons above, to play the individual samples in each bank.

1 Like

I thought the inputs on the board capped out at 16.

Yes, but you can collect as many inputs as you like via arduino boards, and then send a message from the arduino saying “play file no. 2,472”. Actually it’s more like “play file no. (24 + (bankNumber * 24))” if that makes sense - the current bank of sounds offsets the file names by 24.

2 Likes

I assume this means you poke the SAMPLERATE command?

You probably also use CV to control the pitch, which opens things to being controlled by things like a CV style sequencer.

I was thinking you’d have to put in some logic to select a sample (they call them tracks), and then map the sample rates to keys at intervals equal to your chosen tuning system like 12-ET.

Not having that step makes this build much simpler. I have a tendency of worrying to much about these things. Still not sure about the chipmunking. There’s so much you can do with this thing!

This combines the pitch knob and any external CV inputs:

finalPitchValue = (pitchKnobValue + pitchCVValue);
finalPitchValue = constrain(finalPitchValue, 0, 1023);
finalPitchValue = map(finalPitchValue, 0, 1023, -32767, 32767);
setPitch(finalPitchValue);
2 Likes

This is a function to set the pitch:

void setPitch(int pitch) // Function to change playback pitch of audio track
{
txbuf2[0] = 0xf0;// part 1 of start of command alert
txbuf2[1] = 0xaa;// part 2 of start of command alert
txbuf2[2] = 0x07;// command length ( 0 to 6 bytes in “txbuf2” = 7 )
txbuf2[3] = 0x0c;
txbuf2[4] = (byte)pitch;// one part of pitch value
txbuf2[5] = (byte)(pitch >> 8);// other part of pitch value
txbuf2[6] = 0x55;// always the same - end of command
Serial.write(txbuf2, 7);
}

1 Like

Remember to include this at the top of your code:

byte txbuf2[7]; // Set pitch

2 Likes

Good stuff man, thanks!

Done! Works like a charm - buttons even function as intended.

9 Likes

Awesome, superb work!

1 Like

You are too Kind! The wires are a bit of a mangle in the back, but I am pleased you can access the SD card from the front.

5 Likes

I’ve been going through the documentation and perhaps I’m just missing it - does anyone know the numbers that go in the .ini file for “next bank” and “previous bank”?

You can use the ini configuration utility to set things up.
Failing that, if you wanted to just setup like mine where triggers 15 and 16 are prev and next respectively, you can use my ini:

#TRIG 01, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 02, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 03, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 04, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 05, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 06, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 07, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 08, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 09, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 10, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 11, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 12, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 13, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 14, 2, 1, 1, 1, 1, 1, 0, ,
#TRIG 15, 2, 1, 1, 0, 0, 13, 0, ,
#TRIG 16, 2, 1, 1, 0, 0, 12, 0, ,
********************************************************************
This file was generated by the WAV Trigger Init File Maker v1.10
It is only required if you wish to over-ride default settings. You
may add your own comments below this line -->

Just name that “wavtrigr.ini” and drop on the SD card and you gold.


I also have a python script that can turn folders of samples into banks if you want it.

You just have directories setup like this:

image
image
image
image

essentially, you have a bunch of bank folders, which have folders for each sample. You plop the sample you want to use for that bank/trigger, and run the script.

image

Then, the script will auto copy rename and fill with dummy wav files so its compatible with the 16 trigger banking system of the wave trigger!

Here is a link to the github, which has a binary for windows users without python on their 'puter.

Also, you dont HAVE to put bass drums in the template’s bass drum folders. This is just a suggestion for keeping things tidy between drum kits. Hell, you could put whatever samples you want in these folders.

4 Likes

Thanks so much. Maybe I’m just missing it, but my version of the configuration utility doesn’t seem to list those as options.

I’ll have to give that script a look - it seems incredibly useful.

2 Likes

I’m just now making a pack of chord stabs to load up for testing this again. I only made it for a few drum kits, but it should work for this as well.

2 Likes

We are using the drum tracks to trigger chord stabs of synths I recorded (7ths). I use one of the drum channels to trigger the ADSR, which controls the VCA and VCF that shapes the audio from the WAV trigger.

3 Likes

Question about the dummy files - is there anything special about them? Are they actually stereo .wav files?

2 Likes

They are wavs that are generated without any sound. They are just placeholders.

2 Likes