GATech-CSE-6730-Spring-2023-Project / mesh2audio

Convert meshes into physical audio models and play them by striking mesh vertices in a 3D viewer.
GNU General Public License v3.0
11 stars 0 forks source link

Build step: ./script/Build #1

Closed FinishedBz1 closed 1 year ago

FinishedBz1 commented 1 year ago

Hi I am Alwin (the guy from the YouTube comments). So I am stuck at the ./script/Build command. That's the output: -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:9 (project): The CMAKE_C_COMPILER:

clang

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:9 (project): The CMAKE_CXX_COMPILER:

clang++

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred! See also "/home/finishedbz/.ssh/mesh2audio/app/build/CMakeFiles/CMakeOutput.log". See also "/home/finishedbz/.ssh/mesh2audio/app/build/CMakeFiles/CMakeError.log". gmake: Makefile: No such file or directory gmake: *** No rule to make target 'Makefile'. Stop.

I would appreciate your help with those errors :)

FinishedBz1 commented 1 year ago

Actually in audio devices I can see "input" Can you actually input audio like noise?

khiner commented 1 year ago

This was the feature I was referring to with the comment about the stretch goal to support using microphone input instead of a simple gate to resonate the excitation vertices. The audio input was not actually hooked into anything yet. However, I just added this feature! There's now a toggle under "Audio model -> Control" to switch between a "hammer" input and the audio input to excite the currently selected mesh vertex. When the hammer mode is selected, the gate button behaves the same as before, and when the audio input is selected, you still need to hit the gate button to apply the current parameters. (All parameters are sampled and held by the gate input to avoid sudden changes in the current playing sound until you strike again.) Let me know if you have any trouble with it!

I also made a change to always show that "Mesh profile -> Close path" toggle, but disable tet mesh generation when close-path is enabled, so you can undo that change you made locally and pull and rebuild.

FinishedBz1 commented 1 year ago

The input does not seem to work. I tried every input (in audio input mode not hammer) and it does not output after pushing the gate. I did in an axis-symmetrical mesh I have the microphone running through my audio interface. I might have something to do with the audio driver that I have not installed.

Sorry that I am not always available. I have to go now again to school.

khiner commented 1 year ago

I’m guessing it’s on the driver side. If you verify you can record audio through something else like Audacity, and then select that same input in mesh2audio and can’t record, we can troubleshoot from there

FinishedBz1 commented 1 year ago

You know what. I works, in real time. idk what ive done wrong before

FinishedBz1 commented 1 year ago

its just very low in volume. My microphone input clips for it to emit sound. Increasing the gain helps a bit but generally the volume is too low.

khiner commented 1 year ago

You can change the max gain here: https://github.com/GATech-CSE-6730-Spring-2023-Project/mesh2audio/blob/main/app/src/Audio.cpp#L48

I limited it to 0.5 instead of 1.0 since I was never going even near 0.5 before, but with the mic input I could see that changing. If a max limit of 1 works for you, I'll change and push.

FinishedBz1 commented 1 year ago

Thats funny. To me 10 is acceptable. gain = "gain = hslider(\"gain[scale:log]\",0.1,0,10.0,0.01);",

FinishedBz1 commented 1 year ago

I wonder if its possible to modify the hammerHardness to have the signal longer play longer.

khiner commented 1 year ago

The place to do that is in the GenerateModelInstrumentDsp function linked above: https://github.com/GATech-CSE-6730-Spring-2023-Project/mesh2audio/blob/main/app/src/Audio.cpp#L38

It sounds like what you want is simply to change the current ar (attack-release) envelope into an asr (attack-sustain-release): https://faustlibraries.grame.fr/libs/envelopes/

FinishedBz1 commented 1 year ago

I do not unterstand the language but I can tell it is defined in line 52: hammer(trig,hardness,size) = en.ar(att,att,trig)*no.noise : fi.lowpass(3,ctoff)

I think I need to replace the function and define a value for the sustain level which I am not going to be able to change in the interface but thats fine.

I can probably just type the value in without having to set up a variable. I can try it tomorrow.

FinishedBz1 commented 1 year ago

Also I am interested in learning the faust language because it works in the browser and has an option for midi input. I am only interested in physical modelling with mesh2faust.

Since you have experience do you believe it is managable for me to play around in the environment or will i encounter lots of problems I will not solve?

My intention is quite simple. I want to import meshes that I design using your program and inkscape for the svg's or blender.

After that I would like to explore all the settings that the language provides and link the pitch to the midi input.

My ultimate goal is having a plugin with midi input that I can use in a daw.

I could make changes to your program. Just linking pitch or even randomizing the excitation positions to midi. And it needs to run in a plugin host. I find it tedious to record the output to sample it in a sampler.

khiner commented 1 year ago

I just added an 'Export to file' button in the 'Audio model' -> 'Code' section. You can use this to export the current audio model as a Faust .dsp file. All of the audio generation and UI control is generated from the Faust code, so you should be able to extend it any way you'd like, and use the Faust MIDI features and faust2juce/faust2vst etc. Randominging the excitation position on each gate should be a simple feature to add as well. Hope this route works for you!

FinishedBz1 commented 1 year ago

That's amazing. I will deal with it.

FinishedBz1 commented 1 year ago

I had to reinstall Ubuntu because of some issues. Now I run Ubuntu Studio. I didn't expect to run in any issues installing mesh2audio again. But I am stuck at ./script/build with a problem we didn't encounter previously. Output: -- The C compiler identification is GNU 11.3.0 -- The CXX compiler identification is GNU 11.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at lib/CMakeLists.txt:4 (add_subdirectory): The source directory

/home/finishedbz/mesh2audio/app/lib/SDL

does not contain a CMakeLists.txt file.

-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
CMake Error at lib/CMakeLists.txt:35 (add_subdirectory): The source directory

/home/finishedbz/mesh2audio/app/lib/nativefiledialog

does not contain a CMakeLists.txt file.

CMake Error at lib/CMakeLists.txt:39 (add_subdirectory): The source directory

/home/finishedbz/mesh2audio/app/lib/fmt

does not contain a CMakeLists.txt file.

CMake Error at lib/CMakeLists.txt:66 (add_subdirectory): add_subdirectory given source "faust/build" which is not an existing directory.

CMake Error at lib/CMakeLists.txt:67 (target_compile_definitions): Cannot specify compile definitions for target "dynamiclib" which is not built by this project.

CMake Error at lib/CMakeLists.txt:69 (add_subdirectory): add_subdirectory given source "CDT/CDT" which is not an existing directory.

CMake Error at CMakeLists.txt:28 (add_subdirectory): add_subdirectory given source "/home/finishedbz/mesh2audio/app/lib/faust/tools/physicalModeling/mesh2faust" which is not an existing directory.

CMake Error at CMakeLists.txt:32 (find_package): By not providing "Findcinolib.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "cinolib", but CMake did not find one.

Could not find a package configuration file provided by "cinolib" with any of the following names:

cinolibConfig.cmake
cinolib-config.cmake

Add the installation prefix of "cinolib" to CMAKE_PREFIX_PATH or set "cinolib_DIR" to a directory containing one of the above files. If "cinolib" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "/home/finishedbz/mesh2audio/app/build/CMakeFiles/CMakeOutput.log". gmake: Makefile: No such file or directory gmake: *** No rule to make target 'Makefile'. Stop.

If you know a solution, I'd appreciate your help. Sorry for bothering you.

khiner commented 1 year ago

It seems like perhaps you didn’t recurse submodules with your initial clone? Are the subdirectories in lib empty?

FinishedBz1 commented 1 year ago

Indeed. lib consists of empty folders. This time I downloaded the repository manually because I couldn set up a ssh key successfully. That is probably the reason of it. I try to clone it using the terminal.

thanks a lot

FinishedBz1 commented 1 year ago

It works perfectly fine

khiner commented 1 year ago

Glad you figured it out!

FinishedBz1 commented 1 year ago

Usually when you export a faust.dsp you can declare options in the terminal. I wonder where that part is located in your code. I just aim to enable polyphony for a number of voices.

FinishedBz1 commented 1 year ago

Also the ba.sAndH(gate) functions that you used in the dsp code are totally unnessesary. Without it the dsp runs better and becomes capable of being played with several voices.

The part at the end of the modalModel Function: : select2(modesFreqs(n)<(ma.SR/2-1),0) does not seem to make any sense either but idk how to modify it since I have no idea where I can change it in your code.

Some parameters like the "t60 Decay" or the "gain" don't have to be in a logarithmical order.

khiner commented 1 year ago

Hi Alwin, sorry for the late reply here. I meant to get to this earlier.

Usually when you export a faust.dsp you can declare options in the terminal. I wonder where that part is located in your code. I just aim to enable polyphony for a number of voices.

I don't enable polyphony in the Faust code, but this is something you could do by exporting the Faust DSP code and building with an architecture that supports it. See the Faust polyphony docs for more details. It should be doable.

Also the ba.sAndH(gate) functions that you used in the dsp code are totally unnessesary. Without it the dsp runs better and becomes capable of being played with several voices.

Love to hear that you're adapting the code to your needs! These are used in this project because it responds to excitations in a more physically plausible way - striking a real object doesn't just keep adding superimposed responses and it's closer to reality to model it as stopping its current ringing and starting it to ring again, if that makes sense. The other thing the ba.sAndH(gate) calls are used for is to prevent changing previous sounds continuously as Faust parameters are changed. E.g. without them, moving the fundamental frequency knob after hammering makes the currently playing sound change in pitch. This way, you can make parameter changes as you wish without affecting the sound from past impulses, and it will only affect future impulses. All that said, I also find the effect of simply removing all of them pretty fun musically!

The part at the end of the modalModel Function: : select2(modesFreqs(n)<(ma.SR/2-1),0) does not seem to make any sense either but idk how to modify it since I have no idea where I can change it in your code.

This is unchanged from the original mesh2faust project, and I'm not very clear on the exact thinking here either without looking closer and thinking about it / experimenting. This code is generated on the Faust side, and probably the easiest way to modify would be to export the DSP file and edit directly. The other option would be to modify that linked mesh2faust.cpp file yourself and rebuild the app, which would also work.

Some parameters like the "t60 Decay" or the "gain" don't have to be in a logarithmical order.

I personally found the linear response to be too coarse for making the subtle changes I was interested in for getting more realistic glass/metal/wood/etc kinds of sounds, so I think I'll keep them as they are in the repo, but of course you're free to change them as you'd like, either in the source or in the exported DSP!

Hope all's well!