Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411430 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 08:38:59 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperAudioInstrument Note Archive
Pages: [1]
Print
Author Topic: Instrument Note Archive  (Read 3425 times)
dustin
Level 6
*


View Profile
« on: September 13, 2008, 05:51:38 PM »

So for my next game I want to create the music programatically.  In order to do it though I need notes individualy recorded for different instruments.  For instance piano notes A through F, trumpet notes A through F, etc.  preferably in more then one octave.  It seems like there should be some way I could get this stuff (I mean midi files must have them in there somehow they play all those notes right?) without having to just record them all individually myself which would take forever (go into garage band make a new song play one note save repeat).  Does anyone have any laying around or know where I can get my hands on some.
Logged
muku
Level 10
*****


View Profile
« Reply #1 on: September 13, 2008, 05:56:42 PM »

MIDI files don't have the actual instrument sounds in them. They rely on the host soft-/hardware to synthesize the notes they contain into actual sounds. This is also why MIDIs can sound very different depending on the system you play them on.

My suggestion: Get some SoundFont player, e.g. this free one for the VSTi interface, implement it into your software, and then knock yourself out with various SoundFonts, to be found on sites like http://www.soundfonts.it/?a=soundfonts or http://www.hammersound.net/. Drawback: it could get quite memory/CPU intensive, but I guess you can't really avoid that once you start synthesizing real instruments in real time.

Or, if you are actually happy with the default MIDI sound on most PCs, just output MIDI data yourself and let the system handle it. Sounds pretty crappy though.
Logged
moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #2 on: September 13, 2008, 06:24:23 PM »

For the record I had done somethig similar for attack of the banjo on the high seas.
I needed to be able to play the correct sound when the player strikes a chord on a certain height on a virtual banjo.
I went to youtube to find a reference video of a guy playing banjo and striking all 5 chords.
Once I found it , I sampled a chord sound from this video, and using the video as a reference I adjusted the pitch so that I could find the sound of all the chords.
Then I had to make several tests until I could find the notes on each chords more or less correctly by changing the pitch. Once I had the numbers I programmed them in game.
I found out that to obtain the higher musical octave with the same note you need to multipliy the pitch by 2.
so It's not so difficult, you need to find one good sample of the instrument, then make some tests until you find the good pitch for each note (it helps to play a real life instrument there), then program all that Smiley
Of course there are chances it won't be 100 accurate, but oh well...
Logged

subsystems   subsystems   subsystems
Noyb
Level 9
****



View Profile WWW
« Reply #3 on: September 14, 2008, 12:25:12 AM »

If you can get a sample of a single note in the timbre you want, Audacity has built-in pitch modulation. Even lets you choose the relative pitch in terms of notes or steps. You can probably also write a macro (or "chain" in the program itself) to generate and save an octave or two given the initial sound, although it sounds better to pitch-shift the original instead of compounding the manipulation. I don't have perfect pitch though, so I'm not sure how badly it might distort the pitch/length.
Logged

muku
Level 10
*****


View Profile
« Reply #4 on: September 14, 2008, 04:56:58 AM »

But seriously, computing two octaves worth of notes from just one base note would sound terrible. Pitch isn't the only thing that changes with a real instrument when you play a different note; timbre is very important, it's tied very closely to overtones, also there's different attack/decay envelopes, and so on. I can sort of see it working with perhaps three or four samples per octave which you then use to fill in the remaining notes, but anything less than that I don't see working.
Logged
increpare
Guest
« Reply #5 on: September 14, 2008, 05:57:18 AM »

But seriously, computing two octaves worth of notes from just one base note would sound terrible. Pitch isn't the only thing that changes with a real instrument when you play a different note; timbre is very important, it's tied very closely to overtones, also there's different attack/decay envelopes, and so on. I can sort of see it working with perhaps three or four samples per octave which you then use to fill in the remaining notes, but anything less than that I don't see working.
Well you can get a reasonable approximation just transposing a single note around...it won't sound particularly 'realistic', but I don't think it usually sounds terrible.  Most tracker stuff is done this way, isn't it?
Logged
muku
Level 10
*****


View Profile
« Reply #6 on: September 14, 2008, 06:00:58 AM »

Hm. Trackers are usually used for electronic music though, aren't they? Of course it's much less of a problem with synthesizer sounds. I was more thinking of real instruments.
Logged
increpare
Guest
« Reply #7 on: September 14, 2008, 06:46:13 AM »

Hmm, there's quite a lot of varied stuff.  Here's an example: it has just one guitar sample in it.  It doesn't sound great, but it's not totally gross either (indeed, one can grow quite fond of the resulting instrument sound ) .  You might be able to find a lot of samples that might be useful embedded in tracker files here, say.
Logged
muku
Level 10
*****


View Profile
« Reply #8 on: September 14, 2008, 06:50:59 AM »

It seems to me that that doesn't sound any better than a standard MIDI patch on the Windows MIDI synthesizer or equivalent. So I guess I don't really see the advantage of using a sample-based format in this case.
Logged
increpare
Guest
« Reply #9 on: September 14, 2008, 07:12:30 AM »

So I guess I don't really see the advantage of using a sample-based format in this case.
Programming wise, it can be easier to manually play a sample at a certain frequency than getting a midi-interface set up.  If I were doing it, I'd probably initially go that sort of lazy route.  MIDI would be better though, yeah.
Logged
dustin
Level 6
*


View Profile
« Reply #10 on: September 14, 2008, 08:49:32 AM »

yeah to me just playing notes at the correct frequency sounds much easier then setting up a whole midi-interface.  Does any one know if theres any easy way to get the samples out of a .mod file or would it just be to record one note in the .mod
Logged
increpare
Guest
« Reply #11 on: September 14, 2008, 08:58:47 AM »

yeah to me just playing notes at the correct frequency sounds much easier then setting up a whole midi-interface.  Does any one know if theres any easy way to get the samples out of a .mod file or would it just be to record one note in the .mod
If you use a tracker like modplug (windows) or milkytracker (mac) you can open the trackers files directly, and then export the samples as WAVs.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic