MUSICONICA
+  United Trackers
|-+  General» Sound Production» Sample tuning: is there any easy way to do this?
Username:
Password:
Pages: [1]
  Print  
Author Topic: Sample tuning: is there any easy way to do this?  (Read 9241 times)
trackwolf
Newbie
*
Posts: 2


View Profile
« on: October 28, 2007, 07:04:56 PM »

Hello everyone,

this is obviously a newbie question, but I'm totally new to tracking and I cannot continue until I solve this problem. So: is there any simple way how to tune samples? I know that I can tune first sample/instrument by ear and then tune the others relative to it, but this is very slow and incomfortable process, especially in case that many of samples is used. So I wonder if is there any quick method to do this, like freeware sample tuning application or possibility to determine exact pitch of sound in sound editor (like Audacity). Thanks for your ideas, all are welcome...

I'm using Milkytracker under Linux, but I can run Win-software on my other machine as well.
Logged
fingersoup
Administrator
Sr. Member
*****
Posts: 273


View Profile WWW
« Reply #1 on: October 28, 2007, 09:26:39 PM »

http://www.analogx.com/contents/download/audio/autotune.htm

AnalogX has a bunch of software that's useful for musicians.  I haven't tried this one, but it's worth giving it a go.   I have no idea what the methods used here are (resample or just tweak playback speed) but these are essentially the 2 ways of changing pitch.

1.  In your audio editing program, you may have a pitch shifter that will resample the audio - ie: mathematically adjust the pitch at every sample without affecting playback speed.  This actually alters the waveform so it may introduce artifacts.  It usually does a good job on most samples though.  Your sample will be 5 seconds long before you alter the pitch and 5 seconds long after.  It will tend to keep the same general tone though(ie: sharp sounds stay sharp, soft sounds stay soft).

2.  The other option is to alter the sample rate.   This is the classic sample tuning found inside almost all trackers, and is also how most trackers alter pitch for different notes.  The sample is sped up or slowed down to match pitch.  This is usually done in the tracker, but if the sample format carries sample rate info, then it can also be done in an external editor.  Thus a 5 second sample tuned up, may be 4.5 seconds long after editing. a 5 second sample tuned down may be 5.5 seconds.   As it keeps the same shape, all the audio info is kept, but the sample will sound tinny as it gets higher, and lethargic as it lowers.
Logged

I thought you beat the inevitability of death to death, Just a little bit... - TTH
trackwolf
Newbie
*
Posts: 2


View Profile
« Reply #2 on: October 31, 2007, 12:44:17 AM »

Thank you very much, AnalogX's AutoTune worked perfectly for me. Problem solved smiley
Logged
Dravonk
Newbie
*
Posts: 3


View Profile
« Reply #3 on: January 01, 2008, 12:24:32 PM »

(...) possibility to determine exact pitch of sound in sound editor (like Audacity).
There is the frequency analysis in Audacity which works on a selection. I got best results when I set the window function to Gaussian, the other functions didn't give me the correct frequency. Hold your mouse pointer close the peak and it will tell you the values.

2.  The other option is to alter the sample rate.   This is the classic sample tuning found inside almost all trackers, and is also how most trackers alter pitch for different notes.
How exactly does the tuning work? I discovered trackers (or more precisely, the tracker from www.soundtracker.org) only yesterday. I wrote a tiny script to create a 440 Hz sample but now I wonder how I get the sample to play at normal speed when I enter the note A-4.

There are the options RelNote and Finetuning, but how exactly do they work? I searched for informations about this, but unfortunately, I couldn't find any documentation.
Logged
fingersoup
Administrator
Sr. Member
*****
Posts: 273


View Profile WWW
« Reply #4 on: January 01, 2008, 06:07:08 PM »

The sample must be re-pitched to Middle C.  this will usually be C-3, C-4 or C-5 in your tracker.
Logged

I thought you beat the inevitability of death to death, Just a little bit... - TTH
Dravonk
Newbie
*
Posts: 3


View Profile
« Reply #5 on: January 02, 2008, 11:07:49 AM »

I am looking for some kind of formula. When my sample is recorded at 44100 samples/second and I want it to play at that speed for a given note (let's say A-4), which values would I have to enter? What is the default speed for a note when I do not change any tuning parameters?

Ah, ok, I found the value now in the Mod FAQ from alt.binaries.sounds.mods:

Quote
MOD samples generally use a sampling rate of 8363Hz for a C in the second octave, so try this for starters (or an integer multiple). The more advanced formats with variable CxSpds pose more of a problem, you're basically left with your ears and perhaps a musical instrument to get them right. Note that a lot of MOD samples are not tuned to C. Quite often, an A is played instead when a C should be. See appendix H for a table of note frequencies to help you calculate the appropriate sampling rate for transposing wrongly tuned instruments.
« Last Edit: January 02, 2008, 11:14:35 AM by Dravonk » Logged
fingersoup
Administrator
Sr. Member
*****
Posts: 273


View Profile WWW
« Reply #6 on: January 05, 2008, 09:06:37 AM »

I remember this table now...  Forgot where it was, to be honest.  I'll Link the alt.binaries.sounds.mods FAQ v2.6 directly: Part 1 / Part 2


Ypu've likely figured it all out, but I'll re-post and explain what is going on.  The following is a list of standard notes in a scale, and their frequencies in Hz

Quote from: alt.bin.sounds.mods faq

(supplied by Chris Craig, author of GoldWave)

C  - 261.7    E  - 329.6    G# - 415.3
C# - 277.2    F  - 349.2    A  - 440.0
D  - 293.7    F# - 370.0    A# - 466.2
D# - 311.1    G  - 392.0    B  - 493.9

Bear in mind that doubling the sampling rate raises a sound by one octave,
halving the rate lowers the note by one octave.

Here's the math, put in simple terms that a person can understand:

Old Sample rate / Old note Frequency * New Note Frequency = New Sample Rate

This makes perfect sense to most people. Take a sample, split it into it's smallest part (1 Hz) then multiply it by the # of Hz you want it to be....

To a computer that is doing integer math, doing the division first could cause your program/calculation to lose accuracy... As these are all multiplication/division, you can perform the operations in any order.  Thus rewriting it as:

Old Sample Rate * New Note Frequency / Old Note frequency = New Sample Rate

works better and causes less data loss through truncation (not that it'll make a huge difference with larger sample rates)

Most Samplers these days have transposing effects that do the math for you, and resample it to whatever the sample rate is set at, without having to set the base frequency inside the tracker (After Windows 98 got installed on my PC, I used Goldwave to convert the sample altogether right up until Audacity came out).  You're trying to do it the old-school efficient way though.  Which is equally effective, but requires you to get mathematical.  Most of us just got lazy....  or decided to sample Middle C instead Smiley
Logged

I thought you beat the inevitability of death to death, Just a little bit... - TTH
Dravonk
Newbie
*
Posts: 3


View Profile
« Reply #7 on: January 05, 2008, 12:27:19 PM »

Thank you!
You're trying to do it the old-school efficient way though.  Which is equally effective, but requires you to get mathematical.  Most of us just got lazy....  or decided to sample Middle C instead Smiley
I already changed my scripts to produce a C-4. wink
Logged
Pages: [1]
  Print  
 
Jump to:  

Theme by webtechnica.com.
Page created in 0.301 seconds with 15 queries.