Giter VIP home page Giter VIP logo

sfxr-qt's Introduction

SFXR Qt

Screenshot

This a QtQuick Controls 2 port of SFXR. SFXR is a sound effect generator created by DrPetter to quickly produce retro-sounding sound effects for games.

This project has the same features as the original SFXR with a more modern user interface. This means DrPetter did all the hard work, I just refactored and plugged a new UI on top of it.

Usage

Start the application and click on one of the generator buttons. Then play with the sliders to produce the sound you want. When you are happy with the result, use the "Export as..." button to create a wav file, or the "Save as..." button to save it in SFXJ format, so that you can work on it later.

For more details, you should read the original SFXR readme.txt.

Tips

Right-clicking on a slider resets its value to 0.

You can use the mouse wheel to adjust the slider value. Hold-down Shift to make bigger changes.

Command-line usage

You can use the --export option to export your SFXR or SFXJ files to wav files from the command-line. Look at the output of sfxr-qt --help for details.

Precompiled binaries

Precompiled binaries for Linux are available in the releases section.

Building

Step 1

Building SFXR Qt requires installing the following tools:

  • A C++ 17 compiler
  • Qt 5.7
  • SDL 1.2
  • CMake 3.17 (You might be able to build with older versions if you adjust the minimum version in the CMakeLists.txt file, let me know if you do)

Step 2

Building SFXR Qt also requires qpropgen, a tool to generate Qt properties. For now qpropgen is bundled as a Git submodule, so first get the qpropgen Git submodule with:

git submodule update --init

qpropgen is written in Python 3, so make sure you have Python 3 and pip installed, then run:

pip3 install -r 3rdparty/qpropgen/requirements.txt

Step 3

You can now build SFXR Qt:

mkdir build
cd build
cmake ..
make

And install it with:

sudo make install

License

MIT

sfxr-qt's People

Contributors

agateau avatar alexmyczko avatar feinstaub avatar huitsi avatar mailaender avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sfxr-qt's Issues

Doesn't look good with dark KDE themes.

I don't know how to set themes with QtQuick (if i could, this were a pull request) but with Breeze dark colorscheme in KDE it's almost unreadable.

It's quite nice and simple application. I loved it. Maybe it's audience is somewhat niche yet, it's certainly useful and fun.

Slider issues

First of all, great program. I recently started to look into Csound (http://floss.booktype.pro/csound/preface/) and CsoundQt (https://csoundqt.github.io/pages/about.html) which is pretty cool stuff but has a steep learning curve. So your program comes in as a refreshing and rewarding resting place to just enjoy some sounds.

I noticed that some of the sliders jump away from the mouse: Click on "Slider" or "Phaser offset" (there are some more) and the slider knob jumps a few steps to the right side. Drag those slider knobs to the left: they won't stay with the mouse cursor but "lag" behind and so it is not possible to move them completely to the left.

update to cmake is breaking this compile, updating cmake isnt enough to fix it

[ 87%] Building CXX object tests/CMakeFiles/tests.dir/tests.cpp.o
In file included from /home/stevena/sfxr-qt/tests/tests.cpp:7:
/home/stevena/sfxr-qt/3rdparty/catch2/single_include/catch2/catch.hpp:10453:34: error: constexpr variable 'sigStackSize' must be initialized by a constant expression
    static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                 ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/stevena/sfxr-qt/3rdparty/catch2/single_include/catch2/catch.hpp:10453:58: note: non-constexpr function 'sysconf' cannot be used in a constant expression
    static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                                         ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:32:22: note: expanded from macro 'MINSIGSTKSZ'
# define MINSIGSTKSZ SIGSTKSZ
                     ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:28:19: note: expanded from macro 'SIGSTKSZ'
# define SIGSTKSZ sysconf (_SC_SIGSTKSZ)
                  ^
/usr/include/unistd.h:640:17: note: declared here
extern long int sysconf (int __name) __THROW;
                ^
In file included from /home/stevena/sfxr-qt/tests/tests.cpp:7:
/home/stevena/sfxr-qt/3rdparty/catch2/single_include/catch2/catch.hpp:10512:33: error: variable length array declaration not allowed at file scope
    char FatalConditionHandler::altStackMem[sigStackSize] = {};
                                ^           ~~~~~~~~~~~~
2 errors generated.
make[2]: *** [tests/CMakeFiles/tests.dir/build.make:90: tests/CMakeFiles/tests.dir/tests.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1063: tests/CMakeFiles/tests.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Compiling error

Hi, I tried to compile sfxr-qt on gentoo amd64. And both HEAD and 1.1.0 are giving me this/theses error(s). And I don’t have much ideas on how to debug/solve it.

I’m running on:

  • Qt 5.7.1
  • CMake 3.9.6
  • Python (2.7.14, 3.4.5, 3.5.4*, 3.6.3) (*: default version)
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found SDL: /usr/lib/libSDLmain.a;/usr/lib/libSDL.so;-lpthread (found version "1.2.15")
qpropgen: /usr/home/haelwenn/.local/bin/qpropgen
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/home/haelwenn/Sources/git/github.com/agateau/sfxr-qt/build
$ make
Scanning dependencies of target sfxr-qt_autogen
[  3%] Generating qrc_qml.cpp
[  6%] Generating core/basesound.h, core/basesound.cpp
Traceback (most recent call last):
  File "/usr/home/haelwenn/.local/bin/qpropgen", line 11, in <module>
    load_entry_point('qpropgen==0.1.0', 'console_scripts', 'qpropgen')()
  File "/usr/home/haelwenn/.local/lib64/python3.5/site-packages/qpropgen.py", line 126, in main
    template = env.get_template('template{}'.format(ext))
  File "/usr/lib64/python3.5/site-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/lib64/python3.5/site-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/lib64/python3.5/site-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/usr/lib64/python3.5/site-packages/jinja2/loaders.py", line 235, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: template.h
make[2]: *** [CMakeFiles/sfxr-qt_autogen.dir/build.make:80: core/basesound.h] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/sfxr-qt_autogen.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Build failure on Fedora 40

I am trying to build sfxr-qt-1.5.0 on Fedora 40.
A Qt header is missing:
#include in src/ui/SoundPreview.cpp

And a link problem during the build of the tests:

 97%] Linking CXX executable sfxr-qt
cd /home/collette/rpmbuild/BUILD/sfxr-qt/redhat-linux-build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/sfxr-qt.dir/link.txt --verbose=1
/usr/lib64/ccache/g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes "CMakeFiles/sfxr-qt.dir/sfxr-qt_autogen/mocs_compilation.cpp.o" "CMakeFiles/sfxr-qt.dir/ui/main.cpp.o" "CMakeFiles/sfxr-qt.dir/ui/Generator.cpp.o" "CMakeFiles/sfxr-qt.dir/qrc_qml.cpp.o" -o sfxr-qt  libsfxr-qtlib.a /usr/lib64/libQt5Widgets.so.5.15.12 /usr/lib64/libQt5Quick.so.5.15.12 /usr/lib64/libQt5QmlModels.so.5.15.12 -lSDL /usr/lib64/libQt5Qml.so.5.15.12 /usr/lib64/libQt5Network.so.5.15.12 /usr/lib64/libQt5Concurrent.so.5.15.12 /usr/lib64/libQt5Gui.so.5.15.12 /usr/lib64/libQt5Core.so.5.15.12 
gmake[2]: Leaving directory '/home/collette/rpmbuild/BUILD/sfxr-qt/redhat-linux-build'
[ 97%] Built target sfxr-qt
In file included from /usr/include/signal.h:328,
                 from /home/collette/rpmbuild/BUILD/sfxr-qt/3rdparty/catch2/single_include/catch2/catch.hpp:7712,
                 from /home/collette/rpmbuild/BUILD/sfxr-qt/tests/tests.cpp:7:
/home/collette/rpmbuild/BUILD/sfxr-qt/3rdparty/catch2/single_include/catch2/catch.hpp:10453:58: error: call to non-'constexpr' function 'long int sysconf(int)'
10453 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /usr/include/bits/sigstksz.h:24:
/usr/include/unistd.h:640:17: note: 'long int sysconf(int)' declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
/home/collette/rpmbuild/BUILD/sfxr-qt/3rdparty/catch2/single_include/catch2/catch.hpp:10512:45: error: size of array 'altStackMem' is not an integral constant-expression
10512 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
gmake[2]: *** [tests/CMakeFiles/tests.dir/build.make:93: tests/CMakeFiles/tests.dir/tests.cpp.o] Error 1
gmake[2]: Leaving directory '/home/collette/rpmbuild/BUILD/sfxr-qt/redhat-linux-build'

Randomize feature restored

Is it too much to ask to have the Randomize button/feature? I often used this to discover new sounds that I would never have iteratively worked into existence.

--export needs a graphical environment to work

I noticed that --export needs a graphical environment to work even though no window is created. This is a problem when running it in headless environment, such as CI.

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

White bands in the waveform display (v1.5.0)

When the sound is very short, the waveform display is filled with white bands to the point that it doesn't display anything useful.

Use very low envelope times, or all zero except for sustain time for example.

Generating random effects doesn't change the visualization of some controls (v1.5.0)

The random generators do what they're supposed to do, but some controls don't change their visualization even though they have been internally changed by the generator.

I think it's only "Slide", "Delta slide" and the "Change" controls but I'm not sure.

There's a similar issue when loading sounds. When loading a sound no control seems to be updated visually.

Crashes sometimes when clearing the LRU list in random order

I was playing around with sfxr-qt today and experienced two crashes while deleting sounds from the list in the bottom left section of the window.

It seems it does NOT crash when deleting them exactly in order, but that's just me guessing.

Backtrace:

#0  0x00007f480d092903 in std::__atomic_base<int>::load (__m=std::memory_order_relaxed, this=0x6) at /usr/include/c++/10/bits/atomic_base.h:426
#1  QAtomicOps<int>::loadRelaxed<int> (_q_value=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qatomic_cxx11.h:239
#2  QBasicAtomicInteger<int>::loadRelaxed (this=0x6) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qbasicatomic.h:107
#3  QtPrivate::RefCount::deref (this=0x6) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qrefcount.h:66
#4  QString::~QString (this=0x7ffc3e137d60, __in_chrg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:1307
#5  0x00007f480d2b8331 in QQmlSourceLocation::~QQmlSourceLocation (this=0x7ffc3e137d60, __in_chrg=<optimized out>) at ../../include/QtQml/5.15.2/QtQml/private/../../../../../src/qml/qml/qqmlglobal_p.h:358
#6  QQmlBinding::~QQmlBinding (this=0x7ffc3e137cd0, __in_chrg=<optimized out>) at qml/qqmlbinding.cpp:154
#7  0x00007f480d2bc07f in non-virtual thunk to GenericBinding<2>::~GenericBinding() () at qml/qqmlbinding.cpp:281
#8  0x000055901751ea26 in SoundListModel::data (this=<optimized out>, index=..., role=0) at ./core/SoundListModel.cpp:31
#9  0x00007f480556651f in QModelIndex::data (arole=0, this=0x7ffc3e137d70) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qabstractitemmodel.h:460
#10 QQmlDMAbstractItemModelData::value (role=0, this=0x559019524010) at qqmladaptormodel.cpp:414
#11 QQmlDMCachedModelData::metaCall (this=0x559019524010, call=<optimized out>, id=<optimized out>, arguments=0x7ffc3e137e20) at qqmladaptormodel.cpp:282
#12 0x00007f480d17e561 in QQmlPropertyData::readPropertyWithArgs (this=<optimized out>, this=<optimized out>, args=0x7ffc3e137e20, target=0x559019524010) at ../../include/QtQml/5.15.2/QtQml/private/../../../../../src/qml/qml/qqmlpropertydata_p.h:285
#13 QQmlPropertyData::readPropertyWithArgs (args=0x7ffc3e137e20, target=0x559019524010, this=0x559019793d08) at ../../include/QtQml/5.15.2/QtQml/private/../../../../../src/qml/qml/qqmlpropertydata_p.h:360
#14 QQmlPropertyData::readProperty (property=0x7ffc3e137e00, target=0x559019524010, this=0x559019793d08) at ../../include/QtQml/5.15.2/QtQml/private/../../../../../src/qml/qml/qqmlpropertydata_p.h:357
#15 loadProperty (v4=0x559019206330, object=0x559019524010, property=...) at jsruntime/qv4qobjectwrapper.cpp:176
#16 0x00007f47f00152fc in ?? ()
#17 0x0000000000000000 in ?? ()

This is sfxr-qt 1.3.0+git20210422-2 on Debian bookworm.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.