Commit graph

114 commits

Author SHA1 Message Date
Eric Fontaine
4253d779cf fix #291756 explicitly-signed char fluid pitchadj
C standards say that "char" may either be a "signed char" or "unsigned char" but that it is up to the compilers implementation or the platform which is followed.  Some non x86 platforms, including PowerPC and ARM, treat unspecified chars as unsigned chars, so it is necessary to explicitly declare them as "signed char" (or to compile with "--signed_chars").

This fix ensures that fluid synth's sample's pitchadj value are correctly read as signed.
2019-07-04 19:36:33 -04:00
anatoly-os
17d9c99378 fix black up/down arrow icons in dark theme 2019-06-21 14:55:03 +02:00
anatoly-os
740c428a14 Revert "Merge pull request #4538 from MichaelFroelich/68456_fixesPitchBends"
This reverts commit 1d5ae8afbb.
2019-05-22 10:44:04 +02:00
James Thistlewood
7bcfe21269 switch to expressive patches based on sf name 2019-04-19 19:31:50 +01:00
anatoly-os
8d53466388 fix loading sf2, sf3 from extensions
The sf2, sf3 soundfonts didn't load/unload automatically when installing Extensions
FluidGUI didn't rebuild itself on installing/uninstalling extensions containing sf2/sf3 soundfonts
2019-04-09 17:42:22 +02:00
Michael Froelich
94caa9fd9f fix #68456: fixes pitch bends 2019-03-10 18:50:45 +11:00
James Thistlewood
459049b5c4 Add single-note dynamics 2019-03-02 18:18:12 +00:00
James Thistlewood
6521082292 follow up pr #4535: display patches in mixer in order of preset number rather than bank 2019-01-25 21:16:08 +00:00
anatoly-os
9ff66ed1df
Merge pull request #4535 from jthistle/269939-synth-patch-order
fix #269939: order preset list to account for similar instruments on different banks
2019-01-21 15:02:29 +02:00
James Thistlewood
b01a1cb583 fix #269939: order preset list to account for similar instruments on different banks 2019-01-05 08:30:14 +00:00
Joachim Schmitz
48e4952030 replacing "..." (3 dots) with "…" (ellipsis)
see https://musescore.org/en/node/280844
2019-01-02 13:38:38 +01:00
Joachim Schmitz
ff292d98b2 eliminate debug artifacts 2018-12-18 14:55:54 +01:00
anatoly-os
87ed9ac474 fix #276456: Moving soundfont in the soundfonts list creates duplicate list entries (Fluid)
Call removeSoundfonts() before rebuilding the list.
Refactor code in Up/Down methods for both Fluid and Zerberus.
2018-12-12 11:37:41 +02:00
anatoly-os
6e24695f1b Reverted "Merge pull request #4073 from janisozaur/master"
Reverted 6c91d1df28 due to not signed CLA
2018-11-11 14:42:44 +02:00
anatoly-os
25073fb989
Merge pull request #4073 from janisozaur/master
Catch exceptions by const-ref rather than by value
2018-11-07 10:16:03 +02:00
mirabilos
65cd276439
remove RCS IDs from (almost) all files
they do not make any sense, nor do they get updated, if the
source code is kept in git
2018-11-02 23:53:21 +01:00
Michał Janiszewski
6c91d1df28
Catch exceptions by const-ref rather than by value 2018-10-28 14:00:15 -07:00
Joachim Schmitz
6523abc0b6 fix compiler warnings with MinGW 64bit 2018-09-27 17:38:20 +02:00
Joachim Schmitz
b27817fe19 fix more MSVC warnings
* The one C4100
* The one C4189
* The two C4457
* The two C4701
* The 475 C4267, changing to size_t were easily possible, casting to
int elsewhere
* Fix GCC warnings reg. wrong printf format for a size_t, reg. unused
variables and reg. ambigous else branch, seen on Travis CI
2018-09-11 16:56:50 +02:00
anatoly-os
ab9bf85bb5 fix #275544: popping noise
Use the copy of the `activeVoices` array for proper output audio processing.
2018-09-05 15:27:31 +02:00
anatoly-os
9443b37e10 Optimize fluid code
Improve calculation performance in Fluid::Voice::effects by avoiding excessive calls to std::vector::operator[]
Remove not used Tuning class from Fluid sources
Add fluid headers to CMakeLists
2018-09-05 15:27:27 +02:00
anatoly-os
f50c7778ab fix loading soundfonts to synth
Fix mutex locking
Fix progress bar drawing
2018-09-04 21:52:05 +02:00
anatoly-os
c5feea62ca lock synth mutex when closing MuseScore to prevent writing samples to deleted data structures
Optimize using raw pointer arrays - replace them with std::vector.
2018-08-30 20:44:07 +02:00
alexandr
df114f189c Compile under MSVC: this commit caontais all changes to run MSVC build
1) fix some bugs which appear in runtime:  replace QString::tostdstring() to Foo.toUtf8().constData().

2) Enable start center online community. To use it you need download webengine in your QT lib. see instruction https://musescore.org/en/handbook/developers-handbook/compilation/compile-instructions-windows-visual-studio-2017-wip

3) update install steps. Add additional dlls for webEngine. Add copying dlls and musescore.exe to /msvc.install/bin folder. Run project will work with the "$(ProjectDir)\..\..\msvc.install\bin\MuseScore.exe" specified in Debugging field in mscore project

4) Moving AppVeyor from MinGW to MSVC. Exclude ALL MSVC project from INSTALL project. Exclude ALL from PACKAGE. Remove migw-cmake in script build, add .bat instead. Remove xcopy from 7z archive step

5) Fix warning : Warning C4703 potentially uninitialized local pointer variable '' used; Warning C4456 declaration of '' hides previous local declaration; Warning C4458 declaration of '' hides class member

6) Change path to 11 version wix toolset which created .msi installer package
2018-08-04 12:17:31 +02:00
Andres Fernandez de Prado
33dff96a20 This commit contains changes required for MuseScore to compile under MSVC with no warnings.
This commit contains changes required for MuseScore to compile under MSVC with no warnings.

MuseScore is being compiled with the /W4 setting (warning level 4), which is similar to -wall -wextra on clang. This generates lots of warnings on MSVC, mainly for non-standard constructs and for constructs which might be bugs or might lead to bugs.

Most warnings are in the following categories:
- Name hiding: a variable hides a variable with the same name on a larger scope (or a field, or a function parameter). This can easily lead to bugs, and it is a best practice to avoid hiding variable names (see recommendation ES.12 in the C++ Core Guidelines by Stroustrop & Sutter (http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-reuse : ES.12: Do not reuse names in nested scopes)
- Narrowing conversion: a numeric conversion results in loss of significant digits (for example, double -> float). The general recommendation is to use a cast to indicate this is designed behaviour.
- Unreachable code: in several instances, there is unreachable code. The unreachable code is commented out.
- (Potentially) uninitialized local variable. Just initialized the vars.
- foreach(,) -> for(:): this does not generate a warning per-se (only a few of these generate warnings due to name hiding), but changed in keeping with "MuseScore Coding Rules" (https://musescore.org/en/handbook/musescore-coding-rules#Loops), which tells explicitly "Use C++11's "for" instead of Qt's "foreach":" ... "If you happen to be fixing some code and see a "foreach", please change that loop into a "for"."

Most changes are in the categories indicated above. The next listing shows detailed changes for files which are *not* of the aforementioned types.

- all.h: Disable warning C4127 (conditional expression is constant - generated in Qt header file qvector.h)
- awl/aslider.h: unreachable code.
- awl/knob.cpp: name hiding
- awl/mslider.cpp: name hiding
- awl/slider.cpp: name hiding
- bww2mxml/parser.cpp: name hiding
- effects/compressor/compressor.cpp: narrowing conversion
- effects/zita1/zitagui.cpp: name hiding
- fluid/fluid.cpp: foreach replacement. Name hiding.
- fluid/mod.cpp: name hiding.
- fluid/sfont.cpp: foreach replacement. Name hiding. Initialize vars.
- fluid/voice.cpp: Name hiding.
- libmscore/accidental.cpp: Name hiding.
- libmscore/ambitus.cpp: Initialize vars.
- libmscore/barline.cpp: Name hiding. Unreachable code.
- libmscore/beam.cpp: Name hiding.
- libmscore/chordrest.cpp: Unreachable code.
- libmscore/scorefile.cpp: Name hiding.
- manual/genManual.cpp: Name hiding. foreach replacement.
- midi/midifile.cpp: Name hiding. Unreachable code.
- omr/importpdf.cpp: Name hiding. foreach replacement.
- omr/omr.cpp: Name hiding. foreach replacement.
- omr/omrpage.cpp: Name hiding. foreach replacement.
- omr/omrview.cpp: Name hiding. foreach replacement.
- synthesizer/event.cpp: Unreachable code.
- zerberus\channel.cpp: Narrowing conversion.
- zerberus\instrument.cpp: Name hiding.
- zerberus\sfz.cpp: Name hiding.
- zerberus\voice.h: Suppress warning C4201: "nonstandard extension used: nameless struct/union"
- zerberus\zerberus.cpp: Name hiding. Unreferenced parameter.
- zerberus\zerberusgui.cpp: Name hiding.
2018-08-03 09:15:42 +02:00
Andres Fernandez de Prado
3acc363498 Solved all compilation errors on MSVC
This commit contains changes required for MuseScore to compile under MSVC with no errors.

There are several general categories of problems that resulted in errors with the compilation. Main issues:
- Variable Length Arrays (VLA). This is a non-standard extension to C++, supported by clang toolchains, but not by MSVC. The initial workaround is to use std::vector<> instead of VLAs, eventually (if needed) with the original variable pointing to the beginning of the allocated array. More efficient alternatives are possible if profiling shows any code using VLAs to be timing-critical.
- Floating-point constants not suffixed with "f" are doubles by default; in some instances, this leads to narrowing conversion errors (in other instances, just warnings).
- MSVC does not support "or"/"and"/"not" in lieu of "||"/"&&"/"!". Changed unconditionally to use standard C++ symbols.
- MSVC does not support the "__builtin_unreachable()" compiler hint. A similar, albeit not exactly equal, alternative is "__assume(0)", which is MSVC-specific.
- MSVC does not support ranges in case statements. Replaced with list of cases instead of range (non-conditionally)

Detailed changes, with per-file comments:

- all.h: opt-in to deprecated features, include <io.h> and <process.h> instead of POSIX <unistd.h>, undefine "STRING_NONE" and "small", which Microsoft defines as macros, which result in compilation errors.
- effects/compressor/zita.cpp: eliminated narrowing conversion error by appending "f" to float constants.
- fluid/voice.cpp: appended "f" to float constants to eliminate narrowing conversion errors/warnings
- libmscore/beam.cpp: conditionally replaced VLA
- libmscore/edit.cpp: conditionally replaced VLA
- libmscore/element.cpp: appended "f" to float constant
- libmscore/fret.cpp: changed or -> ||
- libmscore/layout.cpp: conditionally replaced VLA
- libmscore/mscore.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- libmscore/scorefile.coo: use correct char representation conversion for MSVC
- libmscore/stringdata.cpp: conditionally replaced VLA
- libmscore/system.cpp: conditionally replaced VLA
- libmscroe/text.cpp: replaced range in case statement.
- manual/genManual.cpp: use getopt() replacement.
- midi/midifile.cpp: conditionally replaced VLA. This does not use the default replacement.
- mscore/bb.cpp: replaced range in case statement.
- mscore/capella.cpp: conditionally replaced VLA. Changed and -> &&
- mscore/driver:cpp: preclude errors due to macro redefinitions.
- mscore/editstyle.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- mscore/importgtp-gp6.cpp: conditionally replaced VLA.
- mscore/instrwidget.cpp: conditionally replaced VLA.
- mscore/jackaudio.cpp: conditionally replaced VLA. Preclude errors due to macro redefinitions.
- mscore/jackweakapi.cpp: Preclude errors due to macro redefinitions. Replacement for __atribute__((constructor)) through static object construction for MSVC. Force use of LoadLibraryA instead of LoadLibrary.
- mscore/mididriver.h: Changed not -> !
- mscore/musescore.cpp: Changed not -> !. Conditionally replaced VLA.
- mscore/resourceManager.cpp: conditionally replaced VLA.
- mscore/timeline.cpp: conditionally replaced VLA.
- omr/omrpage.cpp: conditionally replaced VLA.
- synthesizer/msynthesizer.cpp: replaced UNIX sleep(1) method with MSVC Sleep(1000) (equivalent, but in ms instead of seconds)
- synthesizer/msynthsizer.h: appended "f" to float constant
- thirdparty/poppler/config.h: set defines for MSVC to preclude the use of inexistent libraries.
- thirdparty/poppler/poppler/poppler-config.h: set defines for MSVC to preclude the use of inexistent libraries. Eliminated #defines for fmin and fmax which where causing problems.
- thirdparty/poppler/poppler/PSOutputDev.cc: added #include <algorithm> for  std::min() and std::max(). Note this is required per-C++ standard.
- thirdparty/portmidi/pm_win/pmwinmm.c: undefined UNICODE to use char-based library functions.
- thirdparty/qzip/qzip.cpp: changed or -> ||
- thirdparty/rtf2html/rtf_keyword.h: file format changed from Apple to UNIX, as MSVC does not supported the former.

(NOT error related, just improvement on previous commit; manual/getopt/README.md: added link to source article)
2018-08-03 09:15:42 +02:00
Andres Fernandez de Prado
188386ba2e This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore.
In detail, changes are as follows:
- Changed .gitignore to ignore VS-specific files and directories.
- VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths.
- New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html
- Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the  new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled).
- all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC.
- Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always.
- The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC.
- Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of:
     x Setting target properties for MSVC
     x Using all.h in source dir
     x Adding pre-compiled headers to target
     x Removing dependency from mops1 and mops2

Notes:
- The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-08-03 09:15:42 +02:00
anatoly-os
bcf64ccefd
Merge pull request #3789 from handrok/Fluid-and-zerberus-option
fix #167161 Make Fluid and Zerberus GUI the same
2018-07-16 12:37:05 +02:00
lasconic
94d5442272 fix #273032: Provide an easy way to install soundfont, templates, etc.
Add workspace support in extension.
Use constants instead of magic strings for extension directories
2018-07-09 18:59:08 +02:00
lasconic
f71c339094 fix #273032: Provide an easy way to install soundfont, templates and instruments.xml
Introduce extensions files aka .muxt. These files are archives with additional data to extend MuseScore with soundfonts, templates, custom workspaces, etc.

Update qzip to fix bug with symlink.
Add extensions management to resource manager.
2018-07-09 18:59:08 +02:00
alexandr
923b8dbf7d fix #167161 Make Fluid and Zerberus options the same
Make unification for Zerberus and Fluid GUI
Make logic for 'up' and 'down' arrows in Zerberus

Logic of adding SF in fluid are the same as zerberus
Create Progress Bar in Fluid
2018-07-06 15:53:35 +02:00
anatoly-os
6c54a9653e Fix start/end loop opcodes size int-> long long
According to sfz documentation, offset, loop start/end are [0, 4Gb] in size
2018-06-01 10:30:24 +02:00
lasconic
b92a6e0525 fix crash reported in #270748 2018-03-30 22:53:51 +02:00
anatoly-os
0aa2511f3f fix #270803 messed playback for specific sounds
The reason was not updated minimal frames count and desync between different voices in playback as a result.
2018-03-29 13:48:27 +02:00
lasconic
5f100af6c5 fix #269937: implement proper preset fallback when using instruments on banks > 0 2018-03-10 10:44:01 +01:00
anatoly-os
cae320ecb0 Implemented caching signals to prevent not generated sound in case of framesBuff from PortAudio is too small
If we don't specify framesPerBuffer parameter in Pa_OpenStream, PortAudio will choose optimal value for particular callback call. It can vary from run to run even on the same hardware depending on available system resources.

While generating signal, interpolating and applying effects, we assume that framesBuffer contains more than minimal number of frames to generate envelope. BTW, it is not true. If framesBuffer is smaller, algos cannot generate correct sound and just keep silence.

I've implemented cache which keeps generated values from dsp algorithms and applies it step-by-step to buffer values from pa_callback. Cache is filled each time algos generate dsp values. If buffer frames are not enough to generate envelope, algos generate values for further calls and keep it in cache.

Required number of frames has been selected as a number of frames for one phase multiplying by number of phases. Actually, smaller numbers of this value generates good results, but it is better to keep it as max as possible to provide perfect sound.

Code changes:
 - Replaced C-like variables with std containers for comfortable debugging and better usage
 - Extracted similar code calls to separate methods
 - Implemented cache as std constainers, so also implemented convertion from std::vector to C-like float* to fill the pa buffer
 - Changed the logic of applying effects and interpolation, it is now possible to use them separately. This is required to fill effects several times after calculating the interpolation is finished.

Removed std::vector<float> to keep cache - process buff values on the fly. Performance is better, but still glitches on https://musescore.com/user/166080/scores/175421. BuffSize = 64 with my wired headphones.
2018-03-07 16:51:59 +02:00
lasconic
3517971a21 fix #87066: Incorrect Pitch When Alternate Values Used for 'Scale Tune' 2018-02-21 21:05:34 +01:00
lasconic
ebd3eaee88 fix #268991: Regression: Fluid: Envelopes are not behaving correctly. Workaround: skip mod envelope delay and attack phases if they are each less than 100 samples long 2018-02-21 12:18:27 +01:00
luz.paz
443be63167 Misc. typos
Found via `codespell -i 3 -w --skip="./thirdparty,./share/locale,./fonts" -I ../musescore-whitelist.txt`
Whitelist:
```
clas
nd
ot
pres
strack
tage
te
```
2018-02-13 12:06:05 -05:00
Nicolas Froment
191c1e7dc3
Merge pull request #3454 from lasconic/fix-269044
fix #269044: fluid: default velocity-to-filter cutoff modulator should be disabled
2018-02-08 17:21:06 +01:00
Dag Henning Liodden Sørbø
2b6cb8b432 Change to new preferences model
The old Preferences struct holding all preferences are removed in favor of a
new Preferences class which acts as a proxy for QSettings. The settings stored
in QSettings are accessed directly through access methods like getBool(key),
getInt(key), etc. and changed with setPreference(key, value).

Since we are using QSettings directly the preferences are stored automatically
without the need for a custom write() and read() method like before.

The preferences.cpp/.h and prefdialog.cpp/h are refactored to have fewer
responsibilities than before. The Preferences class are all about storing and
retrieving preferences - it should not contain any code to handle any other
aspect of MuseScore.

Testing:
The Preferences class can be used in tests. All preferences are initialized with
default values in mtest. If a test requires that a preference has a specific
value it can be changed using setPreference() for that single test. In the tests
the preferences are stored in memory only.

The Preference class is supposed to be used as a singleton. In preferences.h an
'extern Preferences preferences' is set and it is defined in preferences.cpp. All
files which includes preferences.h have access to the 'preferences' singleton
and should use this to get and set preferences.
2018-02-08 16:59:10 +01:00
lasconic
bbd814cc44 fix #269044: fluid: default velocity-to-filter cutoff modulator should be disabled 2018-02-08 16:21:44 +01:00
lasconic
ca181481c9 improve some strings based on translator feedback 2018-01-23 10:37:07 +01:00
Joachim Schmitz
5e116fe595 Fixing issues found in static code analysis by PVS-Studion
See https://musescore.org/en/node/255156
2017-12-20 16:26:23 +01:00
lasconic
acc6fadf8c fix #197131: Regression: Bass synthesizer and bass guitar create popping sounds 2017-07-21 18:22:39 +02:00
Eric Fontaine
4e4693003e fix #5163 Add PortAudio Midi Output 2017-05-26 08:36:37 -04:00
lasconic
fce99944db Don't look for soundfonts in hidden directories 2017-03-15 15:07:01 +01:00
Johannes Wegener
65caf3cd22 fix #120061: fix clicking sound in playback due to filter init 2016-08-03 10:57:18 +02:00
werner
d4cc062763 updates for hairpins, dynamics 2016-08-02 17:06:35 +02:00
Johannes Wegener
65fad51543 fix #119731: fluidsynth optimizations 2016-07-28 13:48:05 +02:00