How2 make samples??

Link to good samples/soundfonts at http://wiki.linuxaudio.org/wiki/free_audio_data

Moderators: khz, MattKingUSA

User avatar
42low
Establlshed Member
Posts: 1541
Joined: Sun Apr 17, 2016 2:31 pm
Location: Netherlands

How2 make samples??

Postby 42low » Sun Oct 29, 2017 2:24 pm

I have the plan to make some samples to share.
For that i have some fun instruments which i'm thinking first of. Later i want to share some samples i made/make for my own.

If i take two of the instruments. One has two or three octaves (keys :wink: ) with full and half notes which i can play in both short or long tones (or whatever). The other instrument only has 7 full notes, and the length of the tone is limited.

How2? Are there some demands for samples? Which format to share in? Like which sample rates and file types?

nilshi
Establlshed Member
Posts: 236
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: How2 make samples??

Postby nilshi » Sun Oct 29, 2017 3:02 pm

This sounds like a relatively simple and therefore beginner friendly project, so you are in luck.

The recording process is the hardest part when it comes to sampling. That said... percussive instruments like drums and pianos are relatively simple, that is why they make great beginner projects and most if not all good "free" samples are such instruments.

Take your time and record clean notes, several variants of the same in multiple dynamic levels (aka velocity layers)
If your 7 note instrument can be played with varying strength I would expect 5 recorded samples for let's say 3 velocity layers (soft, medium, loud). That is a basic set appropriate for a quick sampling job without any experience. So in the end you will have 5 * 3 * 7 = 105 .wav files. Convert them to flac for better download size but never never never use lossy compression like mp3, ogg or opus.

How to play them now...
My clear advice is to use the sfz format. SFZ can be loaded in Linuxsampler (standalone or through Carlas internal implementation). Sadly we do not have an open source sfz sampler. But every new sampled instrument is one reason more to program one.

You will have to look that format up yourself for now. My advice would be to just write it with a text editor.

There is also "polyphone", a graphical editor. I didn't use it in recent times so I can't say anything about its state. But the scope of your project is small enough to write the text directly.

Also: there are several scripts to convert a directory of .wav files into an .sfz file. If you have a bit of python or bash experience you can write such a script in an evening yourself. (that is why there are so many scripts that do it :)

For the three octave instrument, that sounds like a real instrument so I would record more than the small amount of recorded samples mentioned above. Again, take your time, keep your recordings consistent (mic positions, room conditions like temperature and humidity, the room arrangement itself like furniture) so you can spread it over several days. You will end up with some hundred samples which are technically enough to have a respectful and quality sound.

A more difficult task is the varying length of the tones. There are several approaches here, but it comes down to having several .wav files and trigger them (sfz does all that for you) depending on the key action. For example in a piano that would be one sample of a key played and the ringing out (the natural behaviour). But for ending sooner you need to record the hammer and key alone. For example by pressing down the key silently and then record the release.

Recording and automatic sfz triggering of instrument noises (keys, bows, piano pedals, breath/wind, guitar slides) is a key step to make your instrument much better.

Another approach is to split it into the beginning of a tone, a looped section and the release sound. Finding good loop points (and preparing the recording with that in mind) is a task not to underestimate but very important for bow- or wind instruments. And recording a choir etc.

In the end it depends on your instrument. An experienced sample creator learned as well to analyse the instrument itself, from a musicians and from an instrument makers point of view. He learned to think like a recording engineer. And he learned to think like a programmer.

In the choose a good license. I have one but we'll cross that bridge when we get to it.

nilshi
Establlshed Member
Posts: 236
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: How2 make samples??

Postby nilshi » Sun Oct 29, 2017 4:20 pm


User avatar
42low
Establlshed Member
Posts: 1541
Joined: Sun Apr 17, 2016 2:31 pm
Location: Netherlands

Re: How2 make samples??

Postby 42low » Sun Oct 29, 2017 5:43 pm

Ow wonderful man. That's a lot off great explanation. I have to take time to go read this with care to make sure i understand everything (translation).
After a quick read the next reactions....

At first i'm not that scared of the techniques behind sampling. I have some musical educated background and experience with playing and creating/producing music with all kinds of instruments and music allmost all my life. I understand what's needed to create something usable.
I know a 'simple' one tone triangle can be played hard or soft, long or short, open or closed, muted or not, etc ... and all that options again some more or less. If i dig deep in my brains i could even name the official musical terms for those (crescendo, decrescendo, pianissimo, fortissimo, etc) :wink:
And i know that my 7 tones instrument isn't as comprehensive as a triangle.

Sfz will probably be a problem for me in the beginning. I don't use and don't know LinuxSampler to use, let along to build for it. So perhaps something for later?

The extended instrument is an organ with 2 or 3 octaves existing off the regular white and black key's. But as it is a rather rare and old one i think this can become a cool and fun sample pack. 8)

For a simple 7 tones instrument 105 samples could sound as very much.
But i guess and believe you can quickly have a more than expected. I myself have had sample packs from three up to almost six hunderd sound files. But that 600 files sample pack covers 18 serious instruments, so at the end it's an avarage of about 33 per instrument.
So does that 7 tones instrument really has to give 100 files? I would guess 7 tones times long/short times hard/soft would max give 7 x 2 x 2 = 28 files.

And the third option. I always liked to hunt for options to create usable sounds out off nothing in all day life. That can be simple one tone base sounds or whatever. Now i'm thinking of starting to share those.

Which get's me back to the simpler version of the question.
Is there also a way to start with making "simple" sample packs? And then how 2 do that best? Is all tones hard/soft and long/short enough?

User avatar
briandc
Establlshed Member
Posts: 1302
Joined: Sun Apr 29, 2012 3:17 pm
Contact:

Re: How2 make samples??

Postby briandc » Sun Oct 29, 2017 7:26 pm

I'd say Audacity is very good for recording. Make sure you check your settings (they say that 44100 or 48000, 16-bit is sufficient for us humans) and check the "options" when you export to save..selecting preferably a lossless format like flac, and the best quality when saving.

Swami or PolyPhone will import the files for making a SoundFont. BUT, these two apps may require that you save your audio samples as .wav files, so test these first.

brian
Have your PC your way: use linux!
My sound synthesis biome: http://www.linuxsynths.com

User avatar
42low
Establlshed Member
Posts: 1541
Joined: Sun Apr 17, 2016 2:31 pm
Location: Netherlands

Re: How2 make samples??

Postby 42low » Sun Oct 29, 2017 10:03 pm

briandc wrote:I'd say Audacity is very good for recording.


I agree Brian. Although for instance Ardour records great too. And easier to record and edit multiple recordings straight after each other without pauses.

briandc wrote:Make sure you check your settings (they say that 44100 or 48000, 16-bit is sufficient for us humans) and check the "options" when you export to save..selecting preferably a lossless format like flac, and the best quality when saving.


It's my philosophy to always record at high rates. I usually record on 96000hz. A daw is usually 32 floating internal already. And i usually export recordings at 24-bit.
Is that needed for samples? Or what rates are common for samples?

j_e_f_f_g
Establlshed Member
Posts: 987
Joined: Fri Aug 10, 2012 10:48 pm

Re: How2 make samples??

Postby j_e_f_f_g » Mon Oct 30, 2017 4:21 am

96KHz is bad for sampling. First of all, some audio interfaces actually perform better at lower sample rates. Secondly, a single pitch of nearly any musical instrument has no content above 20KHz of interest to a human. 96KHz is useful only if you're using something that implements over-sampling, which is not the case here. Otherwise, it just wastes ram and disk space.

Do sample at 24 bits rather than 16. The extra dynamic range helps avoid clipping during recording. After you've recorded the samples, also record 3 seconds of "silence" from your interface to capture any inherent background noise from your recording environment. Later, you can use this file with some "noise reduction algorithm" to remove the background noise from your other samples. Use a good algorithm (like Adobe"s Audition), rather than one like Audacity's which makes the sample sound like it was swept by a phase shifter.

Normalize the samples once before editing. After all editing is finished (except for looping), convert the still-normalized samples to 16-bit WAVE files.

Looping is done last. It requires a lot of expertise which is best left to another topic. For a successful loop, pitch and volume fluctuations must first be removed. I use Celedyne's pitch correction, and a subtle compressor (sometimes multi-band if there are timbre fluctuations, but here, Abobe Audition's auto-heal is great). When looping, use software that offers a 50% (not just 100%) crossfade algorithm, such as Waveosaur. 50% often works better.

User avatar
sadko4u
Establlshed Member
Posts: 584
Joined: Mon Sep 28, 2015 9:03 pm

Re: How2 make samples??

Postby sadko4u » Mon Oct 30, 2017 9:32 am

42low wrote:I agree Brian. Although for instance Ardour records great too. And easier to record and edit multiple recordings straight after each other without pauses.

Ardour is good for recording huge amount of samples with one shot. Then you can simply cut samples and define range for each sample. Then you can export all samples, again, with one shot. Also remember that simple similar work has always better performance than complex.
For example, I had to record audio files for IVR service. So for each phrase I should record several takes so the people who tuned this IVR service could select the best take for the voice menu item.
The first thing, for time economy I just recorded a girl and asked she to read all required phrases from the paper. When there were problems with diction or pronouncing, we paused recording to train the correct sounding. So for about 2 hours we've done more than 100 takes.
Then, the second my turn what I've done I've cut silence between phrases. I'ts simple scroll & cut operation.
The third turn was: I've aligned the beginning of all phrases to the grid. Simple scroll & move
The fourth turn: I've created ranges around phrases without naming it. Simple create range, scroll & move bounds.
The fifth turn: I've named all ranges according to the phrase number and take number. Simple scroll & rename range.
Then I've done post-processing: corrected frequency response, added compression, saturation and limiting.
And the final step, I've just ran 'export' and specified all created regions.
So overall montage work was done within 2-3 hours and voice tuning within 1 hour. If I did turns 2-5 for each cut at one time, I think I could spend much more time (2 or 3 days).

42low wrote:It's my philosophy to always record at high rates. I usually record on 96000hz. A daw is usually 32 floating internal already. And i usually export recordings at 24-bit.
Is that needed for samples? Or what rates are common for samples?

I don't think that sample rate greater than 48k is required. Also remember the higher sample rate is the larger is the sample library.

nilshi
Establlshed Member
Posts: 236
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: How2 make samples??

Postby nilshi » Mon Oct 30, 2017 1:35 pm

42low wrote:For a simple 7 tones instrument 105 samples could sound as very much.
So does that 7 tones instrument really has to give 100 files?


Yes. The most important type of samples is for repetitions, before taking any extra sample for dynamics or tone duration into account.
When I hear "simple 7 note instrument" I think Mallets. Note repetition is extremely common here. My number "5" was not arbitrary. It is a very common grouping. Like this:

mallets-repetition.png


Each of these notes needs its own recorded sample, otherwise it will sound bad.
You do not have the required permissions to view the files attached to this post.

j_e_f_f_g
Establlshed Member
Posts: 987
Joined: Fri Aug 10, 2012 10:48 pm

Re: How2 make samples??

Postby j_e_f_f_g » Mon Oct 30, 2017 2:27 pm

nilshi wrote:The most important type of samples is for repetitions


What nilshi is referring to is a technique commonly called "round robin sampling". You have several samples all at a particular pitch, and all at approx the same volume. Each time the sampling engine (ie LinuxSampler) is asked to play that pitch, it plays a different sample (of that set). In this way, you get a slight variation (more human feel) each time that pitch sounds.

In an sfz file, this is implemented with the seq_length and seq_position opcodes. (Or it can be done with the random opcodes. But I prefer the more efficient seq opcodes).

For example, you have a loud snare hit, played by midi note d3.

Code: Select all

<group>
<region> sample=SnareLoud.wav key=d3


Now you record a second loud snare hit, and want to alternate the 2 samples each time midi note d3 is played. Since there are a total of 2 samples to alternate, set seq_length to 2. Then assign one sample seq_position 1, and the other sample seq_position 2.

Code: Select all

<group> seq_length=2
<region> sample=SnareLoud1.wav key=d3 seq_position=1
<region> sample=SnareLoud2.wav key=d3 seq_position=2


If you omit a seq_position, it's assumed to be 1. So the following is equivalent:

Code: Select all

<group> seq_length=2
<region> sample=SnareLoud1.wav key=d3
<region> sample=SnareLoud2.wav key=d3 seq_position=2


The old soundfont (sf2) format doesn't support round robin sampling.

User avatar
Michael Willis
Establlshed Member
Posts: 449
Joined: Mon Oct 03, 2016 3:27 pm

Re: How2 make samples??

Postby Michael Willis » Mon Oct 30, 2017 2:51 pm

sadko4u wrote:Ardour is good for recording huge amount of samples with one shot.

I did it that way with the pipe chime samples that I recently posted here. With a single audio track in Ardour I started recording and then played a chime several times (letting it completely finish vibrating before striking it again), then picked up a different chime and played several times, until I had sampled all of the chimes that I wanted. After that I picked my favorite ones, cut up the Ardour region to isolate them, and then exported each one as a separate .wav file.

42low wrote:I don't use and don't know LinuxSampler

You don't have to know much about LinuxSampler to write an SFZ file. You can just use Carla, which uses LinuxSampler behind the scenes but it hides most of the madness. To start out, I wrote a minimal SFZ file in a text editor, saved, used Carla to load, tested, then modified in my text editor, saved again, reloaded in Carla, tested again, and repeated until I was happy with it.

The hardest part for me is that SFZ has a lot of different directives, and documentation is scattered around the internet, so I think it is best to find some examples to follow. I looked at SFZ files from No Budget Orchestra and Virtual Playing Orchestra to get some ideas of how they programmed some of their instruments.

42low wrote:For a simple 7 tones instrument 105 samples could sound as very much.

You don't necessarily need 105 samples for a 7 tone instrument. It depends on how many velocity layers, how many round robins, and how many distinct pitches you want to record. For example, let's say your notes are C4, D4, E4, F4, G4, A4, and B4. You might get away with only recording C4, F4, and B4. You can program the SFZ to tune them up and down to play the missing pitches. Then let's say you want 3 velocity layers (maybe p, mf, and ff) and 2x round robin. That's 3 * 3 * 2 = 18 samples. Of course it might sound better if you increase one or more of those numbers, which gives you a much higher multiple of samples that you have to record, but that's for you to decide.

j_e_f_f_g
Establlshed Member
Posts: 987
Joined: Fri Aug 10, 2012 10:48 pm

Re: How2 make samples??

Postby j_e_f_f_g » Mon Oct 30, 2017 3:01 pm

Note that polyphone's "custom releases in an instrument" is achieved in sfz format via the trigger opcode. For example, you have a looped trumpet pitch at c5, and a second sample of just the release of that pitch. Specify "trigger=release" for the latter.

Code: Select all

<region> sample=TrumpetLoop.wav key=c5 ampeg_release=0.1
<region> sample=TrumpetRelease.wav key=c5 trigger=release loop_mode=one_shot ampeg_attack=.05


Nearly all the No Budget Orchestra sfz files use release samples.

User avatar
42low
Establlshed Member
Posts: 1541
Joined: Sun Apr 17, 2016 2:31 pm
Location: Netherlands

Re: How2 make samples??

Postby 42low » Wed Nov 01, 2017 12:23 pm

nilshi wrote:
42low wrote:For a simple 7 tones instrument 105 samples could sound as very much.
So does that 7 tones instrument really has to give 100 files?


Yes. The most important type of samples is for repetitions, before taking any extra sample for dynamics or tone duration into account.
When I hear "simple 7 note instrument" I think Mallets. Note repetition is extremely common here. My number "5" was not arbitrary. It is a very common grouping. Like this:

mallets-repetition.png


Each of these notes needs its own recorded sample, otherwise it will sound bad.


I have lot's off respect for your explanations and thank you on my knees for that, and for sure i put those fixed in my mind. But i still don't understand it.
How come that for instance a bass guitar sfz pack i have has only 100 waves in it, while a bass guitar has much more tones than 7 and has much more possible variations in sound? I get it that you need to vary the samples for different sounds, but a 100 on 7? That would be about 14 samples each tone?? Seem really as very very much to me.
Were other sample packs from one octave instruments (more than 7 tones) have no more than about 30-40 files? I really don't get it, sorry.

Like i already said i guess i have to forget sfz and LinuxSampler for this moment by lack of experience. I'm not gonna make 100+ recordings from 7 tones to start with it. And then the multiple octaves organ which with similar approach then should become about 800 files?? Naaaahh, not for starting.
I think i have to put my bet on non-sfz packs and lesser extended but still with a slight variation of sound samples. Can always jump into sfz after gathering some experience.

At the end, if sampling myself a often use a set of simple sounds (sometimes even no more than one file) setting and editting them to make them sound good better and like i want them. I can do without the extended sfz's too.
Last edited by 42low on Wed Nov 01, 2017 12:42 pm, edited 2 times in total.

User avatar
42low
Establlshed Member
Posts: 1541
Joined: Sun Apr 17, 2016 2:31 pm
Location: Netherlands

Re: How2 make samples??

Postby 42low » Wed Nov 01, 2017 12:34 pm

Michael Willis wrote:You don't have to know much about LinuxSampler to write an SFZ file. You can just use Carla, which uses LinuxSampler behind the scenes but it hides most of the madness. To start out, I wrote a minimal SFZ file in a text editor, saved, used Carla to load, tested, then modified in my text editor, saved again, reloaded in Carla, tested again, and repeated until I was happy with it.

I don't use Carla either, and therefore don't know that either.

But if i record in the C4-D4-E4-etc and record that in some available variations, played hard or soft, long or short, open or closed, muted or not, etc ... so at the end offering a slightly fun extended pack of about instrument let's say 30 files in this 7 tones case ... can't people then don't make their own sfz to use it in LinuxSampler?

Makes me think further ....
I would even be willing to put a ReadMe file in it with credits for those who want to share that build sfz with me to spread. Aren't we an opensource community? :mrgreen:
My simple goal is to share some fun sounds back to the community for thanks that i may use theirs. And to me it doesn't matter how, where it doesn't matter to me if they are used by all in all kind of way's and all kinds off software. As long as it are usable quality soundfiles.

nilshi
Establlshed Member
Posts: 236
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: How2 make samples??

Postby nilshi » Wed Nov 01, 2017 12:55 pm

No problem. Let me suggest another course of action. I understand that you might be a bit overwhelmed here, so let's take it from the beginning. The goal is to get *something* in a reasonable amount of time, that works. For your 7 tone instrument:

Steps to a sampled instrument
  • Prepare your recording setup. Microphone, Instrument, Room, Ardour/Audacity etc.
  • Take the tone in the middle and record that, once.
  • Cut the recording so the tone starts directly at the beginning
  • Load the resulting .wav file into a program called "samplv1" https://samplv1.sourceforge.io/
  • In the samplv1 GUI set dial right next to the waveform display to the note you have recorded. If the tone you recorded is a "A3", set the field to A3 to give the sample engine a tuning root.
  • The other 6 tones and dynamic variations are done by the sampling engine through pitch shifting and simply making the playback softer and louder


Return to “Samplers & samples”

Who is online

Users browsing this forum: No registered users and 3 guests