Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Music & Sound FX / Midi controlled software sampler

Author
Message
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Jun 2008 17:21 Edited at: 11th Jun 2008 17:25
I begun working on a sampler-like application the other day.
For those of you who don't know what I mean with that, it's kind of like an application in which you load soundsets, patches. Theese contains audio samples which are assigned to certain keys, accessed via an external midi controller (like a keyboard) which is connected to your computer.

The midi message handling is done by my midi plugin (see the announcements thread) and the rest is programmed in DBPro, for the time being using blueGui for the interface.

As you can see from the mandatory screenshot, I haven't thought much about the interface, but focused on the functionality.



So what can this sampler do as of yet?
Receive midi data over any installed midi device on the users system.

Use the midi data to trigger and release notes over all 16 available channels. Each patch (one can currently import 16 separate ones) can then be assigned to listen to a channel of the users choice.

The sounds playback volumes are based on how hard you hit the keys on your controller (assuming that it has touch response, of course).

The sounds in the patches can be stretched to generate several tones with different pitch.

Possibility to alter each patch's pan. (Notice that while the volume slider is there, it is not functional as of yet).

I've also written a poor homemade reverb routine that you can set the level of. But hey, it works!

While you must change the patch view to edit their settings, you can still play using any patch at any time (ie. you edit patch 3, but can at the same time play using both patch 1, 2 and 3).


It does however seem that DarkBasic is a bit too slow for this kind of processing and occassionally, notes thus get stuck for me.
That could mostly be due to the fact that I'm running a lot of other processes at the same time (no, I haven't tried to close them yet), so it might work better for you.

Tell me what you think
Download demo
(The download is rather big (~19Mb) mostly due to the samples used by the patches).

Also, notice that this is a work in progress. I'm aware that you can't delete your loaded patches as of now and that the pan slider is reset when changing the patch view.

"I kören hörs de brummande busarna Björnligan och Gondolen"
Graduation in less than one week.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 11th Jun 2008 18:43
Are you using db pro`s built in playback commands ?

If so you should check out torreys enhanced audio plugin ,don`t thinks it`s as glitchy. + it plays all sound from one command .

ps. i too also have um1 usb midi interface works great with mi laptop usb 2

toshiba satellite 1.6 core duo + nvidia geforce go 7300
windows xp pro.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Jun 2008 19:22
I would use torrey's, but it cannot alter the frequency (it seems to have a pitch command, but that can only half / double the frequency). Also, the audio plugin doesn't give one the option to clone the sounds and hence a lot of inneccessary memory would likely be used to load patches which might in fact only use a few samples.

Heh, yeah, it's a fine device

"I kören hörs de brummande busarna Björnligan och Gondolen"
Graduation in less than one week.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 1st Oct 2008 01:34
@rudolpho

sorry to bring an old thread back up

hi i am making a software sampler similar to the one you did , i was thinking i could do the gm sounds because the built in soft synth is too slow .

i thought it could mabey be integrated into qmidi or as a standalone.

please could you answer a few questions for me , many thanks

chunks



how many samples did you use per patch , was it 1 for each note then pitched up for each octave ?

how did you stop the sound from clicking on each keypress ?

did you use clone sound so each note had its own sound slot ?

ps:
i will send it to you for testing soon if ya want and possibly give some feedback .

gonna be a few days i expect with my skills lol .


nvidia geforce 8600gt + amd athlon 64
windows xp pro.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 1st Oct 2008 16:03 Edited at: 1st Oct 2008 16:07
No problem; just nice to see that someone cares about this groundbreaking discovery of mine

I have thought up quite a few improvements since this thing, but I'll try to answer your questions as un-elaborate (a word?) as possible, in order not to get too far into the theoretic field

The samples used differs between patches (which is quite a good idea as certain patches might require higher detail (as in more samples) to sound decent). It is determined by the patch files, as I recall (I hardcoded these, but it wouldn't be hard to make an editor for the like).
Basically you have a core sample that is placed on position X and then pitched down a steps and equally up b steps (a doesn't need to be equal to b, of course).

Quote: "how did you stop the sound from clicking on each keypress ?"

I'm not quite sure about what you mean with this?

And yes, I cloned the sounds to fit into the places as described in the first answer (into one slot per note, but limited to a keyrange determined by the patch file also).
The wise thing to do here would be to actually have four or so identical samples per note so that if you play the same note again before the previous tone has rung out, you can trigger a new one instead of get the clipping that is present in this experiment.

For further detail, one can actually have several sounds assigned to the same note and play one depending on how hard the note is struck (velocity) or some other controller. That can get quite complex though, so one's better off having a general idea before trying to implement such a system.

And finally, yes, I'd be happy to try it out

(I find this stuff rather interresting, so if there's anything I can help with, just tell me )


Edit: Oh yeah, it doesn't say here, but with the latest version of my midi plugin, you won't miss any incomming midi messages (thus getting rid of the enervating stuck notes that happens every now and then in the program I posted here).

"I kören hörs de brummande busarna Björnligan och Gondolen"
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 1st Oct 2008 21:21
@rudolpho

iv`e got an octave of samples starting at middle c ,can these be pitched to cover the whole range of the keyboard using set sound speed or will it sound rubbish .

would like to have samples of the whole keyboard but that would be way too big even at poor sample rate.

how do they do it in the vsti`s and such they are just a tiny dll and produce some awesome sounds.

what i meant by the clicking is somtimes when a sound in dbp is started it click`s ,i think smd has a fix for this i will ask him.

All ive got so far is using sample of piano in A then dividing/multiplying the sample rate that gives the difference between the notes , don`t know if it`ll work with sharps/flats yet.

also it sounds a bit poor the lower down you get and a delay with changing the sound speed ,what i really need is to be able to change the pitch without affecting the speed ,wonder if this can be done in dbp mabye with memblocks any ideas ?

anyways i will keep trying as i`m also interested in this too ,and i would like to add some dsp but i think that is way beyond my capabilities at the moment.

thanks chunks

nvidia geforce 8600gt + amd athlon 64
windows xp pro.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 2nd Oct 2008 00:17
Well, depending on the sound I'd say that 4 to 5 whole notes (with the sharps / flats in between) can sound acceptable to be sourced from one pitched sound. That is, half the way down and half the way up.
It will probably still sound pretty unrealistic, but one has to consider memory usage, so if you're going to have sixteen simultaneous patches (with the percussion channel of course needing to have one sound per key), this seems like a reasonable solution.
Certain sounds (like the power sawtooth in my example) actually use just about one sample per octave I think and still sounds prtty well, but the same naturally doesn't work for "unsynthetical" sounds such as a piano.

Actually most professional samplers have several samples per key (for example a piano instrument I have uses 574 samples with a total filesize of almost 2Gb).
Naturally that leads to the result that you can't have very many patches loaded at once unless you have a great deal of RAM available. It is only recently that a solution has been created (that works properly, that is); DFD (direct from disc).
This is a very complicated process, seeing as it took professional audio software creators years to get it to work satisfactory from what I've heard, in which you load a small buffer of each sound into memory. Then whenever a sound is actually played, it loads the rest of it in in realtime.
That's something I think everybody around here would applaud if you managed to do in DBPro
(No seriously, don't bother, it would need tremendous speed).
(On a side note, this DFD method requires a lot from the processor instead).

If you mean vst's that doesn't use samples stored somewhere in external files, they actually generate their sounds themselves during runtime (mimicing an analogue synthesizer, begining with a simple waveform and then applying filters to this in a effect chain).

About the clicking, I don't think I've ever experienced that myself
As far as I know, I didn't do anything special, at least not with the intention to solve that, in this project.

For altering the frequency, you would want to multiply / divide the previous frequency with 2^ln(1 / 12). It gives the correct frequency difference between each halftone, so yeah, you'll get the sharps and flats as well.

Hm... getting a delay when changing the speed?
May I have a look at that function?
About trying only to change the pitch, but not the speed - this is possible through some complicated digital calculations.
Believe me when I say that the result is worse than the standard frequency change (it basically means that, should you wish to set the pitch to half the initial value, every sample (here I mean the actual byte / word / etc. data of each block within the audio data by "sample") would be written twice, hence really "digitalizing" the sound, if you get what I mean).

"I kören hörs de brummande busarna Björnligan och Gondolen"
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 7th Oct 2008 00:28
So how is it going?
You actually tempted me enough to revisit the sampler project myself, so I locked myself away in my basement for the last four days or so and actually managed to get something simple working rather decent (it runs at several hundred loops per second, which I wasn't sure whether DBPro was really up for, but luckily its sound processing turned out to be rather fast )

I'll post a separate thread with a demo download for this (not trying to compete with yours of course, but as said, I found it to interresting to avoid).

"I kören hörs de brummande busarna Björnligan och Gondolen"

Login to post a reply

Server time is: 2024-03-28 15:50:18
Your offset time is: 2024-03-28 15:50:18