How to generate a real bass guitar sound either in C/C++ or Java?

﹥>﹥吖頭↗ 提交于 2019-12-11 08:09:01

问题


I been doing an extensive research in the internet because I need a way to generate real bass sound (like an electric bass guitar) from a program. The thing is Ive been looking in MIDI ways to produce that sound, but Im not sure if thats the right thing to do, actually I have little knwoledge about this subject, is my first trying anything related to produce sound from raw coding. I been looking into different APIs to help me, most of them open source to see what are the doing, but I found them very complex and with a really steep learning curve and little documentation. I also been lookin in open source programs like tuxguitar, made in java, which is similar to GuitarPro, so I could see how the produce the bass sound, I still have some code to scann so I can found what I am looking for, but I fear is wont be what I need or able to do. So to wrap all this up, my question is: is there a way to produce a real musical bass sound, either by native code or any API, no necesarily using MIDI or anything like, preferable in c/c++ or java? Thank you very much PS excuse any sintaxis or language error, i am not english speaking native.


回答1:


MIDI is just a control protocol, and has nothing to do with sound on its own. It's generally used for synthesizer control (note on/off messages and what not), but that's about it.

Most devices have a synthesizer in them that can produce sounds for you while being controlled with MIDI. This is by far the easiest way to get started, but you will find that most stock General MIDI synths don't sound so great.

Now, as far as producing the sounds you are after, you are talking about writing your own synthesizer. There is no magic. There is no shortcut. This is hard work! Generally, synths will use a set of samples, and then manipulate them. For instance, you'll have a sample for a pluck, and then another for the sound of the guitar. This will all be controlled on an ADSR envelope. Even then, it isn't going to sound amazing, since you are only approximating a very small set of characteristics of the instrument.




回答2:


You can try to control the built-in synth of the soundcard through midi. But if you want good sound and instrument quality, I would suggest you learn about VST, it's a technology from Steinbergh which includes virtual instrument (VSTi) and effect plugins.

So in essence, you could create or use a VST host application that works with existing commercial and free VSTi and VST plugins. You can then reuse available software synths and instrument emulations which sound amazing. As Brad suggests in his comment, you can then control the host application through midi.

While I only promote VST here, the wikipedia link contains a list of other technologies from different brands that are doing the same thing. But you get the idea.



来源:https://stackoverflow.com/questions/11814238/how-to-generate-a-real-bass-guitar-sound-either-in-c-c-or-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!