SF2 positioning questions

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

Moderators: khz, MattKingUSA

zoco
Established Member
Posts: 177
Joined: Fri Jan 25, 2019 4:04 pm

SF2 positioning questions

Postby zoco » Mon Feb 25, 2019 4:46 pm

Creating an sf2 file on a 61 keys keyboard.
Were do the sounds position themselves when used on a 48 or 25 keys keyboard? Is this concentrated on the centre key? Or the left key? Otherwise?
Or asked differently, which keys disappear with the less keys keyboard because not enough keys?

nilshi
Established Member
Posts: 290
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: SF2 positioning questions

Postby nilshi » Mon Feb 25, 2019 4:56 pm

That depends entirely on the hardware keyboard.

The keys are absolute, each one has a number between 0 and 127. A midi instrument can decide which ones to use. Since there is electronics in the keyboard it is also possible to change the mapping, for example by adding or subtracting 12, which results in octave-transposition.

A sensible default, which most manufactureres follow, is to have the keyboard centered around key 60, which is the middle C.

zoco
Established Member
Posts: 177
Joined: Fri Jan 25, 2019 4:04 pm

Re: SF2 positioning questions

Postby zoco » Mon Feb 25, 2019 5:16 pm

nilshi wrote:A sensible default, which most manufactureres follow, is to have the keyboard centered around key 60, which is the middle C.


So am i understanding right that then that key 60 on 127 board will become around key 30 on 61 keyboard, around key 24 on 48 keyboard, and around key 12 on 25 keyboard? Always centred?

Or asked differently? On what keys should you concentrate the sounds on? What should you (and i) take as base positioning?
Last edited by zoco on Mon Feb 25, 2019 5:19 pm, edited 1 time in total.

nilshi
Established Member
Posts: 290
Joined: Wed Oct 22, 2008 9:05 pm
Contact:

Re: SF2 positioning questions

Postby nilshi » Mon Feb 25, 2019 5:18 pm

No, no matter how small the keyboard is, most likely it will have key 60 in the center.
All keyboards have a +/- octave button.

What you describe is not a problem at all.

zoco
Established Member
Posts: 177
Joined: Fri Jan 25, 2019 4:04 pm

Re: SF2 positioning questions

Postby zoco » Mon Feb 25, 2019 5:24 pm

nilshi wrote:No, no matter how small the keyboard is, most likely it will have key 60 in the center.
All keyboards have a +/- octave button.

What you describe is not a problem at all.


So my central sound will be on my 61 keyboard the last key but one when octave on 0?
As far as i know my octave button doesn't shift the sounds to different keys, but just the octave of the sounds. So that snare drum stays on key 3, not shifting to another key with the octave button. I must try that to be sure.

So in that case it is a problem for me. I want to know which key to concentrate on as kind off basic positioning.
In the future i want to share my soundfonts to be used for every keyboard, were i want to keep the core sounds available, and let the minor sounds fall away. I can put the snare of a drum soundfont on key 1 but if that falls away on an less keys keyboard the drum soundfont will become useless.
I want to learn and know how a less keys keyboard will react to that.

zoco
Established Member
Posts: 177
Joined: Fri Jan 25, 2019 4:04 pm

Re: SF2 positioning questions

Postby zoco » Tue Feb 26, 2019 12:29 pm

Perhaps i wasn't clear that i probably don't understand the given answers enough.
I would still be pleased to learn what key to concentrate on as positioning target. Centre key? Left first key? Calculating?

j_e_f_f_g
Established Member
Posts: 1055
Joined: Fri Aug 10, 2012 10:48 pm

Re: SF2 positioning questions

Postby j_e_f_f_g » Tue Feb 26, 2019 1:55 pm

zoco wrote:put the snare of a drum soundfont on key 1


Don't do that. For unpitched instruments (drums, cymbals, various percussion), try to use General MIDI Drum mapping. For example, midi note number 38 plays a snare, note 36 plays a kick, 51 plays a Ride Cymbal, etc. Here's a chart for GM Drums.

Code: Select all

MIDI    Drum Sound          MIDI    Drum Sound
Note #                      Note #
 35   Acoustic Bass Drum     59   Ride Cymbal 2   
 36   Bass Drum 1            60   Hi Bongo
 37   Side Stick             61   Low Bongo
 38   Acoustic Snare         62   Mute Hi Conga
 39   Hand Clap              63   Open Hi Conga
 40   Electric Snare         64   Low Conga
 41   Low Floor Tom          65   High Timbale
 42   Closed Hi-Hat          66   Low Timbale
 43   High Floor Tom         67   High Agogo
 44   Pedal Hi-Hat           68   Low Agogo
 45   Low Tom                69   Cabasa
 46   Open Hi-Hat            70   Maracas
 47   Low-Mid Tom            71   Short Whistle
 48   Hi-Mid Tom             72   Long Whistle
 49   Crash Cymbal 1         73   Short Guiro
 50   High Tom               74   Long Guiro
 51   Ride Cymbal 1          75   Claves
 52   Chinese Cymbal         76   Hi Wood Block
 53   Ride Bell              77   Low Wood Block
 54   Tambourine             78   Mute Cuica
 55   Splash Cymbal          79   Open Cuica
 56   Cowbell                80   Mute Triangle
 57   Crash Cymbal 2         81   Open Triangle
 58   Vibraslap


For pitched instruments, the frequency of a sample determines what midi note number it maps to. Middle C is a frequency of 261.6 hz. And that is assigned to midi note number 60. So if you have a sample tuned to 261.6 hz, assign it to midi note 60. Here's a chart of midi note numbers and their assigned frequencies.

Code: Select all

    MIDI                 MIDI                   MIDI
    Note   Frequency     Note   Frequency       Note   Frequency
 C  0    8.1757989156    12    16.3515978313    24    32.7031956626
 Db 1    8.6619572180    13    17.3239144361    25    34.6478288721
 D  2    9.1770239974    14    18.3540479948    26    36.7080959897
 Eb 3    9.7227182413    15    19.4454364826    27    38.8908729653
 E  4   10.3008611535    16    20.6017223071    28    41.2034446141
 F  5   10.9133822323    17    21.8267644646    29    43.6535289291
 Gb 6   11.5623257097    18    23.1246514195    30    46.2493028390
 G  7   12.2498573744    19    24.4997147489    31    48.9994294977
 Ab 8   12.9782717994    20    25.9565435987    32    51.9130871975
 A  9   13.7500000000    21    27.5000000000    33    55.0000000000
 Bb 10  14.5676175474    22    29.1352350949    34    58.2704701898
 B  11  15.4338531643    23    30.8677063285    35    61.7354126570

 C  36  65.4063913251    48   130.8127826503    60   261.6255653006
 Db 37  69.2956577442    49   138.5913154884    61   277.1826309769
 D  38  73.4161919794    50   146.8323839587    62   293.6647679174
 Eb 39  77.7817459305    51   155.5634918610    63   311.1269837221
 E  40  82.4068892282    52   164.8137784564    64   329.6275569129
 F  41  87.3070578583    53   174.6141157165    65   349.2282314330
 Gb 42  92.4986056779    54   184.9972113558    66   369.9944227116
 G  43  97.9988589954    55   195.9977179909    67   391.9954359817
 Ab 44  103.8261743950   56   207.6523487900    68   415.3046975799
 A  45  110.0000000000   57   220.0000000000    69   440.0000000000
 Bb 46  116.5409403795   58   233.0818807590    70   466.1637615181
 B  47  123.4708253140   59   246.9416506281    71   493.8833012561

 C  72  523.2511306012   84  1046.5022612024    96  2093.0045224048
 Db 73  554.3652619537   85  1108.7305239075    97  2217.4610478150
 D  74  587.3295358348   86  1174.6590716696    98  2349.3181433393
 Eb 75  622.2539674442   87  1244.5079348883    99  2489.0158697766
 E  76  659.2551138257   88  1318.5102276515   100  2637.0204553030
 F  77  698.4564628660   89  1396.9129257320   101  2793.8258514640
 Gb 78  739.9888454233   90  1479.9776908465   102  2959.9553816931
 G  79  783.9908719635   91  1567.9817439270   103  3135.9634878540
 Ab 80  830.6093951599   92  1661.2187903198   104  3322.4375806396
 A  81  880.0000000000   93  1760.0000000000   105  3520.0000000000
 Bb 82  932.3275230362   94  1864.6550460724   106  3729.3100921447
 B  83  987.7666025122   95  1975.5332050245   107  3951.0664100490

 C  108 4186.0090448096  120  8372.0180896192
 Db 109 4434.9220956300  121  8869.8441912599
 D  110 4698.6362866785  122  9397.2725733570
 Eb 111 4978.0317395533  123  9956.0634791066
 E  112 5274.0409106059  124 10548.0818212118
 F  113 5587.6517029281  125 11175.3034058561
 Gb 114 5919.9107633862  126 11839.8215267723
 G  115 6271.9269757080  127 12543.8539514160
 Ab 116 6644.8751612791
 A  117 7040.0000000000
 Bb 118 7458.6201842894
 B  119 7902.1328200980
 


For example, you sample the low open E string on a bass. That's tuned to 41.2 hz. From the above chart, that sample should be assigned to midi note 28. You sample the low open E string on a guitar. That's tuned an octave higher to 82.4 hz. From the above chart, that sample should be assigned to midi note 40. You sample the next fret up (a low F). That plays at 87.3 hz and is assigned note 41.

The note range of the controller is irrelevant. Follow the above midi standards.

zoco
Established Member
Posts: 177
Joined: Fri Jan 25, 2019 4:04 pm

Re: SF2 positioning questions

Postby zoco » Tue Feb 26, 2019 6:47 pm

Ok, thank you. This is interesting information.

zoco
Established Member
Posts: 177
Joined: Fri Jan 25, 2019 4:04 pm

Re: SF2 positioning questions

Postby zoco » Fri Mar 01, 2019 3:18 pm

Ok. Experimenting with Polyphone cleared up a lot.

Polyphonic automatically uses my key #60 as a reference.
I still wonder if i create a soundfont around that key 60, were that one will turn up on a 48 or 25 keys keyboard.


Return to “Samplers & samples”

Who is online

Users browsing this forum: No registered users and 2 guests