Initial commit

This commit is contained in:
Werner Schweer 2012-05-26 14:49:10 +02:00
parent d23e3091c9
commit 62c1703b18
2432 changed files with 1908786 additions and 3 deletions

519
CMakeLists.txt Normal file
View file

@ -0,0 +1,519 @@
#=============================================================================
# Mscore
# Linux Music Score Editor
# $Id:$
#
# Copyright (C) 2002-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
project(mscore)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
cmake_policy(SET CMP0003 NEW)
# for debugging the make system uncomment next line:
# set(CMAKE_VERBOSE_MAKEFILE ON)
set(MSCORE_UNSTABLE TRUE) # mark as unstable
set(GCC_VISIBILITY TRUE) # requires gcc 4.x?
set(HAS_AUDIOFILE TRUE) # requires libsndfile
set(STATIC_SCRIPT_BINDINGS TRUE)
set(USE_SSE TRUE)
set(SOUNDFONT3 TRUE) # enable ogg vorbis compressed fonts, require ogg & vorbis
set(AEOLUS TRUE) # pipe organ synthesizer
set(EMBED_ICONS FALSE) # do not load icons from share/icons
option (OSC "enable OSC remote control protocol" ON) # osc remote control
option (OMR "enable PDF import" OFF) # OMR - optical music recognition
option (BUILD_SCRIPTGEN "enable script bindings" OFF)
if (APPLE OR MINGW)
set(GCC_VISIBILITY FALSE) # warnings if not, with gcc4.4 from qt
set(AEOLUS TRUE)
set(OMR FALSE) # needs work to get rid of fontconfig dependency
endif (APPLE OR MINGW)
if (MINGW)
set(STATIC_SCRIPT_BINDINGS TRUE)
endif (MINGW)
if (OMR)
set(OCR FALSE) # requires tesseract 3.0
# for installation see: http://ubuntuforums.org/showthread.php?t=1647350
else (OMR)
set(OCR FALSE)
endif (OMR)
if (APPLE)
set (CMAKE_CXX_COMPILER clang++)
# Currently, just 'ppc', 'i386' or 'ppc i386' are useful architectures,
# because the Flash-Player is not yet available as a 64-bit version.
# Flash is required for displaying the videos of MuseScore-Connect.
# See http://qt.gitorious.org/qt/pages/Qt470KnownIssues
# Since 10.6+ only runs on intel, just set it to i386.
set(CMAKE_OSX_ARCHITECTURES x86_64)
# Adjust and uncomment this variable, if you target a different version
# of MacOSX.
# set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
# Building against the Binary-Package of Qt might require to uncomment
# and possibly adjust the following path, because the QtUiTools are not
# deployed as a framework.
# set(QT_QTUITOOLS_INCLUDE_DIR /usr/include/QtUiTools )
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.4) #min version required
set(HAS_AUDIOFILE TRUE) # requires libsndfile
set(STATIC_SCRIPT_BINDINGS TRUE)
find_library(AudioToolboxFW NAMES AudioToolbox)
find_library(AudioUnitFW NAMES AudioUnit)
find_library(CoreAudioFW NAMES CoreAudio)
find_library(CoreMidiFW NAMES CoreMIDI)
find_library(SystemConfigurationFW NAMES SystemConfiguration)
find_library(CoreServicesFW NAMES CoreServices)
set(OsxFrameworks ${AudioToolboxFW} ${AudioUnitFW} ${CoreAudioFW} ${CoreMidiFW} ${SystemConfigurationFW} ${CoreServicesFW})
endif (APPLE)
option(USE_SYSTEM_QTSINGLEAPPLICATION "Use system QtSingleApplication" OFF)
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
# The Mscore version number.
SET(Mscore_VERSION_MAJOR "2")
SET(Mscore_VERSION_MINOR "0")
SET(Mscore_VERSION_PATCH "0")
SET(Mscore_VERSION "${Mscore_VERSION_MAJOR}.${Mscore_VERSION_MINOR}")
#
# version schema x.x.x is hardcoded in source
#
SET(Mscore_VERSION_FULL "${Mscore_VERSION}.${Mscore_VERSION_PATCH}")
if (MINGW OR APPLE)
if(MINGW)
SET(Mscore_INSTALL_NAME "")
SET(Mscore_SHARE_NAME "./")
else(MINGW)
SET(Mscore_INSTALL_NAME "Contents/Resources/")
SET(Mscore_SHARE_NAME "mscore.app/")
endif(MINGW)
else (MINGW OR APPLE)
SET(Mscore_INSTALL_NAME "mscore-${Mscore_VERSION}/")
SET(Mscore_SHARE_NAME "share/")
endif (MINGW OR APPLE)
if (SOUNDFONT3)
set(OGGVORBIS TRUE)
endif (SOUNDFONT3)
include ( ${PROJECT_SOURCE_DIR}/build/UsePkgConfig1.cmake )
include ( ${PROJECT_SOURCE_DIR}/build/TargetDoc.cmake)
include ( ${PROJECT_SOURCE_DIR}/build/FindPulseAudio.cmake)
##
## look for Qt4
##
set(QT_MIN_VERSION "4.7.0")
set(QT_USE_QTXML TRUE)
set(QT_USE_QTSVG TRUE)
set(QT_USE_QTNETWORK TRUE)
set(QT_USE_QTUITOOLS TRUE)
set(QT_USE_QTDESIGNER TRUE)
set(QT_USE_QTSCRIPT TRUE)
set(QT_USE_QTSCRIPTTOOLS TRUE)
set(QT_USE_QTWEBKIT TRUE)
set(QT_USE_QTXMLPATTERNS TRUE)
find_package(Qt4 "4.7")
if (NOT QT4_FOUND)
message(FATAL_ERROR "Fatal error: QT (version >= 4.7.0) required."
" Cmake tries to detect QT4 by searching for 'qmake' in your PATH."
"If you have QT4 installed, make sure qmake is found in your PATH. "
"If you compiled QT4 yourself make sure your new qmake is found"
" _first_ in your PATH."
)
else (NOT QT4_FOUND)
message("Qt lib found at ${QT_LIBRARY_DIR}")
endif (NOT QT4_FOUND)
# Set QT_QTSCRIPT_INCLUDE_DIR
FIND_PATH(QT_QTSCRIPT_INCLUDE_DIR QtScript
PATHS
${QT_INCLUDE_DIR}/QtScript
${QT_LIBRARY_DIR}/QtScript.framework/Headers
NO_DEFAULT_PATH
)
# Set QT_QTSCRIPT_TOOLS_LIBRARY (apparently still needed on Ubuntu 9.10 - cmake 2.6.4)
if (NOT MINGW AND NOT APPLE)
FIND_LIBRARY(QT_QTSCRIPT_TOOLS_LIBRARY_RELEASE NAMES QtScriptTools QtScriptTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTSCRIPT_TOOLS_LIBRARY_DEBUG NAMES QtScriptTools QtScriptTools_debug QtScriptToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
_QT4_ADJUST_LIB_VARS(QTSCRIPT_TOOLS)
endif (NOT MINGW AND NOT APPLE)
include(${QT_USE_FILE})
##
## alsa >= 1.0.0
##
if (APPLE OR MINGW)
message("Disabling ALSA support due to OS X or MINGW build.")
set (USE_ALSA 0)
set (HAS_MIDI 1)
else (APPLE OR MINGW)
PKGCONFIG (alsa 1.0.0 ALSA_INCDIR ALSA_LIBDIR ALSA_LIB ALSA_CPP )
if (NOT ALSA_INCDIR)
message(FATAL_ERROR "Fatal error: ALSA >= 1.0.0 required")
else (NOT ALSA_INCDIR)
message("Alsa detected.")
set (USE_ALSA 1)
set (HAS_MIDI 1)
endif (NOT ALSA_INCDIR)
endif (APPLE OR MINGW)
##
## pulseaudio
##
if (APPLE OR MINGW)
set (USE_PULSEAUDIO 0)
else (APPLE OR MINGW)
if (PULSEAUDIO_FOUND)
set(USE_PULSEAUDIO 1)
message("Pulseaudio found.")
else (PULSEAUDIO_FOUND)
set(USE_PULSEAUDIO 0)
message("Pulseaudio not found.")
endif (PULSEAUDIO_FOUND)
endif (APPLE OR MINGW)
##
## find jack >= JACK_MIN_VERSION
##
SET(JACK_LONGNAME "jack (jack audio connection kit)")
SET(JACK_MIN_VERSION "0.98.0")
SET(BUILD_JACK AUTO CACHE STRING "Build with support for ${JACK_LONGNAME}. jack >= ${JACK_MIN_VERSION} will be needed. [ON/OFF/AUTO]")
IF(BUILD_JACK)
IF(MINGW)
set (USE_JACK 1)
IF("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
IF($ENV{PROCESSOR_ARCHITECTURE} STREQUAL "x86")
# "pure" 32-bit environment
set (JACK_INCDIR "$ENV{PROGRAMFILES}/Jack/includes")
set (JACK_LIB "$ENV{PROGRAMFILES}/Jack/lib/libjack.a")
ELSE($ENV{PROCESSOR_ARCHITECTURE} STREQUAL "x86")
# "pure" 64-bit environment
set (JACK_INCDIR "$ENV{PROGRAMFILES(x86)}/Jack/includes")
set (JACK_LIB "$ENV{PROGRAMFILES(x86)}/Jack/lib/libjack.a")
ENDIF($ENV{PROCESSOR_ARCHITECTURE} STREQUAL "x86")
ELSE("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
IF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
# 32-bit program running with an underlying 64-bit environment
set (JACK_INCDIR "$ENV{PROGRAMFILES(x86)}/Jack/includes")
set (JACK_LIB "$ENV{PROGRAMFILES(x86)}/Jack/lib/libjack.a")
ELSE("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
# theoretically impossible case...
ENDIF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
ENDIF("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
ELSE(MINGW)
PKGCONFIG(jack ${JACK_MIN_VERSION} JACK_INCDIR JACK_LIBDIR JACK_LIB JACK_CPP)
IF(JACK_INCDIR)
MESSAGE(STATUS "${JACK_LONGNAME} >= ${JACK_MIN_VERSION} found")
SET(USE_JACK 1)
ELSE(JACK_INCDIR)
MESSAGE(STATUS "${JACK_LONGNAME} >= ${JACK_MIN_VERSION} not found")
IF(NOT BUILD_JACK STREQUAL AUTO)
MESSAGE(SEND_ERROR "Error: jack support requested but not found (BUILD_JACK=${BUILD_JACK})")
ENDIF()
ENDIF(JACK_INCDIR)
ENDIF(MINGW)
ELSE(BUILD_JACK)
MESSAGE(STATUS "${JACK_LONGNAME} support disabled")
ENDIF(BUILD_JACK)
##
## portaudio
##
if (MINGW)
set ( USE_PORTAUDIO 1 )
set ( USE_PORTMIDI 1 )
else (MINGW)
if (APPLE)
set (USE_PORTMIDI 1)
PKGCONFIG (portaudio-2.0 19 PORTAUDIO_INCDIR PORTAUDIO_LIBDIR PORTAUDIO_LIB PORTAUDIO_CPP)
if (PORTAUDIO_INCDIR)
message("portaudio detected ${PORTAUDIO_INCDIR} ${PORTAUDIO_LIBDIR} ${PORTAUDIO_LIB}")
set ( USE_PORTAUDIO 1 )
else (PORTAUDIO_INCDIR)
message("optional package portaudio-2.0 Version 19 not found (package portaudio19-dev)\n")
set ( USE_PORTAUDIO 0 )
endif (PORTAUDIO_INCDIR)
else (APPLE)
set (USE_PORTMIDI 0)
PKGCONFIG (portaudio-2.0 19 PORTAUDIO_INCDIR PORTAUDIO_LIBDIR PORTAUDIO_LIB PORTAUDIO_CPP)
if (PORTAUDIO_INCDIR)
message("portaudio detected ${PORTAUDIO_INCDIR} ${PORTAUDIO_LIBDIR} ${PORTAUDIO_LIB}")
set ( USE_PORTAUDIO 1 )
else (PORTAUDIO_INCDIR)
message("optional package portaudio-2.0 Version 19 not found (package portaudio19-dev)\n")
set ( USE_PORTAUDIO 0 )
endif (PORTAUDIO_INCDIR)
endif (APPLE)
endif (MINGW)
##
## produce config.h file
##
configure_file (
${PROJECT_SOURCE_DIR}/build/config.h.in
${PROJECT_BINARY_DIR}/config.h
)
configure_file (
${PROJECT_SOURCE_DIR}/build/Doxyfile.in
${PROJECT_BINARY_DIR}/Doxyfile
)
if (NOT MINGW AND NOT APPLE)
install( FILES build/mscore.desktop DESTINATION share/applications)
endif (NOT MINGW AND NOT APPLE)
#if (GCC_VISIBILITY)
# set(CMAKE_CXX_FLAGS "-x c++ -include ${PROJECT_BINARY_DIR}/all.h -g -Wall -Wextra -Winvalid-pch -fvisibility=hidden -fvisibility-inlines-hidden")
#else (GCC_VISIBILITY)
# set(CMAKE_CXX_FLAGS "-x c++ -include ${PROJECT_BINARY_DIR}/all.h -g -Wall -Wextra -Winvalid-pch")
#endif (GCC_VISIBILITY)
if (NOT MINGW AND NOT APPLE)
#
# set library search path for runtime linker to load the same
# qt libraries as we used at compile time
#
set (CMAKE_EXE_LINKER_FLAGS "-Wl,-rpath,${QT_LIBRARY_DIR}")
endif (NOT MINGW AND NOT APPLE)
#
# create precompiled header file
#
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/all.h
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${PROJECT_SOURCE_DIR}/all.h ${PROJECT_BINARY_DIR}/all.h
DEPENDS ${PROJECT_SOURCE_DIR}/all.h
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
if (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
if (MINGW)
set(FLAGS -DQT_DEBUG -DQT_DLL)
else (MINGW)
if(APPLE)
set (FLAGS -O0 -DQT_DEBUG)
else(APPLE)
set (FLAGS -DQT_DEBUG)
endif(APPLE)
endif (MINGW)
else (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
if (MINGW)
set(FLAGS -O2 -DNDEBUG -DQT_DLL -DQT_NO_DEBUG)
else (MINGW)
set(FLAGS -O2 -DNDEBUG -DQT_NO_DEBUG)
endif (MINGW)
endif (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
if (${CMAKE_CXX_COMPILER_ID} EQUAL "Clang")
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/all.h.pch
COMMAND ${CMAKE_CXX_COMPILER}
-x c++-header -g ${FLAGS}
-I${QT_INCLUDE_DIR}
-o all.h.pch all.h
DEPENDS ${PROJECT_BINARY_DIR}/all.h
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
set (PCH ${PROJECT_BINARY_DIR}/all.h.pch)
else (${CMAKE_CXX_COMPILER_ID} EQUAL "Clang")
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/all.h.gch
COMMAND ${CMAKE_CXX_COMPILER}
-x c++-header -g ${FLAGS}
-I${QT_HEADERS_DIR}
-o all.h.gch all.h
DEPENDS ${PROJECT_BINARY_DIR}/all.h
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
set (PCH ${PROJECT_BINARY_DIR}/all.h.gch)
endif(${CMAKE_CXX_COMPILER_ID} EQUAL "Clang")
ADD_CUSTOM_TARGET(mops1 DEPENDS ${PROJECT_BINARY_DIR}/all.h)
ADD_CUSTOM_TARGET(mops2 DEPENDS ${PCH})
subdirs(mscore awl bww2mxml zarchive share
fluid msynth mstyle libmscore thirdparty/rtf2html thirdparty/diff)
add_subdirectory(mtest EXCLUDE_FROM_ALL)
#if (BUILD_SCRIPTGEN)
# subdirs (scriptgen)
#endif (BUILD_SCRIPTGEN)
if (USE_SYSTEM_QTSINGLEAPPLICATION)
find_path(QTSINGLEAPPLICATION_INCLUDE_DIRS qtsingleapplication.h PATH_SUFFIXES QtSolutions)
find_library(QTSINGLEAPPLICATION_LIBRARIES QtSolutions_SingleApplication-2.6)
else(USE_SYSTEM_QTSINGLEAPPLICATION)
subdirs (thirdparty/singleapp)
set(QTSINGLEAPPLICATION_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/singleapp/src)
set(QTSINGLEAPPLICATION_LIBRARIES qtsingleapp)
endif(USE_SYSTEM_QTSINGLEAPPLICATION)
if (MINGW OR APPLE)
subdirs (thirdparty/portmidi)
endif (MINGW OR APPLE)
if (AEOLUS)
subdirs (aeolus)
endif (AEOLUS)
if (OMR)
subdirs (omr)
endif (OMR)
if (OSC)
subdirs (thirdparty/ofqf)
endif (OSC)
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
${ALSA_INCDIR}
${JACK_INCDIR}
${PORTAUDIO_INCDIR}
)
##
## create package target
##
include (InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MuseScore is a full featured WYSIWYG score editor")
SET(CPACK_PACKAGE_VENDOR "Werner Schweer and Others")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/LICENSE.GPL")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.GPL")
SET(CPACK_PACKAGE_VERSION_MAJOR "${Mscore_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${Mscore_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${Mscore_VERSION_PATCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "MuseScore ${Mscore_VERSION_MAJOR}.${Mscore_VERSION_MINOR}")
SET(CPACK_NSIS_COMPRESSOR "/FINAL /SOLID lzma")
IF(MINGW)
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "MuseScore")
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/mscore/data\\\\installerhead.bmp")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\mscore.exe,0")
SET(CPACK_NSIS_DISPLAY_NAME "MuseScore ${Mscore_VERSION_FULL}")
SET(CPACK_NSIS_HELP_LINK "http://www.musescore.org/")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.musescore.org/")
SET(CPACK_NSIS_CONTACT "ws@wschweer.de")
SET(CPACK_NSIS_MODIFY_PATH OFF)
SET(CPACK_STRIP_FILES "mscore.exe")
# File types association:
SET(CPACK_NSIS_DEFINES "!include ${PROJECT_SOURCE_DIR}/build\\\\FileAssociation.nsh")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
Push \\\"ATENDATA\\\"
Push \\\"$INSTDIR\\\\share\\\\aten\\\"
Call WriteEnvStr
")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
\\\${registerExtension} \\\"MuseScore File\\\" \\\".mscx\\\" \\\"\\\$INSTDIR\\\\bin\\\\mscore.exe\\\"
\\\${registerExtension} \\\"Compressed MuseScore File\\\" \\\".mscz\\\" \\\"\\\$INSTDIR\\\\bin\\\\mscore.exe\\\"
")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
\\\${unregisterExtension} \\\".mscx\\\" \\\"MuseScore File\\\"
\\\${unregisterExtension} \\\".mscz\\\" \\\"Compressed MuseScore File\\\"
")
ELSE(MINGW)
SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/mscore/data/mscore.bmp")
SET(CPACK_STRIP_FILES "mscore")
SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(MINGW)
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mscore")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${Mscore_VERSION_FULL}")
SET(CPACK_PACKAGE_EXECUTABLES "mscore" "MuseScore")
set(CPACK_DEBIAN_PACKAGE_NAME "mscore")
set(CPACK_DEBIAN_PACKAGE_VERSION "${Mscore_VERSION_FULL}-0ubuntu0.1")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt4-core (>= 4.4), libqt4-gui (>= 4.4)")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "tsmithe@ubuntu.com")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "")
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "")
set(CPACK_PACKAGE_CONTACT "ws@schweer.de")
if (MINGW)
set(CPACK_GENERATOR "NSIS")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build" ${CMAKE_MODULE_PATH}) # Use custom version of NSIS.InstallOptions.ini
else (MINGW)
if (NOT APPLE)
set(CPACK_GENERATOR "DEB;TBZ2")
set(CPACK_DEB "on")
endif (NOT APPLE)
endif (MINGW)
include (CPack)
add_custom_target(lupdate
COMMAND ${PROJECT_SOURCE_DIR}/build/gen-qt-projectfile ${PROJECT_SOURCE_DIR} > mscore.pro
COMMAND ${QT_LUPDATE_EXECUTABLE} -noobsolete ${PROJECT_BINARY_DIR}/mscore.pro
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
add_custom_target(lrelease
COMMAND ${PROJECT_SOURCE_DIR}/build/gen-qt-projectfile ${PROJECT_SOURCE_DIR} > mscore.pro
COMMAND ${QT_LRELEASE_EXECUTABLE} ${PROJECT_SOURCE_DIR}/share/locale/*.ts
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)

2018
ChangeLog Normal file

File diff suppressed because it is too large Load diff

1517
Doxyfile.in Normal file

File diff suppressed because it is too large Load diff

357
LICENSE.GPL Normal file
View file

@ -0,0 +1,357 @@
If you want to redistribute MuseScore, you must comply with the GNU
General Public License (reproduced below). This license applies to
MuseScore with the following exception:
- If you create a document which uses fonts included in MuseScore, and
embed this font or unaltered portions of this font into the document,
then this font does not by itself cause the resulting document to be
covered by the GNU General Public License. This exception does not
however invalidate any other reasons why the document might be covered
by the GNU General Public License. If you modify this font, you may
extend this exception to your version of the font, but you are not
obligated to do so. If you do not wish to do so, delete this exception
statement from your version.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

124
Makefile Executable file
View file

@ -0,0 +1,124 @@
#=============================================================================
# Mscore
# Linux Music Score Editor
# $Id:$
#
# Copyright (C) 2002-2007 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
REVISION = `cat mscore/revision.h`
CPUS = `grep -c processor /proc/cpuinfo`
PREFIX = "/usr/local"
VERSION = "2.0b${REVISION}"
#VERSION = 2.0
ROOT=`pwd`
release:
mkdir build.release; \
cd build.release; \
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
..; \
make lrelease; \
make -j ${CPUS}; \
debug:
mkdir build.debug; \
cd build.debug; \
cmake -DCMAKE_BUILD_TYPE=DEBUG \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
..; \
make lrelease; \
make -j ${CPUS}; \
qt5:
if test ! -d qt5; \
then \
mkdir qt5; \
cd qt5; \
export PATH=/home/ws/qt/qt5/qtbase/bin:${PATH}; \
cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SCRIPTGEN=NO \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
..; \
make -j ${CPUS}; \
else \
echo "build directory does already exist, please remove first with 'make clean'"; \
fi
#
# win32
# cross compile windows package
# NOTE: there are some hardcoded path in CMake - files
# will probably only work on my setup (ws)
#
win32:
if test ! -d win32build; \
then \
mkdir win32build; \
if test ! -d win32install; \
then \
mkdir win32install; \
fi; \
cd win32build; \
cmake -DCMAKE_TOOLCHAIN_FILE=../build/mingw32.cmake -DCMAKE_INSTALL_PREFIX=../win32install -DCMAKE_BUILD_TYPE=DEBUG ..; \
make lrelease; \
make -j ${CPUS}; \
make install; \
make package; \
else \
echo "build directory win32build does alread exist, please remove first"; \
fi
#
# clean out of source build
#
clean:
-rm -rf build.debug build.release
-rm -rf win32build win32install
revision:
@svnversion -n > mscore/mscore/revision.h
version: revision
@echo ${VERSION}
install: release revision
cd build.release; make install
#
# linux
# linux binary package build
#
unix:
if test ! -d linux; \
then \
mkdir linux; \
cd linux; \
cmake -DCMAKE_BUILD_TYPE=RELEASE ../mscore; \
make -j${CPUS} -f Makefile; \
make package; \
else \
echo "build directory linux does alread exist, please remove first"; \
fi
doxy:
doxygen -f build/Doxyfile.in

59
Makefile.mingw Normal file
View file

@ -0,0 +1,59 @@
#=============================================================================
# Mscore
# Linux Music Score Editor
# $Id:$
#
# Copyright (C) 2002-2007 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
REVISION = $(shell type mscore\mscore\revision.h)
VERSION = 2.0r${REVISION}
MINGW_DIR = C:\QtSDK\mingw
CPUS = 2
release:
if not exist win32build\nul mkdir win32build
if not exist win32install\nul mkdir win32install
cd win32build & cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=../build/mingw32.mingw.cmake -DCMAKE_INSTALL_PREFIX=../win32install -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_MAKE_PROGRAM=${MINGW_DIR}\bin\mingw32-make.exe ..
cd win32build & $(MAKE) lrelease
cd win32build & $(MAKE) -j ${CPUS}
debug:
if not exist win32build\nul mkdir win32build
if not exist win32install\nul mkdir win32install
cd win32build & cmake -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=../build/mingw32.mingw.cmake -DCMAKE_INSTALL_PREFIX=../win32install -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_MAKE_PROGRAM=${MINGW_DIR}\bin\mingw32-make.exe ..
cd win32build & $(MAKE) lrelease
cd win32build & $(MAKE) -j ${CPUS}
install:
cd win32build & $(MAKE) install
package:
cd win32build & $(MAKE) package
revision:
FOR /F "tokens=1 delims=M" %%A IN ('svnversion -n') DO echo %%A > mscore/mscore/revision.h
version:
@echo ${VERSION}
#
# clean out of source build
#
clean:
-rmdir /S/Q win32build win32install

78
Makefile.osx Executable file
View file

@ -0,0 +1,78 @@
#=============================================================================
# Mscore
# Linux Music Score Editor
# $Id:$
#
# Copyright (C) 2002-2007 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
REVISION = `cat mscore/mscore/revision.h`
CPUS = `grep -c processor /proc/cpuinfo`
VERSION = "2.0b${REVISION}"
PREFIX=../applebuild
ROOT=`pwd`
release:
mkdir build.release; \
cd build.release; \
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=RELEASE \
.. -G Xcode; \
xcodebuild -project mscore.xcodeproj -target lrelease; \
xcodebuild -project mscore.xcodeproj -configuration Release -target ALL_BUILD; \
debug: xcode
mkdir build.debug; \
cd build.debug; \
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=DEBUG \
.. -G Xcode; \
xcodebuild -project mscore.xcodeproj -target lrelease; \
xcodebuild -project mscore.xcodeproj -configuration Debug -target ALL_BUILD; \
xcode:
mkdir build.xcode; \
cd build.xcode; \
cmake -DCMAKE_INSTALL_PREFIX=../build.xcode/mscore/Debug -DCMAKE_BUILD_TYPE=DEBUG \
.. -G Xcode; \
xcodebuild -project mscore.xcodeproj -target lrelease;
#
# clean out of source build
#
clean:
-rm -rf build.release build.debug build.xcode
-rm -rf applebuild
lupdate:
cd build.release;xcodebuild -project mscore.xcodeproj -target lupdate;
lrelease:
cd build.release;xcodebuild -project mscore.xcodeproj -target lrelease;
revision:
@svnversion -n | cut -c 1-4 > mscore/revision.h
version: revision
@echo ${VERSION}
install:
cd build.release;xcodebuild -project mscore.xcodeproj -configuration Release -target install;
package:
build/package_mac;

93
README Normal file
View file

@ -0,0 +1,93 @@
=================================================================
MuseScore Score Typesetter
=================================================================
Features:
- WYSIWYG design, notes are entered on a "virtual notepaper"
- TrueType font(s) for printing & display allows for high quality
scaling to all sizes
- easy & fast note entry
- many editing functions
- MusicXML import/export
- Midi (SMF) import/export
- MuseData import
- Midi input for note entry
- integrated sequencer and software synthesizer to
play the score
- print or create pdf files
Licence:
MuseScore is distributed under the GNU General Public License (GPL).
Please read the file LICENSE in this directory for more
details.
Requirements:
- qt4 gui lib version >= qt4.8.x
Note that many linux distributions split packages into a user
and developer package and that you need to install both.
- ALSA Version 1.0 or newer (audio/midi input/output)
- CMake >= 2.4.6
- libsndfile >= 1.0.19
- recommended: JACK audio server (audio output)
- recommended: portaudio 19
(required for windows version)
Credits:
MuseScore uses the "Emmentaler" font from the lilypond project.
Installation:
- unpack source distribution
tar xvofj mscore-x.x.x.tar.bz2
- make
cd mscore-x.x.x
make release
if something goes wrong, then remove the whole build subdirectory
with "make clean" and start new with "make release"
- install as root user
sudo make install
User Documentation:
Look at the handbook section at http://www.musescore.org
Program Documentation:
Type
cd build
make doxy
to generate the program documentation with DoxyGen.
Browse the documentation with your favourite html browser
at:
build/Doc/html/index.html
Test:
Type
cd build/mscore
mscore
to start mscore. On first invocation a demofile
(Modeste Moussorgsky: Pictures of an exhibition: Promenade)
is shown. You probably want to change that in the
"preferences" dialog.
=================================================================
Help needed
=================================================================
We need your help!
=================================================================
Contact
=================================================================
Werner Schweer; ws at wschweer.de
http://www.musescore.org/

View file

@ -1,4 +1,4 @@
MuseScore2
==========
mscore
======
MuseScore is a free music notation software.
MuseScore free music notation software

48
admin Executable file
View file

@ -0,0 +1,48 @@
#!/bin/bash
echo command $1
case $1 in
gitpush)
echo "push libmscore upstream"
git subtree push -P libmscore git@github.com:wschweer/libmscore.git master
;;
gitpull)
echo "merge libmscore from upstream"
;;
gitremove)
echo "permanently remove files"
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
fi
# make sure we're at the root of git repo
if [ ! -d .git ]; then
echo "Error: must run this script from the root of a git repository"
exit 1
fi
# remove all paths passed as arguments from the history of the repo
files=$@
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD
# remove the temporary history git-filter-branch otherwise leaves behind for a long time
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
;;
*)
echo "gitpush -- push libmscore upstream"
echo "gitpull -- pull libmscore from upstream"
echo "gitremove a -- permanently remove file/folder a"
;;
esac

2
aeolus/AUTHORS Normal file
View file

@ -0,0 +1,2 @@
Fons Adriaensen <fons@kokkinizita.net>
Hans Fugal <hans@fugal.net>

33
aeolus/CMakeLists.txt Normal file
View file

@ -0,0 +1,33 @@
#=============================================================================
# Mscore
# Linux Music Score Editor
# $Id:$
#
# Copyright (C) 2010 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/libmscore
)
subdirs(aeolus)
install(DIRECTORY
stops
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}sound/aeolus
PATTERN .svn EXCLUDE
)

340
aeolus/COPYING Normal file
View file

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

295
aeolus/README Normal file
View file

@ -0,0 +1,295 @@
AEOLUS 0.8.4 RELEASE NOTES 14/03/2010
============================
* Five new temperaments provided by Hanno Hoffstadt
and Adam Sampson.
* Added -s option to select Jack server.
* Now using libclalsdrv-2.0.0.
* Compiles without warnings with gcc-4.4.3.
AEOLUS 0.8.0 RELEASE NOTES 29/01/2008
============================
**** Experimental release. ****
* Requires JACK >= 0.109
* Receives MIDI over JACK and via ALSA sequencer.
* -C option has been removed, use AmbDec instead.
* -B option via ALSA removed.
AEOLUS 0.6.6 RELEASE NOTES
============================
1. The stops directory
----------------------
The aeolus binary itself is a generic organ synth and
does not define any instrument. In order to use Aeolus
you need a directory containing definitions of stops
and of an instrument. The one supplied with the current
release has this structure:
stops-0.3.0
|
|___ Aeolus
| |
| |____ definition
| |____ presets
|
|___ Aeolus1
| |
| |____ definition
| |____ presets
|
|___ Aeolus2
| |
| |____ definition
| |____ presets
|
|___ ***.ae0
|___ ***.ae0
|___ ***.ae0
|___ ...
|
|___ waves
|
|___ ***.ae1
|___ ***.ae1
|___ ***.ae1
|___ ...
The 'Aeolus' directory is the default instrument
directory. It contains two files: a 'definition'
file that specifies the layout of the organ, and
'presets' that contains registration and midi presets.
There can be more than one instrument definition
directory (in fact there are two more examples
in the supplied stops-0.3.0). These can be selected
with a command line option (see below).
The data in 'presets' only makes sense for one
particular instrument, and that's why these files
are kept together with the corresponding instrument
definition. For binary distributions, there is a
configuration option that will make Aeolus save the
presets in the users's home (see below). This will
allow the user to save presets for one instrument.
The *.ae0 files contain parameters for the additive
synthesis. There is one such file for each rank of
pipes in the organ. These are binary files and they
should not be edited. 'Power users' can use the built-in
synthesis editor to modify them (see section 5).
The waves directory will be empty initially. When
Aeolus starts up, it will compute wavetables, one for
each pipe. This is indicated by the flashing stop buttons.
The same will happen whenever the tuning or temperament is
changed. These wavetables can be saved (so Aeolus will be
ready for use much faster next time), but only if the stops
directory is writeable for the user. This will not be the
case for a binary installation as the stops dir will be
system-wide (e.g. /usr/share/Aeolus/stops-0.3.0).
In order to be able to save wavetables or edited stops
the stops directory must be copied to a location where
it can be modified by the user, (e.g. ~/stops-0.3.0).
2. Run-time configuration
-------------------------
Aeolus takes run-time options from three sources:
* the file /etc/aeolus.conf
* the file ~/.aeolusrc
* command line options
Apart from empty lines and comments (lines starting with '#')
either of the files should just contain the command line options
you want to use, on a single line (examples given below).
If the file in the home directory exists (even empty) then the
one in /etc is not used. Options given on the command line override
those given in either file.
Command line options are:
(audio interface)
-J Use JACK. This is also the default. The option
can be used to override a -A in the files.
-A Use ALSA. Aeolus should work with the "default"
device, but in recent ALSA releases this has a
very large buffer size, and this may result in
excessive latency. Use of a hardware device and
the options below is recommended.
Sub-options for ALSA and their defaults are:
-d <device> (default)
-r <sample rate> (48000)
-p <period size> (1024)
-n <number of periods> (2)
(output channels)
-C <number of channels>
The default is 2 (stereo). Other legal values
are 4 for four speakers in a square and 8 for
eight speaker in cube setup. The built-in
Ambisonics decoder used for the latter two
formats is quite primitive and will be removed
in future versions, to be replaced with a much
better external application.
Speaker order for -C 4 is clockwise starting at
front-left. For -C 8 the first four outputs are
the 'bottom' speakers, and the next four the
'top' ones, each of them in the same order as
for -C 4.
-B This options selects direct Ambisionics first order
B-format output, to be used for recording or with
an external decoder.
(resources)
-S <stops directory>
The default is ./stops.
-I <instrument directory>
This is relative to the stops directory.
The default is 'Aeolus'.
-W <waves directory>
This is relative to the stops directory.
The default is 'waves'. This options mainly exists
for use during development and should not be used.
-u This option is for use with binary distributions
only. When used, the presets file will be stored
into the user's home directory instead of within
the system wide instrument directory.
(general)
-t Selects the text mode user interface. With this
option Aeolus does not in any way depend on X11.
In the current version the text mode UI is just
an empty stub and should not be used.
-h Prints version information and a summary of all
command line options.
For example if you always use Aeolus with ALSA device hw:0,
using 3 periods of 512 frames and a sample rate of 44.1 kHz,
and you have copied the stops directory to your home, then
your ~/.aeolusrc could look like this:
# Aeolus default options
-A -d hw:0 -n 2 -p 512 -r 44100 -S /home/login/stops-0.3.0
where 'login' is your login name.
3. Binary packages
------------------
This release permits packagers to install a working Aeolus
without touching a users's home directory, as follows.
* Install the aeolus binary in /usr/bin and the two
plugins in /usr/lib.
* Install the stops directory in /usr/share/Aeolus.
* Install this README into /usr/share/doc/packages/Aeolus.
* Create the file /etc/aeolus.conf containing:
# Aeolus default options
-u -A -S /usr/share/Aeolus/stops-0.3.0
This will use the default instrument 'Aeolus', and save the
presets in .aeolus-presets in the users's home directory.
4. A quick tour of the GUI
--------------------------
4.1 The main window
TBC
4.2 The instrument window
TBC
4.3 The audio window
TBC
4.4 The midi window
TBC
5. Editing the synthesis parameters
-----------------------------------
TBC
6. Midi control of stop buttons
-------------------------------
The protocol uses one controller number. The default is #98, but you
can change this in global.h. The message is accepted only on channels
enabled for control in the midi matrix.
The value is interpreted as follows:
v = 01mm0ggg
This type of messages (bit 6 set) selects a group, and either
resets all stops in that group or sets the mode for the second
form below.
mm = mode. This can be:
00 disabled, also resets all elements in the group.
01 set off
10 set on
11 toggle
ggg = group, one of the button groups as defined in the instrument
definition. In the GUI groups start at the top, the first one (for
division III) being group #0.
The values of mm and ggg are stored and need not be repeated unless
they change.
v = 000bbbbb
According to the current state of mode, this command switches a
stop on or off, or toggles its state, or does nothing at all.
bbbbb = button index within the group.
Buttons are numbered left to right, top to bottom within each
group. The first one is #0.
EOF

12
aeolus/README.mscore Normal file
View file

@ -0,0 +1,12 @@
The real Aeolus can be found at
http://www.kokkinizita.net/linuxaudio/
The code in this directory is heavily modified and contains
basically only the aeolus synthesizer engine, modified to fit
into the MuseScore framework.
All bugs are most likely introduced by me and if you
find one please dont bother Fons Adriaensen with it.

6
aeolus/README.mscore1 Normal file
View file

@ -0,0 +1,6 @@
Changes:
- stops are installed in .../mscore-0.9/sound/aeolus

View file

@ -0,0 +1,39 @@
#=============================================================================
# Mscore
# Linux Music Score Editor
# $Id:$
#
# Copyright (C) 2010 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
include (${PROJECT_SOURCE_DIR}/build/gch.cmake)
add_library (aeolus STATIC
aeolus.cpp audio.cpp model.cpp addsynth.cpp scales.cpp
reverb.cpp asection.cpp division.cpp rankwave.cpp
rngen.cpp exp2ap.cpp
${PROJECT_BINARY_DIR}/all.h
${PCH}
)
set_target_properties (
aeolus
PROPERTIES
COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all.h -g -Wall -Wextra -Winvalid-pch"
)
ADD_DEPENDENCIES(aeolus mops1)
ADD_DEPENDENCIES(aeolus mops2)

8
aeolus/aeolus/TODO Normal file
View file

@ -0,0 +1,8 @@
- write presets in xml
- read presets
- save presets in score if aeolus is used
- use presets in score, switch by midi bank/instrument

384
aeolus/aeolus/addsynth.cpp Normal file
View file

@ -0,0 +1,384 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "global.h"
#include "addsynth.h"
#define M (N_NOTE - 1)
#define swap4(a, b) { (a)[0] = (b)[3], (a)[1] = (b)[2], (a)[2] = (b)[1], (a)[3] = (b)[0]; }
//---------------------------------------------------------
// N_func
//---------------------------------------------------------
N_func::N_func()
{
reset (0.0f);
}
//---------------------------------------------------------
// reset
//---------------------------------------------------------
void N_func::reset (float v)
{
_b = 16;
for (int i = 0; i < N_NOTE; i++)
_v [i] = v;
}
//---------------------------------------------------------
// setv
//---------------------------------------------------------
void N_func::setv (int i, float v)
{
int j;
float d;
if ((i < 0) || (i > M))
return;
_v [i] = v;
_b |= 1 << i;
for (j = i - 1; (j >= 0) && ! (_b & (1 << j)); j--)
;
if (j < 0)
while (++j != i)
_v [j] = v;
else {
d = (_v [j] - v) / (j - i);
while (++j != i)
_v [j] = v + (j - i) * d;
}
for (j = i + 1; (j <= M) && ! (_b & (1 << j)); j++)
;
if (j > M)
while (--j != i) _v [j] = v;
else {
d = (_v [j] - v) / (j - i);
while (--j != i)
_v [j] = v + (j - i) * d;
}
}
//---------------------------------------------------------
// clrv
//---------------------------------------------------------
void N_func::clrv (int i)
{
int j, k, m;
float d;
if ((i < 0) || (i > M))
return;
m = 1 << i;
if (! (_b & m) || (_b == m))
return;
_b ^= m;
for (j = i - 1; (j >= 0) && ! (_b & (1 << j)); j--)
;
for (k = i + 1; (k <= M) && ! (_b & (1 << k)); k++)
;
if ((j >= 0) && (k <= M)) {
d = (_v [k] - _v [j]) / (k - j);
for (i = j + 1; i < k; i++)
_v [i] = _v [i] = _v [j] + (i - j) * d;
}
else if (j >= 0) {
d = _v [j];
while (j < M)
_v [++j] = d;
}
else if (k <= M) {
d = _v [k];
while (k > 0)
_v [--k] = d;
}
}
//---------------------------------------------------------
// write
//---------------------------------------------------------
void N_func::write (FILE *F)
{
#ifdef __BYTE_ORDER
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
fwrite (&_b, 1, sizeof (int32_t), F);
fwrite (_v, N_NOTE, sizeof (float), F);
#elif (__BYTE_ORDER == __BIG_ENDIAN)
int i;
char d [N_NOTE * sizeof (float)];
swap4 (d, (char *)(&_b));
fwrite (d, 1, sizeof (int32_t), F);
for (i = 0; i < N_NOTE; i++)
swap4 (d + i * sizeof (float), (char *)(_v + i));
fwrite (d, N_NOTE, sizeof (float), F);
#else
#error Byte order is not supported !
#endif
#else
#error Byte order is undefined !
#endif
}
//---------------------------------------------------------
// read
//---------------------------------------------------------
void N_func::read (QFile* f)
{
#ifdef __BYTE_ORDER
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
f->read ((char*)&_b, sizeof (int32_t));
f->read ((char*)&_v, N_NOTE * sizeof (float));
#elif (__BYTE_ORDER == __BIG_ENDIAN)
int i;
char d [sizeof (int) + N_NOTE * sizeof (float)];
f->read (d, sizeof (int32_t));
swap4 ((char *)(&_b), d);
f->read (d, N_NOTE * sizeof (float));
for (i = 0; i < N_NOTE; i++)
swap4 ((char *)(_v + i), d + i * sizeof (float));
#else
#error Byte order is not supported !
#endif
#else
#error Byte order is undefined !
#endif
}
//---------------------------------------------------------
// reset
//---------------------------------------------------------
void HN_func::reset (float v)
{
for (int j = 0; j < N_HARM; j++)
(_h + j)->reset (v);
}
//---------------------------------------------------------
// setv
//---------------------------------------------------------
void HN_func::setv (int i, float v)
{
for (int j = 0; j < N_HARM; j++)
(_h + j)->setv (i, v);
}
//---------------------------------------------------------
// clrv
//---------------------------------------------------------
void HN_func::clrv (int i)
{
for (int j = 0; j < N_HARM; j++)
(_h + j)->clrv (i);
}
//---------------------------------------------------------
// write
//---------------------------------------------------------
void HN_func::write (FILE *F, int k)
{
for (int j = 0; j < k; j++)
(_h + j)->write (F);
}
//---------------------------------------------------------
// read
//---------------------------------------------------------
void HN_func::read (QFile* f, int k)
{
for (int j = 0; j < k; j++)
(_h + j)->read(f);
}
//---------------------------------------------------------
// Addsynth
//---------------------------------------------------------
Addsynth::Addsynth()
{
reset();
}
//---------------------------------------------------------
// reset
//---------------------------------------------------------
void Addsynth::reset()
{
*_stopname = 0;
*_mnemonic = 0;
*_copyrite = 0;
*_comments = 0;
_fd = 1;
_fn = 1;
_n0 = NOTE_MIN;
_n1 = NOTE_MAX;
_n_vol.reset (-20.0f);
_n_ins.reset (0.0f);
_n_off.reset (0.0f);
_n_att.reset (0.01f);
_n_atd.reset (0.0f);
_n_dct.reset (0.01f);
_n_dcd.reset (0.0f);
_n_ran.reset (0.0f);
_h_lev.reset (-100.0f);
_h_ran.reset (0.0f);
_h_att.reset (0.050f);
_h_atp.reset (0.0f);
}
//---------------------------------------------------------
// save
//---------------------------------------------------------
int Addsynth::save (const char* sdir)
{
FILE *F;
char d [32];
char path [1024];
strcpy (path, sdir);
strcat (path, "/");
strcat (path, _filename);
if (! (F = fopen (path, "w"))) {
fprintf (stderr, "Can't open '%s' for writing\n", path);
return 1;
}
memset (d, 0, 32);
strcpy (d, "AEOLUS");
d [7] = 2;
d [26] = N_HARM;
d [28] = _n0;
d [29] = _n1;
d [30] = _fn;
d [31] = _fd;
fwrite (d, 1, 32, F);
fwrite (_stopname, 1, 32, F);
fwrite (_copyrite, 1, 56, F);
fwrite (_mnemonic, 1, 8, F);
fwrite (_comments, 1, 56, F);
fwrite (_reserved, 1, 8, F);
_n_vol.write (F);
_n_off.write (F);
_n_ran.write (F);
_n_ins.write (F);
_n_att.write (F);
_n_atd.write (F);
_n_dct.write (F);
_n_dcd.write (F);
_h_lev.write (F, N_HARM);
_h_ran.write (F, N_HARM);
_h_att.write (F, N_HARM);
_h_atp.write (F, N_HARM);
fclose (F);
return 0;
}
//---------------------------------------------------------
// load
//---------------------------------------------------------
int Addsynth::load (const char* sdir)
{
char d [32];
int v, k;
reset ();
QFile f(QString("%1/%2").arg(sdir).arg(_filename));
if (!f.open (QIODevice::ReadOnly)) {
fprintf (stderr, "Can't open '%s' for reading\n", qPrintable(f.fileName()));
return 1;
}
f.read (d, 32);
if (strcmp (d, "AEOLUS")) {
fprintf (stderr, "File '%s' is not an Aeolus file\n", _filename);
f.close();
return 1;
}
v = d [7];
k = d [26];
if (! k)
k = 48;
_n0 = d [28];
_n1 = d [29];
if (_n1 == 0x2E)
_n1 = 96; ////// FIX THIS
_fn = d [30];
_fd = d [31];
f.read (_stopname, 32);
f.read (_copyrite, 56);
f.read (_mnemonic, 8);
f.read (_comments, 56);
f.read (_reserved, 8);
_n_vol.read (&f);
_n_off.read (&f);
_n_ran.read (&f);
if (v >= 2) {
_n_ins.read (&f);
_n_att.read (&f);
_n_atd.read (&f);
_n_dct.read (&f);
_n_dcd.read (&f);
}
_h_lev.reset (-100.0f);
_h_ran.reset (0.0f);
_h_att.reset (0.050f);
_h_atp.reset (0.0f);
_h_lev.read (&f, k);
_h_ran.read (&f, k);
_h_att.read (&f, k);
_h_atp.read (&f, k);
f.close();
return 0;
}

123
aeolus/aeolus/addsynth.h Normal file
View file

@ -0,0 +1,123 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __ADDSYNTH_H
#define __ADDSYNTH_H
#define N_NOTE 11
#define N_HARM 64
#define NOTE_MIN 36
#define NOTE_MAX 96
//---------------------------------------------------------
// N_func
//---------------------------------------------------------
class N_func
{
int _b;
float _v [N_NOTE];
public:
N_func();
void reset (float v);
void setv (int i, float v);
void clrv (int i);
float vs (int i) const { return _v [i]; }
int st (int i) const { return (_b & (1 << i)) ? 1 : 0; }
float vi (int n) const {
int i = n / 6;
int k = n - 6 * i;
float v = _v [i];
if (k)
v += k * (_v [i + 1] - v) / 6;
return v;
}
void write(FILE*);
void read(QFile*);
};
//---------------------------------------------------------
// HN_func
//---------------------------------------------------------
class HN_func
{
N_func _h [N_HARM];
public:
HN_func() {}
void reset (float v);
void setv (int i, float v);
void clrv (int i);
void setv (int h, int i, float v) { _h [h].setv (i, v); }
void clrv (int h, int i) { _h [h].clrv (i); }
float vs (int h, int i) const { return _h [h].vs (i); }
int st (int h, int i) const { return _h [h].st (i); }
float vi (int h, int n) const { return _h [h].vi (n); }
void write (FILE *F, int k);
void read (QFile *F, int k);
};
//---------------------------------------------------------
// Addsynth
//---------------------------------------------------------
class Addsynth
{
public:
Addsynth();
void reset();
int save (const char *sdir);
int load (const char *sdir);
char _filename [64];
char _stopname [32];
char _copyrite [56];
char _mnemonic [8];
char _comments [56];
char _reserved [8];
int32_t _n0;
int32_t _n1;
int32_t _fn;
int32_t _fd;
N_func _n_vol;
N_func _n_off;
N_func _n_ran;
N_func _n_ins;
N_func _n_att;
N_func _n_atd;
N_func _n_dct;
N_func _n_dcd;
HN_func _h_lev;
HN_func _h_ran;
HN_func _h_att;
HN_func _h_atp;
char _pan;
int32_t _del;
};
#endif

300
aeolus/aeolus/aeolus.cpp Normal file
View file

@ -0,0 +1,300 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "aeolus.h"
#include "model.h"
extern QString dataPath;
extern QString mscoreGlobalShare;
#include "libmscore/event.h"
#include "xml.h"
#include "msynth/sparm_p.h"
//---------------------------------------------------------
// init
//---------------------------------------------------------
void Aeolus::init(int samplerate)
{
setlocale(LC_ALL, "C"); // scanf of floats does not work otherwise
QString stops = mscoreGlobalShare + "/sound/aeolus/stops";
int n = strlen(qPrintable(stops));
char* stopsPath = new char[n+1];
strcpy(stopsPath, qPrintable(stops));
QDir dir;
QString waves = dataPath + QString("/aeolus/waves%1").arg(samplerate);
dir.mkpath(waves);
n = strlen(qPrintable(waves));
char* wavesPath = new char[n+1];
strcpy(wavesPath, qPrintable(waves));
audio_init(samplerate);
model = new Model (this, _midimap, stopsPath, "Aeolus", wavesPath);
audio_start();
model->init();
// printGui();
}
//---------------------------------------------------------
// Aeolus
//---------------------------------------------------------
Aeolus::Aeolus()
{
model = 0;
MidiPatch* patch = new MidiPatch;
patch->drum = false;
patch->bank = 0;
patch->prog = 0;
patch->name = "Aeolus";
patchList.append(patch);
_sc_cmode = 0;
_sc_group = 0;
_audio = new M_audio_info;
_running = false;
_nplay = 0;
_fsamp = 0;
_nasect = 0;
_ndivis = 0;
nout = 0;
_ifc_init = 0;
for (int i = 0; i < NGROUP; i++)
_ifelms [i] = 0;
memset(_keymap, 0, sizeof(_keymap));
}
Aeolus::~Aeolus()
{
delete model;
for (int i = 0; i < _nasect; i++)
delete _asectp [i];
for (int i = 0; i < _ndivis; i++)
delete _divisp [i];
_reverb.fini ();
}
//---------------------------------------------------------
// setMasterTuning
//---------------------------------------------------------
void Aeolus::setMasterTuning(double)
{
}
//---------------------------------------------------------
// masterTuning
//---------------------------------------------------------
double Aeolus::masterTuning() const
{
return 440.0;
}
//---------------------------------------------------------
// play
//---------------------------------------------------------
void Aeolus::play(const Event& event)
{
int ch = event.channel();
int type = event.type();
int m = _midimap [ch] & 127; // Keyboard and hold bits
// printf("Aeolus::play %d %d %d\n", ch, type, m);
// int f = (_midimap [ch] >> 12) & 7; // Control enabled if (f & 4)
if (type == ME_NOTEON) {
int n = event.dataA();
int v = event.dataB();
if (v == 0) { // note off
if (n < 36)
;
else if (n <= 96)
key_off(n - 36, m);
}
else { // note on
if (n < 36)
;
else if (n <= 96)
key_on(n - 36, m);
}
}
else if (type == ME_CONTROLLER) {
int p = event.dataA();
int v = event.dataB();
switch(p) {
case MIDICTL_HOLD:
case MIDICTL_ASOFF:
case MIDICTL_ANOFF:
break;
case MIDICTL_BANK:
break;
case MIDICTL_IFELM:
// if (!(f & 4)) enabale control for all channels
// break;
if (v & 64) {
// Set mode or clear group.
_sc_cmode = (v >> 4) & 3;
_sc_group = v & 7;
if (_sc_cmode == 0) {
model->clr_group(_sc_group);
}
}
else if (_sc_cmode) {
// Set, reset or toggle stop.
model->set_ifelm (_sc_group, v & 31, _sc_cmode - 1);
}
break;
}
}
}
//---------------------------------------------------------
// getPatchInfo
//---------------------------------------------------------
const QList<MidiPatch*>& Aeolus::getPatchInfo() const
{
return patchList;
}
//---------------------------------------------------------
// effectParameter
//---------------------------------------------------------
SyntiParameter Aeolus::parameter(int id) const
{
SParmId spid(id);
if (spid.syntiId != AEOLUS_ID)
return SyntiParameter();
switch (spid.subsystemId) {
case 0: // audio
return _audiopar[spid.paramId];
case 1:
case 2:
case 3:
case 4:
{
SyntiParameter* fp = _asectp[spid.subsystemId-1]->get_apar();
return fp[spid.paramId];
}
default:
break;
}
return SyntiParameter();
}
//---------------------------------------------------------
// setParameter
//---------------------------------------------------------
void Aeolus::setParameter(int id, double value)
{
SParmId spid(id);
if (spid.syntiId != AEOLUS_ID)
return;
SyntiParameter* p = 0;
switch(spid.subsystemId) {
case 0: // audio
p = &_audiopar[spid.paramId];
break;
case 1:
case 2:
case 3:
case 4:
{
SyntiParameter* fp = _asectp[spid.subsystemId-1]->get_apar();
p = &fp[spid.paramId];
}
default:
break;
}
if (p == 0)
return;
if (value > p->max())
value = p->max();
else if (value < p->min())
value = p->min();
// printf("aeolus set %d %d %f\n", effect, parameter, value);
p->set(value);
}
//---------------------------------------------------------
// rewrite_label
//---------------------------------------------------------
void Aeolus::rewrite_label (const char *p)
{
strcpy (_tempstr, p);
char* t = strstr (_tempstr, "-$");
if (t)
strcpy (t, t + 2);
else {
t = strchr (_tempstr, '$');
if (t)
*t = ' ';
}
}
//---------------------------------------------------------
// printGui
//---------------------------------------------------------
void Aeolus::printGui()
{
for (int i = 0; i < _ifc_init->_ndivis; ++i) {
int group = i;
rewrite_label (_ifc_init->_groupd [group]._label);
printf ("Stops in group %s\n", _tempstr);
uint32_t m = _ifelms [group];
int n = _ifc_init->_groupd [group]._nifelm;
for (int i = 0; i < n; i++) {
rewrite_label (_ifc_init->_groupd [group]._ifelmd [i]._label);
printf (" %c %-7s %-1s\n", (m & 1) ? '+' : '-', _ifc_init->_groupd [group]._ifelmd [i]._mnemo, _tempstr);
m >>= 1;
}
}
}
SyntiState Aeolus::state() const
{
return SyntiState();
}
void Aeolus::setState(const SyntiState&)
{
}
void Aeolus::allSoundsOff(int)
{
memset(_keymap, 0, sizeof(_keymap));
}
void Aeolus::allNotesOff(int)
{
memset(_keymap, 0, sizeof(_keymap));
}

130
aeolus/aeolus/aeolus.h Normal file
View file

@ -0,0 +1,130 @@
//=============================================================================
// MusE Score
// Linux Music Score Editor
// $Id:$
//
// Copyright (C) 2002-2010 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
#ifndef __AEOLUS_H__
#define __AEOLUS_H__
struct MidiPatch;
class Event;
#include "stdint.h"
#include "msynth/synti.h"
#include "libmscore/midipatch.h"
#include "asection.h"
#include "division.h"
#include "reverb.h"
#include "global.h"
class Model;
class M_audio_info;
class M_new_divis;
class M_ifc_init;
//---------------------------------------------------------
// Synth
//---------------------------------------------------------
class Aeolus : public Synth {
Model* model;
QList<MidiPatch*> patchList;
uint16_t _midimap [16];
int _sc_cmode; // stop control command mode
int _sc_group; // stop control group number
enum { VOLUME, REVSIZE, REVTIME, STPOSIT };
volatile bool _running;
int _hold;
int _nplay;
unsigned int _fsamp;
int _nasect;
int _ndivis;
Asection *_asectp [NASECT];
Division* _divisp [NDIVIS];
Reverb _reverb;
unsigned char _keymap [NNOTES];
SyntiParameter _audiopar[4];
float _revsize;
float _revtime;
int nout;
float routb[PERIOD];
float loutb[PERIOD];
M_audio_info* _audio;
M_ifc_init* _ifc_init;
uint32_t _ifelms [NGROUP];
char _tempstr[64];
void proc_synth(int);
void cond_key_off (int m, int b);
void cond_key_on (int m, int b);
void audio_init(int sampleRate);
void audio_start();
void key_off (int n, int b);
void key_on (int n, int b);
void newDivis(M_new_divis* X);
void proc_queue(uint32_t);
void printGui();
void rewrite_label(const char*);
public:
Aeolus();
virtual ~Aeolus();
virtual void init(int sampleRate);
virtual const char* name() const { return "Aeolus"; }
virtual void setMasterTuning(double);
virtual double masterTuning() const;
virtual bool loadSoundFonts(const QStringList&) { return true; }
virtual QStringList soundFonts() const { return QStringList(); }
virtual void process(unsigned, float*, float);
virtual void play(const Event&);
virtual const QList<MidiPatch*>& getPatchInfo() const;
// set/get a single parameter
virtual SyntiParameter parameter(int id) const;
virtual void setParameter(int id, double val);
// get/set synthesizer state
virtual SyntiState state() const;
virtual void setState(const SyntiState&);
virtual void allSoundsOff(int);
virtual void allNotesOff(int);
friend class Model;
};
enum {
AEOLUS_VOLUME, AEOLUS_REVSIZE, AEOLUS_REVTIME, AEOLUS_STPOSIT
};
#endif

168
aeolus/aeolus/asection.cpp Normal file
View file

@ -0,0 +1,168 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "asection.h"
extern float exp2ap (float);
#define N (MIXLEN * PERIOD)
void Diffuser::init (int size, float c)
{
_size = size;
_data = new float [size];
memset (_data, 0, size * sizeof (float));
_i = 0;
_c = c;
}
void Diffuser::fini (void)
{
delete[] _data;
}
float Asection::_refl [16] =
{
0.250f, 0.440f, 0.615f, 0.940f,
0.200f, 0.370f, 0.560f, 0.900f,
0.230f, 0.400f, 0.500f, 0.920f,
0.280f, 0.460f, 0.690f, 0.960f
};
Asection::Asection (float fsam) : _fsam (fsam)
{
_base = new float [NCHANN * N];
memset (_base, 0, NCHANN * N * sizeof (float));
_offs0 = 0;
_sw = _sx = _sy = 0.0f;
_dif0.init ((int)(fsam * 0.017f), 0.5f);
_dif1.init ((int)(fsam * 0.029f), 0.5f);
_dif2.init ((int)(fsam * 0.023f), 0.5f);
_dif3.init ((int)(fsam * 0.013f), 0.5f);
_apar [AZIMUTH].set("azimuth", 0.0f, -0.5f, 0.5f);
_apar [STWIDTH].set("stwidth", 0.8f, 0.0f, 1.0f);
_apar [DIRECT].set("direct", 0.56f, 0.00f, 1.00f);
_apar [REFLECT].set("reflect", 0.25f, 0.00f, 1.00f);
_apar [REVERB].set("reverb", 0.32f, 0.00f, 1.00f);
}
Asection::~Asection()
{
delete[] _base;
_dif0.fini ();
_dif1.fini ();
_dif2.fini ();
_dif3.fini ();
}
void Asection::set_size (float time)
{
int i, d;
float r = (time * _fsam);
if (r > N - PERIOD)
r = N - PERIOD;
for (i = 0; i < 16; i++)
{
d = (int)(r * _refl [i]);
d = (_offs0 - d * PERIOD) & (N - 1);
_offs [i] = d + (i >> 2) * N;
}
}
//---------------------------------------------------------
// process
//---------------------------------------------------------
void Asection::process (float vol, float *W, float *X, float *Y, float *R)
{
float x[PERIOD];
float y[PERIOD];
float gw = vol * _apar [DIRECT].fval();
float g = 0.45f * _apar [STWIDTH].fval();
float s = 0.5f + g * (1 - g);
float d = g - 0.5f;
float gx1 = gw * (s - d);
float gy1 = gw * (s + d);
g = 0.25f * _apar [STWIDTH].fval();
s = 0.5f + g * (1 - g);
d = g - 0.5f;
float gx2 = gw * (s - d);
float gy2 = gw * (s + d);
float* p = _base + _offs0;
float gr = 0.5f * _apar [REVERB].fval();
for (int i = 0; i < PERIOD; i++) {
float t0 = p [0 * N];
float t1 = p [1 * N];
float t2 = p [2 * N];
float t3 = p [3 * N];
p++;
s = t0 + t1 + t2 + t3;
R [i] += gr * s;
W [i] += gw * s;
x [i] = gx1 * (t3 + t0) + gx2 * (t2 + t1);
y [i] = gy1 * (t3 - t0) + gy2 * (t2 - t1);
}
gr = vol * _apar [REFLECT].fval();
p = _base;
for (int i = 0; i < PERIOD; i++) {
float t0 = _dif0.process (p[_offs[1]] + p[_offs[5]] + p [_offs [11]] + p [_offs [15]] + 1e-20f);
float t1 = _dif1.process (p[_offs[0]] + p[_offs[4]] + p [_offs [10]] + p [_offs [14]] + 1e-20f);
float t2 = _dif2.process (p[_offs[2]] + p[_offs[6]] + p [_offs [8]] + p [_offs [12]] + 2e-20f);
float t3 = _dif3.process (p[_offs[3]] + p[_offs[7]] + p [_offs [9]] + p [_offs [13]] + 2e-20f);
p++;
s = t0 + t1 + t2 + t3;
_sw += 0.5f * (s - _sw);
_sx += 0.5f * (0.4f * (t0 + t3) + 0.6f * (t2 + t1) - _sx);
_sy += 0.5f * (0.9f * (t0 - t3) + 0.8f * (t2 - t1) - _sy);
W [i] += gr * _sw;
x [i] += gr * _sx;
y [i] += gr * _sy;
}
g = 6.283184f * _apar [AZIMUTH].fval();
gx1 = cosf (g);
gy1 = sinf (g);
for (int i = 0; i < PERIOD; i++) {
X [i] += gx1 * x [i] + gy1 * y [i];
Y [i] += gx1 * y [i] - gy1 * x [i];
}
_offs0 = (_offs0 + PERIOD) & (N - 1);
for (int i = 0; i < 16; i++)
_offs [i] = ((_offs [i] + PERIOD) & (N - 1)) + (i >> 2) * N;
p = _base + _offs0;
memset(p + 0 * N, 0, PERIOD * sizeof(float));
memset(p + 1 * N, 0, PERIOD * sizeof(float));
memset(p + 2 * N, 0, PERIOD * sizeof(float));
memset(p + 3 * N, 0, PERIOD * sizeof(float));
}

89
aeolus/aeolus/asection.h Normal file
View file

@ -0,0 +1,89 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __ASECTION_H
#define __ASECTION_H
#include "global.h"
#define PERIOD 64
#define MIXLEN 64
#define NCHANN 4
#define NRANKS 32
//---------------------------------------------------------
// Diffuser
//---------------------------------------------------------
class Diffuser {
float *_data;
int _size;
int _i;
float _c;
public:
void init(int size, float c);
void fini();
int size() { return _size; }
float process(float x) {
float w = x - _c * _data [_i];
x = _data [_i] + _c * w;
_data [_i] = w;
if (++_i == _size)
_i = 0;
return x;
}
};
//---------------------------------------------------------
// Asection
//---------------------------------------------------------
class Asection {
enum { AZIMUTH, STWIDTH, DIRECT, REFLECT, REVERB };
int _offs0;
int _offs [16];
float _fsam;
float *_base;
float _sw;
float _sx;
float _sy;
Diffuser _dif0;
Diffuser _dif1;
Diffuser _dif2;
Diffuser _dif3;
SyntiParameter _apar [5];
public:
Asection (float fsam);
~Asection ();
float *get_wptr () { return _base + _offs0; }
SyntiParameter *get_apar () { return _apar; }
void set_size (float size);
void process (float vol, float *W, float *X, float *Y, float *R);
static float _refl [16];
};
#endif

256
aeolus/aeolus/audio.cpp Normal file
View file

@ -0,0 +1,256 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "messages.h"
#include "aeolus.h"
//---------------------------------------------------------
// start
//---------------------------------------------------------
void Aeolus::audio_start ()
{
_audio->_nasect = _nasect;
_audio->_fsamp = _fsamp;
_audio->_fsize = 0;
_audio->_instrpar = _audiopar;
for (int i = 0; i < _nasect; i++)
_audio->_asectpar [i] = _asectp [i]->get_apar ();
}
//---------------------------------------------------------
// init
//---------------------------------------------------------
void Aeolus::audio_init(int sampleRate)
{
_nplay = 2;
_fsamp = sampleRate;
_audiopar[VOLUME].set("volume", 0.32f, 0.00f, 1.00f);
_audiopar[REVSIZE].set("revsize", 0.075f, 0.025f, 0.150f);
_revtime = 4.0f;
_audiopar[REVTIME].set("revtime", _revtime, 2.0f, 7.0f);
_audiopar[STPOSIT].set("stposit", 0.5f, -1.0f, 1.0f);
_reverb.init (_fsamp);
_reverb.set_t60mf (_revtime);
_reverb.set_t60lo (_revtime * 1.50f, 250.0f);
_reverb.set_t60hi (_revtime * 0.50f, 3e3f);
_nasect = NASECT;
for (int i = 0; i < NASECT; i++) {
_asectp [i] = new Asection ((float) _fsamp);
_asectp [i]->set_size (_revsize);
}
_hold = KEYS_MASK;
}
//---------------------------------------------------------
// proc_queue
// Execute command from the model
//---------------------------------------------------------
void Aeolus::proc_queue (uint32_t k)
{
int c = k >> 24;
int j = (k >> 16) & 255;
int i = (k >> 8) & 255;
int b = k & 255;
switch (c) {
case 0: // Single key off.
key_off (i, b);
break;
case 1: // Single key on.
key_on (i, b);
break;
case 2: // Conditional key off.
cond_key_off (j, b);
break;
case 3: // Conditional key on.
cond_key_on (j, b);
break;
case 4: // Clear bits in division mask.
_divisp [j]->clr_div_mask (b);
break;
case 5: // Set bits in division mask.
_divisp [j]->set_div_mask (b);
break;
case 6: // Clear bits in rank mask.
_divisp [j]->clr_rank_mask (i, b);
break;
case 7: // Set bits in rank mask.
_divisp [j]->set_rank_mask (i, b);
break;
case 8: // Hold off.
_hold = KEYS_MASK;
cond_key_off (HOLD_MASK, HOLD_MASK);
break;
case 9: // Hold on.
_hold = KEYS_MASK | HOLD_MASK;
cond_key_on (j, HOLD_MASK);
break;
case 16: // Tremulant on/off.
if (b)
_divisp [j]->trem_on ();
else
_divisp [j]->trem_off ();
break;
case 17: // Per-division performance controllers.
#if 0
if (n < 2)
return;
//TODO u.i = Q->read (1);
//TODO Q->read_commit (2);
switch (i) {
case 0: _divisp [j]->set_swell (u.f); break;
case 1: _divisp [j]->set_tfreq (u.f); break;
case 2: _divisp [j]->set_tmodd (u.f); break;
break;
}
#endif
break;
}
}
//---------------------------------------------------------
// process
//---------------------------------------------------------
void Aeolus::process(unsigned nframes, float* out, float gain)
{
for (int n = 0; n < NNOTES; n++) {
int m = _keymap[n];
if (m & 128) {
m &= 127;
_keymap [n] = m;
for (int d = 0; d < _ndivis; d++)
_divisp[d]->update (n, m);
}
}
for (int d = 0; d < _ndivis; d++)
_divisp[d]->update(_keymap);
if (fabsf(_revsize - _audiopar [REVSIZE].fval()) > 0.001f) {
_revsize = _audiopar[REVSIZE].fval();
_reverb.set_delay(_revsize);
for (int j = 0; j < _nasect; j++)
_asectp[j]->set_size(_revsize);
}
if (fabsf(_revtime - _audiopar [REVTIME].fval()) > 0.1f) {
_revtime = _audiopar [REVTIME].fval();
_reverb.set_t60mf(_revtime);
_reverb.set_t60lo(_revtime * 1.50f, 250.0f);
_reverb.set_t60hi(_revtime * 0.50f, 3e3f);
}
int k = nout;
while (nframes > 0) {
if (nout == 0) {
float W [PERIOD];
float X [PERIOD];
float Y [PERIOD];
float R [PERIOD];
memset(W, 0, PERIOD * sizeof (float));
memset(X, 0, PERIOD * sizeof (float));
memset(Y, 0, PERIOD * sizeof (float));
memset(R, 0, PERIOD * sizeof (float));
for (int j = 0; j < _ndivis; j++)
_divisp[j]->process();
for (int j = 0; j < _nasect; j++)
_asectp[j]->process(gain, W, X, Y, R);
_reverb.process(PERIOD, gain, R, W, X, Y);
float stposit = _audiopar[STPOSIT].fval();
for (int j = 0; j < PERIOD; j++) {
loutb[j] = W[j] + stposit * X[j] + Y[j];
routb[j] = W[j] + stposit * X[j] - Y[j];
}
nout = PERIOD;
k += PERIOD;
}
*out++ += gain * loutb[PERIOD - nout];
*out++ += gain * routb[PERIOD - nout];
--nout;
--nframes;
}
}
//---------------------------------------------------------
// newDivis
//---------------------------------------------------------
void Aeolus::newDivis(M_new_divis* X)
{
Division *D = new Division (_asectp [X->_asect], (float) _fsamp);
D->set_div_mask (X->_dmask);
D->set_swell (X->_swell);
D->set_tfreq (X->_tfreq);
D->set_tmodd (X->_tmodd);
_divisp [_ndivis] = D;
_ndivis++;
}
void Aeolus::cond_key_off (int m, int b)
{
unsigned char* p = _keymap;
for (int i = 0; i < NNOTES; i++, p++) {
if (*p & m) {
*p &= ~b;
*p |= 128;
}
}
}
void Aeolus::cond_key_on (int m, int b)
{
unsigned char* p = _keymap;
for (int i = 0; i < NNOTES; i++, p++) {
if (*p & m)
*p |= b | 128;
}
}
void Aeolus::key_off (int n, int b)
{
_keymap[n] &= ~b;
_keymap[n] |= 128;
}
void Aeolus::key_on (int n, int b)
{
_keymap[n] |= b | 128;
}

54
aeolus/aeolus/callbacks.h Normal file
View file

@ -0,0 +1,54 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CALLBACKS_H
#define __CALLBACKS_H
enum
{
CB_GLOB_SAVE = 0x1000,
CB_GLOB_MOFF,
CB_SHOW_INSW,
CB_SHOW_AUDW,
CB_SHOW_MIDW,
CB_MAIN_MSG,
CB_MAIN_END,
CB_EDIT_REQ,
CB_EDIT_APP,
CB_EDIT_END,
CB_AUDIO_ACT,
CB_DIVIS_ACT,
CB_MIDI_MODCONF,
CB_MIDI_SETCONF,
CB_MIDI_GETCONF,
CB_RETUNE,
CB_SC_HARM,
CB_SC_NOTE,
CB_MS_SEL,
CB_MS_UPD,
CB_MS_DEF,
CB_MS_UND,
CB_FW_SEL,
CB_FW_UPD,
CB_FW_DEF,
CB_FW_UND
};
#endif

206
aeolus/aeolus/division.cpp Normal file
View file

@ -0,0 +1,206 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "division.h"
//---------------------------------------------------------
// Division
//---------------------------------------------------------
Division::Division (Asection *asect, float fsam)
: _asect (asect),
_nrank (0),
_dmask (0),
_trem (0),
_fsam (fsam),
_swel (1.0f),
_gain (0.1f),
_w (0.0f),
_c (1.0f),
_s (0.0f),
_m (0.0f)
{
for (int i = 0; i < NRANKS; i++)
_ranks [i] = 0;
}
Division::~Division()
{
}
//---------------------------------------------------------
// process
//---------------------------------------------------------
void Division::process()
{
memset (_buff, 0, NCHANN * PERIOD * sizeof (float));
for (int i = 0; i < _nrank; i++)
_ranks [i]->play (1);
float g = _swel;
if (_trem) {
_s += _w * _c;
_c -= _w * _s;
float t = sqrtf (_c * _c + _s * _s);
_c /= t;
_s /= t;
if ((_trem == 2) && (fabsf (_s) < 0.05f)) {
_trem = 0;
_c = 1;
_s = 0;
}
g *= 1.0f + _m * _s;
}
float t = 1.05f * _gain;
if (g > t)
g = t;
t = 0.95f * _gain;
if (g < t)
g = t;
float d = (g - _gain) / PERIOD;
g = _gain;
float* p = _buff;
float* q = _asect->get_wptr ();
for (int i = 0; i < PERIOD; i++) {
g += d;
q [0 * PERIOD * MIXLEN] += p [0 * PERIOD] * g;
q [1 * PERIOD * MIXLEN] += p [1 * PERIOD] * g;
q [2 * PERIOD * MIXLEN] += p [2 * PERIOD] * g;
q [3 * PERIOD * MIXLEN] += p [3 * PERIOD] * g;
p++;
q++;
}
_gain = g;
}
void Division::set_rank (int ind, Rankwave *W, int pan, int del)
{
Rankwave *C;
C = _ranks [ind];
if (C) { W->_nmask = C->_cmask; delete C; }
else W->_nmask = 0;
W->_cmask = 0;
_ranks [ind] = W;
del = (int)(1e-3f * del * _fsam / PERIOD);
if (del > 31) del = 31;
W->set_param (_buff, del, pan);
if (_nrank < ++ind) _nrank = ind;
}
void Division::update (int note, int mask)
{
int r;
Rankwave *W;
for (r = 0; r < _nrank; r++)
{
W = _ranks [r];
if (W->_cmask & 127)
{
if (mask & W->_cmask) W->note_on (note + 36);
else W->note_off (note + 36);
}
}
}
void Division::update (unsigned char *keys)
{
int d, r, m, n, n0, n1;
unsigned char *k;
Rankwave *W;
for (r = 0; r < _nrank; r++)
{
W = _ranks [r];
if ((W->_cmask ^ W->_nmask) & 127)
{
m = W->_nmask & 127;
if (m)
{
n0 = W->n0 ();
n1 = W->n1 ();
k = keys;
d = n0 - 36;
if (d > 0) k += d;
for (n = n0; n <= n1; n++)
{
if (*k++ & m) W->note_on (n);
else W->note_off (n);
}
}
else W->all_off ();
}
W->_cmask = W->_nmask;
}
}
void Division::set_div_mask (int bits)
{
int r;
Rankwave *W;
bits &= 127;
_dmask |= bits;
for (r = 0; r < _nrank; r++)
{
W = _ranks [r];
if (W->_nmask & 128) W->_nmask |= bits;
}
}
void Division::clr_div_mask (int bits)
{
int r;
Rankwave *W;
bits &= 127;
_dmask &= ~bits;
for (r = 0; r < _nrank; r++)
{
W = _ranks [r];
if (W->_nmask & 128) W->_nmask &= ~bits;
}
}
void Division::set_rank_mask (int ind, int bits)
{
Rankwave *W = _ranks [ind];
if (bits == 128) bits |= _dmask;
W->_nmask |= bits;
}
void Division::clr_rank_mask (int ind, int bits)
{
Rankwave *W = _ranks [ind];
if (bits == 128) bits |= _dmask;
W->_nmask &= ~bits;
}

67
aeolus/aeolus/division.h Normal file
View file

@ -0,0 +1,67 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __DIVISION_H
#define __DIVISION_H
#include "asection.h"
#include "rankwave.h"
//---------------------------------------------------------
// Division
//---------------------------------------------------------
class Division
{
Asection *_asect;
Rankwave *_ranks [NRANKS];
int _nrank;
int _dmask;
int _trem;
float _fsam;
float _swel;
float _gain;
float _w;
float _c;
float _s;
float _m;
float _buff [NCHANN * PERIOD];
public:
Division (Asection *asect, float fsam);
~Division ();
void set_rank (int ind, Rankwave *W, int pan, int del);
void set_swell (float stat) { _swel = 0.2 + 0.8 * stat * stat; }
void set_tfreq (float freq) { _w = 6.283184f * PERIOD * freq / _fsam; }
void set_tmodd (float modd) { _m = modd; }
void set_div_mask (int bits);
void clr_div_mask (int bits);
void set_rank_mask (int ind, int bits);
void clr_rank_mask (int ind, int bits);
void trem_on() { _trem = 1; }
void trem_off() { _trem = 2; }
void process();
void update(int note, int mask);
void update(unsigned char *keys);
};
#endif

30
aeolus/aeolus/exp2ap.cpp Normal file
View file

@ -0,0 +1,30 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
float exp2ap (float x)
{
int i;
i = (int)(floor (x));
x -= i;
// return ldexp (1 + x * (0.66 + 0.34 * x), i);
return ldexp (1 + x * (0.6930 + x * (0.2416 + x * (0.0517 + x * 0.0137))), i);
}

98
aeolus/aeolus/global.h Normal file
View file

@ -0,0 +1,98 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
Copyright (C) 2008 Hans Fugal <hans@fugal.net> (OSX version)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __GLOBAL_H
#define __GLOBAL_H
#ifdef __APPLE__
#include <machine/endian.h>
#define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
#define __BIG_ENDIAN __DARWIN_BIG_ENDIAN
#define __PDP_ENDIAN __DARWIN_PDP_ENDIAN
#define __BYTE_ORDER __DARWIN_BYTE_ORDER
#else
#ifdef __MINGW32__
#define __BYTE_ORDER __LITTLE_ENDIAN
#else
#include <endian.h>
#endif
#endif
#ifdef __BYTE_ORDER
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#define WR2(p,v) { (p)[0] = v; (p)[1] = v >> 8; }
#define WR4(p,v) { (p)[0] = v; (p)[1] = v >> 8; (p)[2] = v >> 16; (p)[3] = v >> 24; }
#define RD2(p) ((p)[0] + ((p)[1] << 8));
#define RD4(p) ((p)[0] + ((p)[1] << 8) + ((p)[2] << 16) + ((p)[3] << 24));
#elif (__BYTE_ORDER == __BIG_ENDIAN)
#define WR2(p,v) { (p)[1] = v; (p)[0] = v >> 8; }
#define WR4(p,v) { (p)[3] = v; (p)[2] = v >> 8; (p)[1] = v >> 16; (p)[0] = v >> 24; }
#define RD2(p) ((p)[1] + ((p)[0] << 8));
#define RD4(p) ((p)[3] + ((p)[2] << 8) + ((p)[1] << 16) + ((p)[0] << 24));
#else
#error Byte order is not supported !
#endif
#else
#error Byte order is undefined !
#endif
enum // GLOBAL LIMITS
{
NASECT = 4,
NDIVIS = 8,
NKEYBD = 6,
NGROUP = 8,
NNOTES = 61,
NBANK = 32,
NPRES = 32
};
#define MIDICTL_SWELL 7
#define SWELL_MIN 0.0f
#define SWELL_MAX 1.0f
#define SWELL_DEF 1.0f
#define MIDICTL_TFREQ 12
#define TFREQ_MIN 2.0f
#define TFREQ_MAX 8.0f
#define TFREQ_DEF 4.0f
#define MIDICTL_TMODD 13
#define TMODD_MIN 0.0f
#define TMODD_MAX 0.6f
#define TMODD_DEF 0.3f
#define MIDICTL_BANK 32
#define MIDICTL_HOLD 64
#define MIDICTL_IFELM 98
#define MIDICTL_ASOFF 120
#define MIDICTL_ANOFF 123
#define KEYS_MASK 63
#define HOLD_MASK 64
#define ALL_MASK 127
#include "msynth/synti.h"
#include "libmscore/midipatch.h"
#endif

354
aeolus/aeolus/messages.h Normal file
View file

@ -0,0 +1,354 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __MESSAGES_H
#define __MESSAGES_H
#include "rankwave.h"
#include "asection.h"
#include "addsynth.h"
#include "global.h"
class ITC_mesg {
public:
ITC_mesg() {}
ITC_mesg(int) {};
};
enum
{
FM_SLAVE = 8,
FM_IFACE = 9,
FM_MODEL = 10,
FM_IMIDI = 11,
FM_AUDIO = 12,
FM_TXTIP = 13,
TO_SLAVE = 8,
TO_IFACE = 9,
TO_MODEL = 10,
TO_IMIDI = 11,
TO_AUDIO = 12,
EV_RLINE = 0,
EV_XWIN = 16,
EV_QMIDI = 24,
EV_SYNC = 30,
EV_EXIT = 31
};
enum
{
MT_AUDIO_INFO,
MT_AUDIO_SYNC,
MT_MIDI_INFO,
MT_NEW_DIVIS,
MT_CALC_RANK,
MT_LOAD_RANK,
MT_SAVE_RANK,
MT_IFC_INIT,
MT_IFC_READY,
MT_IFC_ELCLR, // must be in this order
MT_IFC_ELSET, //
MT_IFC_ELXOR, //
MT_IFC_ELATT,
MT_IFC_GRCLR,
MT_IFC_AUPAR,
MT_IFC_DIPAR,
MT_IFC_RETUNE,
MT_IFC_ANOFF,
MT_IFC_MCSET,
MT_IFC_MCGET,
MT_IFC_PRRCL,
MT_IFC_PRDEC,
MT_IFC_PRINC,
MT_IFC_PRSTO,
MT_IFC_PRINS,
MT_IFC_PRDEL,
MT_IFC_PRGET,
MT_IFC_EDIT,
MT_IFC_APPLY,
MT_IFC_SAVE,
MT_IFC_TXTIP
};
#define SRC_GUI_DRAG 100
#define SRC_GUI_DONE 101
#define SRC_MIDI_PAR 200
class M_audio_info : public ITC_mesg
{
public:
M_audio_info (void) : ITC_mesg (MT_AUDIO_INFO) {}
float _fsamp;
int _fsize;
int _nasect;
SyntiParameter *_instrpar;
SyntiParameter *_asectpar [NASECT];
};
class M_midi_info : public ITC_mesg
{
public:
M_midi_info (void) : ITC_mesg (MT_MIDI_INFO) {}
int _client;
int _ipport;
uint16_t _chbits [16];
};
class M_new_divis : public ITC_mesg
{
public:
M_new_divis (void) : ITC_mesg (MT_NEW_DIVIS) {}
int _flags;
int _dmask;
int _asect;
float _swell;
float _tfreq;
float _tmodd;
};
class M_def_rank : public ITC_mesg
{
public:
M_def_rank (int type) : ITC_mesg (type) {}
int _divis;
int _rank;
int _group;
int _ifelm;
float _fsamp;
float _fbase;
float *_scale;
Addsynth *_sdef;
Rankwave *_wave;
const char *_path;
};
//---------------------------------------------------------
// M_ifc_init
//---------------------------------------------------------
class M_ifc_init : public ITC_mesg
{
public:
M_ifc_init () : ITC_mesg (MT_IFC_INIT) {}
const char *_stops;
const char *_waves;
const char *_instr;
const char *_appid;
int _client;
int _ipport;
int _nasect;
int _nkeybd;
int _ndivis;
int _ngroup;
int _ntempe;
struct {
const char *_label;
int _flags;
} _keybdd [NKEYBD];
struct {
const char *_label;
int _asect;
int _flags;
} _divisd [NDIVIS];
struct {
const char *_label;
int _nifelm;
struct {
const char *_label;
const char *_mnemo;
int _type;
} _ifelmd [32];
} _groupd [8];
struct {
const char *_label;
const char *_mnemo;
} _temped [16];
};
class M_ifc_ifelm : public ITC_mesg
{
public:
M_ifc_ifelm (int type, int g, int i) :
ITC_mesg (type),
_group (g),
_ifelm (i)
{}
int _group;
int _ifelm;
};
class M_ifc_aupar : public ITC_mesg
{
public:
M_ifc_aupar (int s, int a, int p, float v) :
ITC_mesg (MT_IFC_AUPAR),
_srcid (s),
_asect (a),
_parid (p),
_value (v)
{}
int _srcid;
int _asect;
int _parid;
float _value;
};
class M_ifc_dipar : public ITC_mesg
{
public:
M_ifc_dipar (int s, int d, int p, float v) :
ITC_mesg (MT_IFC_DIPAR),
_srcid (s),
_divis (d),
_parid (p),
_value (v)
{}
int _srcid;
int _divis;
int _parid;
float _value;
};
class M_ifc_retune : public ITC_mesg
{
public:
M_ifc_retune (float f, int t) :
ITC_mesg (MT_IFC_RETUNE),
_freq (f),
_temp (t)
{}
float _freq;
int _temp;
};
class M_ifc_anoff : public ITC_mesg
{
public:
M_ifc_anoff (int bits) :
ITC_mesg (MT_IFC_ANOFF),
_bits (bits)
{
}
int _bits;
};
class M_ifc_chconf : public ITC_mesg
{
public:
M_ifc_chconf (int type, int index, uint16_t *bits) :
ITC_mesg (type),
_index (index)
{
if (bits) memcpy (_bits, bits, 16 * sizeof (uint16_t));
else memset (_bits, 0, 16 * sizeof (uint16_t));
}
int _index;
uint16_t _bits [16];
};
class M_ifc_preset : public ITC_mesg
{
public:
M_ifc_preset (int type, int bank, int pres, int stat, uint32_t *bits) :
ITC_mesg (type),
_bank (bank),
_pres (pres),
_stat (stat)
{
if (bits) memcpy (_bits, bits, NGROUP * sizeof (uint32_t));
else memset (_bits, 0, NGROUP * sizeof (uint32_t));
}
int _bank;
int _pres;
int _stat;
uint32_t _bits [NGROUP];
};
class M_ifc_edit : public ITC_mesg
{
public:
M_ifc_edit (int type, int group, int ifelm, Addsynth *synth) :
ITC_mesg (type),
_group (group),
_ifelm (ifelm),
_synth (synth)
{}
int _group;
int _ifelm;
Addsynth *_synth;
};
class M_ifc_txtip : public ITC_mesg
{
public:
M_ifc_txtip (void) :
ITC_mesg (MT_IFC_TXTIP),
_line (0)
{}
char *_line;
};
#endif

1304
aeolus/aeolus/model.cpp Normal file

File diff suppressed because it is too large Load diff

205
aeolus/aeolus/model.h Normal file
View file

@ -0,0 +1,205 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __MODEL_H
#define __MODEL_H
#include "messages.h"
#include "addsynth.h"
#include "rankwave.h"
#include "global.h"
class Aeolus;
class Asect
{
public:
Asect (void) { *_label = 0; }
char _label [64];
};
class Rank
{
public:
int _count;
Addsynth *_sdef;
Rankwave *_wave;
};
class Divis
{
public:
enum { HAS_SWELL = 1, HAS_TREM = 2, NRANK = 32 };
enum { SWELL, TFREQ, TMODD, NPARAM };
Divis();
char _label [16];
int _flags;
int _dmask;
int _nrank;
int _asect;
int _keybd;
SyntiParameter _param [NPARAM];
Rank _ranks [NRANK];
};
class Keybd
{
public:
enum { IS_PEDAL = 256 };
Keybd ();
char _label [16];
int _flags;
};
class Ifelm
{
public:
enum { DIVRANK, KBDRANK, COUPLER, TREMUL };
Ifelm (void);
char _label [32];
char _mnemo [8];
int _type;
int _keybd;
int _state;
uint32_t _action0;
uint32_t _action1;
};
class Group
{
public:
enum { NIFELM = 32 };
Group();
char _label [16];
int _nifelm;
Ifelm _ifelms [NIFELM];
};
class Chconf
{
public:
Chconf () { memset (_bits, 0, 16 * sizeof (uint16_t)); }
uint16_t _bits [16];
};
//---------------------------------------------------------
// Preset
//---------------------------------------------------------
class Preset
{
public:
Preset () { memset (_bits, 0, NGROUP * sizeof (uint32_t)); }
uint32_t _bits [NGROUP];
};
//---------------------------------------------------------
// Model
//---------------------------------------------------------
class Model
{
Aeolus* _aeolus;
uint16_t* _midimap;
const char* _stops;
char _instr [1024];
const char* _waves;
bool _ready;
Asect _asect [NASECT];
Keybd _keybd [NKEYBD];
Divis _divis [NDIVIS];
Group _group [NGROUP];
int _nasect;
int _ndivis;
int _nkeybd;
int _ngroup;
float _fbase;
int _itemp;
int _count;
int _bank;
int _pres;
int _client;
int _portid;
int _sc_cmode; // stop control command mode
int _sc_group; // stop control group number
Chconf _chconf [8];
Preset* _preset [NBANK][NPRES];
void proc_mesg(ITC_mesg *M);
void init_audio();
void init_iface();
void init_ranks(int comm);
void proc_rank(int g, int i, int comm);
void set_aupar(int s, int a, int p, float v);
void set_dipar(int s, int d, int p, float v);
void set_mconf(int i, uint16_t *d);
void get_state(uint32_t *bits);
void set_state(int bank, int pres);
void midi_off(int mask);
void retune(float freq, int temp);
void recalc(int g, int i);
void save();
Rank* find_rank(int g, int i);
int read_instr();
int write_instr();
int get_preset(int bank, int pres, uint32_t *bits);
void set_preset(int bank, int pres, uint32_t *bits);
void ins_preset(int bank, int pres, uint32_t *bits);
void del_preset(int bank, int pres);
int read_presets();
bool writePresets();
public:
Model (Aeolus* aeolus, uint16_t* midimap, const char* stops,
const char* instr, const char* waves);
virtual ~Model() {}
void set_ifelm (int g, int i, int m);
void clr_group (int g);
void init ();
};
#endif

262
aeolus/aeolus/prbsgen.h Normal file
View file

@ -0,0 +1,262 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __PRBSGEN_H
#define __PRBSGEN_H
#include <assert.h>
#include <stdint.h>
//---------------------------------------------------------------------------
//
// Description:
// Pseudo random binary sequence generator using polynomial
// division in GF (2).
//
// There are two ways to built such a generator. Both use some
// form of shift register.
//
// 1. The first type feeds back the parity (XOR) of the taps corresponding to
// the non-zero elements of the polynomial into the input of the register.
// This is the most efficient way to do it in hardware.
//
// 2. In the seond form, when the bit shifted out is 1, the contents of the
// register are XORed with a bit pattern representing the polynomial.
// This is the best way to do it in software.
//
// Mutatis mutandis the two forms are equivalent. Any sequence that can be
// generated by one of the realisations can also be produced by the other.
// This software obviously uses the second form. It can use any polynomial
// up to (and including) a degree of 32.
//
//
// set_poly (p)
//
// Defines the polynomial to be used. The value of p is found from the
// sequence of coefficients (0 or 1) of the polynomial starting with the
// constant term, and dropping the highest one
//
// 0 1 2 3 4 5 6 7
// Example: P = x^7 + x^6 + 1 --> 1 0 0 0 0 0 1 1 --> 1000001 --> 0x41
//
// To emulate the first form described above, start with the highest
// exponent and drop the constant term.
//
// 7 6 5 4 3 2 1 0
// Example: P = x^7 + x^6 + 1 --> 1 1 0 0 0 0 0 1 --> 1100000 --> 0x60
//
// Also sets the state to all ones.
//
//
// set_state (x)
//
// Sets the initial state to x.
//
//
// step ()
//
// Returns the next pseudo random bit.
//
//
// sync_forw (x)
//
// This sets the generator in a state as if the last N (= degree) bits
// were those defined by x (the LSB of x represents the oldest bit).
// This can be used to synchronise a BER counter to a received bit stream,
// or to set the initial state when emulating a generator of the first form
// when the output is taken from the feedback.
//
//
// sync_back (x)
//
// This sets the generator in a state so that the first N (= degree) output
// bits will be those defined by x (the LSB of x will be the first output bit).
// This can be used to set the initial state when emulating a generator of
// the first form when the output is taken from the shifted out bit.
//
//
//---------------------------------------------------------------------------==
class Prbsgen
{
public:
enum
{
// Some polynomials for maximum length seqeunces.
G7 = 0x00000041,
G8 = 0x0000008E,
G15 = 0x00004001,
G16 = 0x00008016,
G23 = 0x00400010,
G24 = 0x0080000D,
G31 = 0x40000004,
G32 = 0x80000057,
};
Prbsgen (void);
void set_poly (uint32_t poly);
void set_stat (uint32_t stat);
void sync_forw (uint32_t bits);
void sync_back (uint32_t bits);
int step (void);
void crc_in (int b);
int crc_out (void);
uint32_t stat (void) const;
uint32_t poly (void) const;
uint32_t mask (void) const;
uint32_t hbit (void) const;
int degr (void) const;
~Prbsgen (void);
private:
uint32_t _stat;
uint32_t _poly;
uint32_t _mask;
uint32_t _hbit;
int _degr;
};
inline Prbsgen::Prbsgen (void)
: _stat (0), _poly (0), _mask (0), _degr (0)
{
}
inline Prbsgen::~Prbsgen (void)
{
}
inline void Prbsgen::set_poly (uint32_t poly)
{
assert (poly != 0);
_poly = poly;
_mask = 0;
_degr = 0;
while (_mask < _poly)
{
_mask = (_mask << 1) | 1;
_degr += 1;
}
_stat = _mask;
_hbit = (_mask >> 1) + 1;
}
inline void Prbsgen::set_stat (uint32_t stat)
{
assert (_poly != 0);
_stat = stat & _mask;
assert (_stat != 0);
}
inline int Prbsgen::step (void)
{
int bit;
assert (_poly != 0);
bit = _stat & 1;
_stat >>= 1;
if (bit) _stat ^= _poly;
return bit;
}
inline void Prbsgen::sync_forw (uint32_t bits)
{
assert (_poly != 0);
for (int i = 0; i < _degr; i++)
{
_stat >>= 1;
if (bits & 1) _stat ^= _poly;
bits >>= 1;
}
}
inline void Prbsgen::sync_back (uint32_t bits)
{
assert (_poly != 0);
_stat = 0;
for (int h = _hbit; h; h >>= 1)
{
if (bits & h) _stat ^= _poly;
_stat <<= 1;
}
_stat ^= bits;
_stat &= _mask;
}
inline void Prbsgen::crc_in (int b)
{
int bit;
assert (_poly != 0);
bit = (_stat & 1) ^ b;
_stat >>= 1;
if (bit) _stat ^= _poly;
}
inline int Prbsgen::crc_out (void)
{
int bit;
assert (_poly != 0);
bit = (_stat & 1);
_stat >>= 1;
return bit;
}
inline uint32_t Prbsgen::stat (void) const { return _stat; }
inline uint32_t Prbsgen::poly (void) const { return _poly; }
inline uint32_t Prbsgen::mask (void) const { return _mask; }
inline uint32_t Prbsgen::hbit (void) const { return _hbit; }
inline int Prbsgen::degr (void) const { return _degr; }
#endif

589
aeolus/aeolus/rankwave.cpp Normal file
View file

@ -0,0 +1,589 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "rankwave.h"
#define DEBUG
extern float exp2ap (float);
Rngen Pipewave::_rgen;
float *Pipewave::_arg = 0;
float *Pipewave::_att = 0;
void Pipewave::initstatic (float fsamp)
{
int k;
if (_arg) return;
k = (int)(fsamp);
_arg = new float [k];
k = (int)(0.5f * fsamp);
_att = new float [k];
}
void Pipewave::play (void)
{
int i, d, k1, k2;
float g, dg, y, dy, t;
float *p, *q, *r;
p = _p_p;
r = _p_r;
if (_sdel & 1)
{
if (! p)
{
p = _p0;
_y_p = 0.0f;
_z_p = 0.0f;
}
}
else
{
if (! r)
{
r = p;
p = 0;
_g_r = 1.0f;
_y_r = _y_p;
_i_r = _k_r;
}
}
if (r)
{
k1 = PERIOD;
q = _out;
g = _g_r;
i = _i_r - 1;
dg = g / PERIOD;
if (i) dg *= _m_r ;
if (r < _p1)
{
while (k1--)
{
*q++ += g * *r++;
g -= dg;
}
}
else
{
y = _y_r;
dy = _d_r;
while (k1)
{
t = y + k1 * dy;
d = 0;
k2 = k1;
if (t > 1.0f)
{
d = 1;
k2 = (int)((1.0f - y) / dy);
}
else if (t < 0.0f)
{
d = -1;
k2 = (int)(-y / dy);
}
k1 -= k2;
while (k2--)
{
*q++ += g * (r [0] + y * (r [1] - r [0]));
g -= dg;
y += dy;
r += _k_s;
}
y -= d;
r += d;
}
_y_r = y;
}
if (i)
{
_g_r = g;
_i_r = i;
if (r >= _p2) r -= _l1;
}
else r = 0;
}
if (p)
{
k1 = PERIOD;
q = _out;
if (p < _p1)
{
while (k1--)
{
*q++ += *p++;
}
}
else
{
y = _y_p;
_z_p += _d_p * 0.0005f * (0.05f * _d_p * (_rgen.urandf () - 0.5f) - _z_p);
dy = _z_p * _k_s;
while (k1)
{
t = y + k1 * dy;
d = 0;
k2 = k1;
if (t > 1.0f)
{
d = 1;
k2 = (int)((1.0f - y) / dy);
}
else if (t < 0.0f)
{
d = -1;
k2 = (int)(-y / dy);
}
k1 -= k2;
while (k2--)
{
*q++ += p [0] + y * (p [1] - p [0]);
y += dy;
p += _k_s;
}
y -= d;
p += d;
}
if (p >= _p2) p -= _l1;
_y_p = y;
}
}
_p_p = p;
_p_r = r;
}
void Pipewave::genwave (Addsynth *D, int n, float fsamp, float fpipe)
{
int h, i, k, nc;
float f0, f1, f, m, t, v, v0;
m = D->_n_att.vi (n);
for (h = 0; h < N_HARM; h++)
{
t = D->_h_att.vi (h, n);
if (t > m) m = t;
}
_l0 = (int)(fsamp * m + 0.5);
_l0 = (_l0 + PERIOD - 1) & ~(PERIOD - 1);
f1 = (fpipe + D->_n_off.vi (n) + D->_n_ran.vi (n) * (2 * _rgen.urand () - 1)) / fsamp;
f0 = f1 * exp2ap (D->_n_atd.vi (n) / 1200.0f);
for (h = N_HARM - 1; h >= 0; h--)
{
f = (h + 1) * f1;
if ((f < 0.45f) && (D->_h_lev.vi (h, n) >= -40.0f)) break;
}
if (f > 0.250f) _k_s = 3;
else if (f > 0.125f) _k_s = 2;
else _k_s = 1;
looplen (f1 * fsamp, _k_s * fsamp, (int)(fsamp / 6.0f), &_l1, &nc);
if (_l1 < _k_s * PERIOD)
{
k = (_k_s * PERIOD - 1) / _l1 + 1;
_l1 *= k;
nc *= k;
}
k = _l0 + _l1 + _k_s * (PERIOD + 4);
delete[] _p0;
_p0 = new float [k];
_p1 = _p0 + _l0;
_p2 = _p1 + _l1;
memset (_p0, 0, k * sizeof (float));
_k_r = (int)(ceilf (D->_n_dct.vi (n) * fsamp / PERIOD) + 1);
_m_r = 1.0f - powf (0.1, 1.0 / _k_r);
_d_r = _k_s * (exp2ap (D->_n_dcd.vi (n) / 1200.0f) - 1.0f);
_d_p = D->_n_ins.vi (n);
t = 0.0f;
k = (int)(fsamp * D->_n_att.vi (n) + 0.5);
for (i = 0; i <= _l0; i++)
{
_arg [i] = t - floorf (t + 0.5);
t += (i < k) ? (((k - i) * f0 + i * f1) / k) : f1;
}
for (i = 1; i < _l1; i++)
{
t = _arg [_l0]+ (float) i * nc / _l1;
_arg [i + _l0] = t - floorf (t + 0.5);
}
v0 = exp2ap (0.1661 * D->_n_vol.vi (n));
for (h = 0; h < N_HARM; h++)
{
if ((h + 1) * f1 > 0.45) break;
v = D->_h_lev.vi (h, n);
if (v < -80.0) continue;
v = v0 * exp2ap (0.1661 * (v + D->_h_ran.vi (h, n) * (2 * _rgen.urand () - 1)));
k = (int)(fsamp * D->_h_att.vi (h, n) + 0.5);
attgain (k, D->_h_atp.vi (h, n));
for (i = 0; i < _l0 + _l1; i++)
{
t = _arg [i] * (h + 1);
t -= floorf (t);
m = v * sinf (2 * M_PI * t);
if (i < k) m *= _att [i];
_p0 [i] += m;
}
}
for (i = 0; i < _k_s * (PERIOD + 4); i++) _p0 [i + _l0 + _l1] = _p0 [i + _l0];
}
void Pipewave::looplen (float f, float fsamp, int lmax, int *aa, int *bb)
{
int i, j, a, b, t;
int z [8];
double g, d;
g = fsamp / f;
for (i = 0; i < 8; i++)
{
a = z [i] = (int)(floor (g + 0.5));
g -= a;
b = 1;
j = i;
while (j > 0)
{
t = a;
a = z [--j] * a + b;
b = t;
}
if (a < 0)
{
a = -a;
b = -b;
}
if (a <= lmax)
{
d = fsamp * b / a - f;
if ((fabs (d) < 0.1) && (fabs (d) < 3e-4 * f)) break;
g = (fabs (g) < 1e-6) ? 1e6 : 1.0 / g;
}
else
{
b = (int)(lmax * f / fsamp);
a = (int)(b * fsamp / f + 0.5);
d = fsamp * b / a - f;
break;
}
}
*aa = a;
*bb = b;
}
void Pipewave::attgain (int n, float p)
{
int i, j, k;
float d, m, w, x, y, z;
w = 0.05;
x = 0.0;
y = 0.6;
if (p > 0) y += 0.11 * p;
z = 0.0;
j = 0;
for (i = 1; i <= 24; i++)
{
k = n * i / 24;
x = 1.0 - z - 1.5 * y;
y += w * x;
d = w * y * p / (k - j);
while (j < k)
{
m = (double) j / n;
_att [j++] = (1.0 - m) * z + m;
z += d;
}
}
}
void Pipewave::save (FILE *F)
{
int k;
union
{
int16_t i16 [16];
int32_t i32 [8];
float flt [8];
} d;
d.i32 [0] = _l0;
d.i32 [1] = _l1;
d.i16 [4] = _k_s;
d.i16 [5] = _k_r;
d.flt [3] = _m_r;
d.i32 [4] = 0;
d.i32 [5] = 0;
d.i32 [6] = 0;
d.i32 [7] = 0;
fwrite (&d, 1, 32, F);
k = _l0 +_l1 + _k_s * (PERIOD + 4);
fwrite (_p0, k, sizeof (float), F);
}
void Pipewave::load (FILE *F)
{
int k;
union
{
int16_t i16 [16];
int32_t i32 [8];
float flt [8];
} d;
fread (&d, 1, 32, F);
_l0 = d.i32 [0];
_l1 = d.i32 [1];
_k_s = d.i16 [4];
_k_r = d.i16 [5];
_m_r = d.flt [3];
k = _l0 +_l1 + _k_s * (PERIOD + 4);
delete[] _p0;
_p0 = new float [k];
_p1 = _p0 + _l0;
_p2 = _p1 + _l1;
fread (_p0, k, sizeof (float), F);
}
Rankwave::Rankwave (int n0, int n1) : _n0 (n0), _n1 (n1), _list (0), _modif (false)
{
_pipes = new Pipewave [n1 - n0 + 1];
}
Rankwave::~Rankwave (void)
{
delete[] _pipes;
}
void Rankwave::gen_waves (Addsynth *D, float fsamp, float fbase, float *scale)
{
Pipewave::initstatic (fsamp);
fbase *= D->_fn / (D->_fd * scale [9]);
for (int i = _n0; i <= _n1; i++)
{
_pipes [i - _n0].genwave (D, i - _n0, fsamp, ldexpf (fbase * scale [i % 12], i / 12 - 5));
}
_modif = true;
}
void Rankwave::set_param (float *out, int del, int pan)
{
int n, a, b;
Pipewave *P;
_sbit = 1 << del;
switch (pan)
{
case 'L': a = 2, b = 0; break;
case 'C': a = 2, b = 1; break;
case 'R': a = 2, b = 2; break;
default: a = 4, b = 0;
}
for (n = _n0, P = _pipes; n <= _n1; n++, P++) P->_out = out + ((n % a) + b) * PERIOD;
}
void Rankwave::play (int shift)
{
Pipewave *P, *Q;
for (P = 0, Q = _list; Q; Q = Q->_link)
{
Q->play ();
if (shift) Q->_sdel = (Q->_sdel >> 1) | Q->_sbit;
if (Q->_sdel || Q->_p_p || Q->_p_r) P = Q;
else
{
if (P) P->_link = Q->_link;
else _list = Q->_link;
}
}
}
int Rankwave::save (const char *path, Addsynth *D, float fsamp, float fbase, float *scale)
{
FILE *F;
Pipewave *P;
int i;
char name [1024];
char data [64];
char *p;
sprintf (name, "%s/%s", path, D->_filename);
if ((p = strrchr (name, '.'))) strcpy (p, ".ae1");
else strcat (name, ".ae1");
F = fopen (name, "wb");
if (F == NULL)
{
fprintf (stderr, "Can't open waveform file '%s' for writing\n", name);
return 1;
}
memset (data, 0, 16);
strcpy (data, "ae1");
data [4] = 1;
fwrite (data, 1, 16, F);
memset (data, 0, 64);
data [0] = 0;
data [1] = 0;
data [2] = 0;
data [3] = 0;
data [4] = _n0;
data [5] = _n1;
data [6] = 0;
data [7] = 0;
*((float *)(data + 8)) = fsamp;
*((float *)(data + 12)) = fbase;
memcpy (data + 16, scale, 12 * sizeof (float));
fwrite (data, 1, 64, F);
for (i = _n0, P = _pipes; i <= _n1; i++, P++) P->save (F);
fclose (F);
_modif = false;
return 0;
}
int Rankwave::load (const char *path, Addsynth *D, float fsamp, float fbase, float *scale)
{
FILE *F;
Pipewave *P;
int i;
char name [1024];
char data [64];
char *p;
float f;
sprintf (name, "%s/%s", path, D->_filename);
if ((p = strrchr (name, '.'))) strcpy (p, ".ae1");
else strcat (name, ".ae1");
F = fopen (name, "rb");
if (F == NULL)
{
#ifdef DEBUG
fprintf (stderr, "Can't open waveform file '%s' for reading\n", name);
#endif
return 1;
}
fread (data, 1, 16, F);
if (strcmp (data, "ae1"))
{
#ifdef DEBUG
fprintf (stderr, "File '%s' is not an Aeolus waveform file\n", name);
#endif
fclose (F);
return 1;
}
if (data [4] != 1)
{
#ifdef DEBUG
fprintf (stderr, "File '%s' has an incompatible version tag (%d)\n", name, data [4]);
#endif
fclose (F);
return 1;
}
fread (data, 1, 64, F);
if (_n0 != data [4] || _n1 != data [5])
{
#ifdef DEBUG
fprintf (stderr, "File '%s' has an incompatible note range (%d %d), (%d %d)\n", name, _n0, _n1, data [4], data [5]);
#endif
fclose (F);
return 1;
}
f = *((float *)(data + 8));
if (fabsf (f - fsamp) > 0.1f)
{
#ifdef DEBUG
fprintf (stderr, "File '%s' has a different sample frequency (%3.1lf)\n", name, f);
#endif
fclose (F);
return 1;
}
f = *((float *)(data + 12));
if (fabsf (f - fbase) > 0.1f)
{
#ifdef DEBUG
fprintf (stderr, "File '%s' has a different tuning (%3.1lf)\n", name, f);
#endif
fclose (F);
return 1;
}
for (i = 0; i < 12; i++)
{
f = *((float *)(data + 16 + 4 * i));
if (fabsf (f / scale [i] - 1.0f) > 6e-5f)
{
#ifdef DEBUG
fprintf (stderr, "File '%s' has a different temperament\n", name);
#endif
fclose (F);
return 1;
}
}
for (i = _n0, P = _pipes; i <= _n1; i++, P++) P->load (F);
fclose (F);
_modif = false;
return 0;
}

146
aeolus/aeolus/rankwave.h Normal file
View file

@ -0,0 +1,146 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __RANKWAVE_H
#define __RANKWAVE_H
#include "addsynth.h"
#include "rngen.h"
#define PERIOD 64
class Pipewave
{
private:
Pipewave (void) :
_p0 (0), _p1 (0), _p2 (0), _l1 (0), _k_s (0), _k_r (0), _m_r (0),
_link (0), _sbit (0), _sdel (0),
_p_p (0), _y_p (0), _z_p (0), _p_r (0), _y_r (0), _g_r (0), _i_r (0)
{}
~Pipewave (void) { delete[] _p0; }
friend class Rankwave;
void genwave (Addsynth *D, int n, float fsamp, float fpipe);
void save (FILE *F);
void load (FILE *F);
void play (void);
static void looplen (float f, float fsamp, int lmax, int *aa, int *bb);
static void attgain (int n, float p);
float *_p0; // attack start
float *_p1; // loop start
float *_p2; // loop end
int32_t _l0; // attack length
int32_t _l1; // loop length
int16_t _k_s; // sample step
int16_t _k_r; // release lenght
float _m_r; // release multiplier
float _d_r; // release detune
float _d_p; // instability
Pipewave *_link; // link to next in active chain
uint32_t _sbit; // on state bit
uint32_t _sdel; // delayed state
float *_out; // audio output buffer
float *_p_p; // play pointer
float _y_p; // play interpolation
float _z_p; // play interpolation speed
float *_p_r; // release pointer
float _y_r; // release interpolation
float _g_r; // release gain
int16_t _i_r; // release count
static void initstatic (float fsamp);
static Rngen _rgen;
static float *_arg;
static float *_att;
};
class Rankwave
{
public:
Rankwave (int n0, int n1);
~Rankwave (void);
void note_on (int n)
{
if ((n < _n0) || (n > _n1)) return;
Pipewave *P = _pipes + (n - _n0);
P->_sbit = _sbit;
if (! (P->_sdel || P->_p_p || P->_p_r))
{
P->_sdel |= _sbit;
P->_link = _list;
_list = P;
}
}
void note_off (int n)
{
if ((n < _n0) || (n > _n1)) return;
Pipewave *P = _pipes + (n - _n0);
P->_sdel >>= 4;
P->_sbit = 0;
}
void all_off (void)
{
Pipewave *P;
for (P = _list; P; P = P->_link) P->_sbit = 0;
}
int n0 (void) const { return _n0; }
int n1 (void) const { return _n1; }
void play (int shift);
void set_param (float *out, int del, int pan);
void gen_waves (Addsynth *D, float fsamp, float fbase, float *scale);
int save (const char *path, Addsynth *D, float fsamp, float fbase, float *scale);
int load (const char *path, Addsynth *D, float fsamp, float fbase, float *scale);
bool modif (void) const { return _modif; }
int _cmask; // used by division logic
int _nmask; // used by division logic
private:
Rankwave (const Rankwave&);
Rankwave& operator=(const Rankwave&);
int _n0;
int _n1;
uint32_t _sbit;
Pipewave *_list;
Pipewave *_pipes;
bool _modif;
};
#endif

226
aeolus/aeolus/reverb.cpp Normal file
View file

@ -0,0 +1,226 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "reverb.h"
void Delelm::init (int size, float fb)
{
_size = size;
_line = new float[size];
memset(_line, 0, size * sizeof (float));
_i = 0;
_fb = fb;
_slo = 0;
_shi = 0;
}
void Delelm::fini ()
{
delete[] _line;
}
void Delelm::set_t60mf (float tmf)
{
_gmf = powf (0.001f, _size / tmf);
}
void Delelm::set_t60lo (float tlo, float wlo)
{
_glo = powf (0.001f, _size / tlo) / _gmf - 1.0f;
_wlo = wlo;
}
void Delelm::set_t60hi (float thi, float chi)
{
float g = powf (0.001f, _size / thi) / _gmf;
float t = (1 - g * g) / (2 * g * g * chi);
_whi = (sqrt (1 + 4 * t) - 1) / (2 * t);
}
float Delelm::process(float x)
{
float t = _line [_i] * _gmf;
_slo += _wlo * (t - _slo);
t += _glo * _slo;
_shi += _whi * (t - _shi);
t = x - _fb * _shi + 1e-10;
_line [_i] = t;
if (++_i == _size)
_i = 0;
return _shi + _fb * t;
}
void Delelm::print()
{
printf ("%5d %6.3lf %5.3lf %5.3lf %6.4lf %6.4lf\n",
_size, _fb, _glo, _gmf, _wlo, _whi);
}
int Reverb::_sizes [16] =
{
839, 6732 - 839,
1181, 7339 - 1181,
1229, 8009 - 1229,
2477, 8731 - 2477,
2731, 9521 - 2731,
1361, 10381 - 1361,
3203, 11321 - 3203,
1949, 12347 - 1949
};
float Reverb::_feedb [16] =
{
-0.6f, 0.1f,
0.6f, 0.1f,
0.6f, 0.1f,
-0.6f, 0.1f,
0.6f, 0.1f,
-0.6f, 0.1f,
-0.6f, 0.1f,
0.6f, 0.1f
};
void Reverb::init(float rate)
{
_rate = rate;
_size = (int)(0.15f * rate);
_line = new float [_size];
memset (_line, 0, _size * sizeof (float));
_i = 0;
int m = (rate < 64e3) ? 1 : 2;
for (int i = 0; i < 16; i++)
_delm [i].init (m * _sizes [i], _feedb [i]);
_x0 = _x1 = _x2 = _x3 = _x4 = _x5 = _x6 = _x7 = _z = 0;
set_delay (0.05);
set_t60mf (4.0f);
set_t60lo (5.0f, 250.0f);
set_t60hi (2.0f, 4e3f);
}
void Reverb::fini()
{
delete[] _line;
for (int i = 0; i < 16; i++)
_delm [i].fini();
}
void Reverb::set_delay (float del)
{
if (del < 0.01f)
del = 0.01f;
_idel = (int)(_rate * del);
if (_idel > _size)
_idel = _size;
}
void Reverb::set_t60mf (float tmf)
{
_tmf = tmf;
float t = tmf * _rate;
for (int i = 0; i < 16; i++)
_delm [i].set_t60mf (t);
_gain = 1.0f / sqrtf (tmf);
}
void Reverb::set_t60lo (float tlo, float flo)
{
_tlo = tlo;
_flo = flo;
float t = tlo * _rate;
float w = 2 * M_PI * flo / _rate;
for (int i = 0; i < 16; i++)
_delm [i].set_t60lo (t, w);
}
void Reverb::set_t60hi(float thi, float fhi)
{
_thi = thi;
_fhi = fhi;
float t = thi * _rate;
float c = 1 - cosf (2 * M_PI * fhi / _rate);
for (int i = 0; i < 16; i++)
_delm [i].set_t60hi (t, c);
}
void Reverb::print()
{
for (int i = 0; i < 16; i++)
_delm [i].print ();
}
//---------------------------------------------------------
// process
//---------------------------------------------------------
void Reverb::process(int n, float gain, float* R, float *W, float *X, float *Y)
{
float g = sqrtf (0.125f);
gain *= _gain;
while (n--) {
int j = _i - _idel;
if (j < 0)
j += _size;
float x = _line [j];
_z += 0.6f * (*R++ - _z) + 1e-10f;
_line[_i] = _z;
if (++_i == _size)
_i = 0;
_x0 = _delm [0].process (g * _x0 + x);
_x1 = _delm [2].process (g * _x1 + x);
_x2 = _delm [4].process (g * _x2 + x);
_x3 = _delm [6].process (g * _x3 + x);
_x4 = _delm [8].process (g * _x4 + x);
_x5 = _delm [10].process (g * _x5 + x);
_x6 = _delm [12].process (g * _x6 + x);
_x7 = _delm [14].process (g * _x7 + x);
float t;
t = _x0 - _x1; _x0 += _x1; _x1 = t;
t = _x2 - _x3; _x2 += _x3; _x3 = t;
t = _x4 - _x5; _x4 += _x5; _x5 = t;
t = _x6 - _x7; _x6 += _x7; _x7 = t;
t = _x0 - _x2; _x0 += _x2; _x2 = t;
t = _x1 - _x3; _x1 += _x3; _x3 = t;
t = _x4 - _x6; _x4 += _x6; _x6 = t;
t = _x5 - _x7; _x5 += _x7; _x7 = t;
t = _x0 - _x4; _x0 += _x4; _x4 = t;
t = _x1 - _x5; _x1 += _x5; _x5 = t;
t = _x2 - _x6; _x2 += _x6; _x6 = t;
t = _x3 - _x7; _x3 += _x7; _x7 = t;
*W++ += 1.25f * gain * _x0;
*X++ += gain * (_x1 - 0.05f * _x2);
*Y++ += gain * _x2;
_x0 = _delm [1].process (_x0);
_x1 = _delm [3].process (_x1);
_x2 = _delm [5].process (_x2);
_x3 = _delm [7].process (_x3);
_x4 = _delm [9].process (_x4);
_x5 = _delm [11].process (_x5);
_x6 = _delm [13].process (_x6);
_x7 = _delm [15].process (_x7);
}
}

89
aeolus/aeolus/reverb.h Normal file
View file

@ -0,0 +1,89 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __REVERB_H
#define __REVERB_H
//---------------------------------------------------------
// Delelm
//---------------------------------------------------------
class Delelm
{
friend class Reverb;
void init(int size, float fb);
void fini();
void set_t60mf(float tmf);
void set_t60lo(float tlo, float _wlo);
void set_t60hi(float thi, float chi);
void print();
float process(float x);
int _i;
int _size;
float *_line;
float _fb;
float _gmf;
float _glo;
float _wlo;
float _whi;
float _slo;
float _shi;
};
//---------------------------------------------------------
// Reverb
//---------------------------------------------------------
class Reverb
{
void print();
float *_line;
int _size;
int _idel;
int _i;
Delelm _delm [16];
float _rate;
float _gain;
float _tmf;
float _tlo;
float _thi;
float _flo;
float _fhi;
float _x0, _x1, _x2, _x3, _x4, _x5, _x6, _x7;
float _z;
static int _sizes[16];
static float _feedb[16];
public:
void init(float rate);
void fini();
void process(int n, float gain, float *R, float *W, float *X, float *Y);
void set_delay(float del);
void set_t60mf(float tmf);
void set_t60lo(float tlo, float flo);
void set_t60hi(float thi, float fhi);
};
#endif

150
aeolus/aeolus/rngen.cpp Normal file
View file

@ -0,0 +1,150 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <time.h>
#include "rngen.h"
const double Rngen::_p31 = 2147483648.0;
const double Rngen::_p32 = 4294967296.0;
const float Rngen::_p31f = 2147483648.0f;
const float Rngen::_p32f = 4294967296.0f;
Rngen::Rngen (void)
{
init (0);
}
Rngen::~Rngen (void)
{
}
void Rngen::init (uint32_t s)
{
int i, j;
Prbsgen G;
if (s == 0) s = time (0);
G.set_poly (Prbsgen::G32);
G.set_stat (s);
for (i = 0; i < 55; i++)
{
G.step ();
j = G.stat () & 4095;
while (j--) G.step ();
_a [i] = G.stat ();
}
_i = 0;
_md = false;
_mf = false;
}
double Rngen::grand (void)
{
double a, b, r;
if (_md)
{
_md = false;
return _vd;
}
do
{
a = irand () / _p31 - 1.0;
b = irand () / _p31 - 1.0;
r = a * a + b * b;
}
while ((r > 1.0) || (r < 1e-20));
r = sqrt (-2.0 * log (r) / r);
_md = true;
_vd = r * b;
return r * a;
}
void Rngen::grand (double *x, double *y)
{
double a, b, r;
do
{
a = irand () / _p31 - 1.0;
b = irand () / _p31 - 1.0;
r = a * a + b * b;
}
while ((r > 1.0) || (r < 1e-20));
r = sqrt (-log (r) / r);
*x = r * a;
*y = r * b;
}
float Rngen::grandf (void)
{
float a, b, r;
if (_mf)
{
_mf = false;
return _vf;
}
do
{
a = irand () / _p31f - 1.0f;
b = irand () / _p31f - 1.0f;
r = a * a + b * b;
}
while ((r > 1.0f) || (r < 1e-20f));
r = sqrtf (-2.0f * logf (r) / r);
_mf = true;
_vf = r * b;
return r * a;
}
void Rngen::grandf (float *x, float *y)
{
float a, b, r;
do
{
a = irand () / _p31f - 1.0f;
b = irand () / _p31f - 1.0f;
r = a * a + b * b;
}
while ((r > 1.0f) || (r < 1e-20f));
r = sqrtf (-logf (r) / r);
*x = r * a;
*y = r * b;
}

72
aeolus/aeolus/rngen.h Normal file
View file

@ -0,0 +1,72 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __RNGEN_H
#define __RNGEN_H
#include "prbsgen.h"
class Rngen
{
public:
Rngen (void);
void init (uint32_t seed);
uint32_t irand (void)
{
uint32_t r;
if (++_i == 55) _i = 0;
if (_i < 24) r = _a [_i] += _a [_i + 31];
else r = _a [_i] += _a [_i - 24];
return r;
}
double urand (void) { return irand () / _p32; }
double grand (void);
void grand (double *x, double *y);
float urandf (void) { return irand () / _p32f; }
float grandf (void);
void grandf (float *x, float *y);
~Rngen (void);
Rngen (const Rngen&); // disabled, not to be used
Rngen& operator=(const Rngen&); // disabled, not to be used
private:
uint32_t _a [55];
int _i;
bool _md;
bool _mf;
double _vd;
float _vf;
static const double _p31;
static const double _p32;
static const float _p31f;
static const float _p32f;
};
#endif

244
aeolus/aeolus/scales.cpp Normal file
View file

@ -0,0 +1,244 @@
/*
Copyright (C) 2003-2010 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "scales.h"
// Pythagorean
static float scale_pythagorean [12] = {
1.00000000,
1.06787109,
1.12500000,
1.18518519,
1.26562500,
1.33333333,
1.42382812,
1.50000000,
1.60180664,
1.68750000,
1.77777778,
1.89843750,
};
// 1/4 comma meantone (Pietro Aaron, 1523)
static float scale_meanquart [12] = {
1.0000000,
1.0449067,
1.1180340,
1.1962790,
1.2500000,
1.3374806,
1.3975425,
1.4953488,
1.5625000,
1.6718508,
1.7888544,
1.8691860
};
// Andreas Werckmeister III, 1681
static float scale_werckm3 [12] = {
1.00000000,
1.05349794,
1.11740331,
1.18518519,
1.25282725,
1.33333333,
1.40466392,
1.49492696,
1.58024691,
1.67043633,
1.77777778,
1.87924088
};
// Kirnberger III
static float scale_kirnberg3 [12] = {
1.00000000,
1.05349794,
1.11848107,
1.18518519,
1.25000021,
1.33333333,
1.40625000,
1.49542183,
1.58024691,
1.67176840,
1.77777778,
1.87500000
};
// Well-tempered (Jacob Breetvelt)
static float scale_welltemp [12] =
{
1.00000000,
1.05468828,
1.12246205,
1.18652432,
1.25282725,
1.33483985,
1.40606829,
1.49830708,
1.58203242,
1.67705161,
1.77978647,
1.87711994
};
// Equally Tempered
static float scale_equaltemp [12] =
{
1.00000000,
1.05946309,
1.12246205,
1.18920712,
1.25992105,
1.33483985,
1.41421356,
1.49830708,
1.58740105,
1.68179283,
1.78179744,
1.88774863,
};
// The following five were contributed by Hanno Hoffstadt.
// The Lehman temperament was also provided by Adam Sampson.
// Vogel/Ahrend
static float scale_ahrend [12] =
{
1.00000000,
1.05064661,
1.11891853,
1.18518519,
1.25197868,
1.33695184,
1.40086215,
1.49594019,
1.57596992,
1.67383521,
1.78260246,
1.87288523,
};
// Vallotti
static float scale_vallotti [12] =
{
1.00000000,
1.05647631,
1.12035146,
1.18808855,
1.25518740,
1.33609659,
1.40890022,
1.49689777,
1.58441623,
1.67705160,
1.78179744,
1.87888722,
};
// Kellner
static float scale_kellner [12] =
{
1.00000000,
1.05349794,
1.11891853,
1.18518519,
1.25197868,
1.33333333,
1.40466392,
1.49594019,
1.58024691,
1.67383521,
1.77777778,
1.87796802,
};
// Lehman
static float scale_lehman [12] =
{
1.00000000,
1.05826737,
1.11992982,
1.18786496,
1.25424281,
1.33634808,
1.41102316,
1.49661606,
1.58560949,
1.67610496,
1.77978647,
1.88136421,
};
// Pythagorean
static float scale_pure_cfg [12] =
{
1.00000000,
1.04166667,
1.12500000,
1.1892,
1.25000000,
1.33333333,
1.40625000,
1.50000000,
1.5874,
1.66666667,
1.77777778,
1.87500000,
};
struct temper scales [NSCALES] =
{
{ "Pythagorean", "pyt", scale_pythagorean },
{ "Meantone 1/4", "mtq", scale_meanquart },
{ "Werckmeister III", "we3", scale_werckm3 },
{ "Kirnberger III", "ki3", scale_kirnberg3 },
{ "Well Tempered", "wt", scale_welltemp },
{ "Equally Tempered", "et", scale_equaltemp },
{ "Vogel/Ahrend", "ahr", scale_ahrend },
{ "Vallotti", "val", scale_vallotti },
{ "Kellner", "kel", scale_kellner },
{ "Lehman", "leh", scale_lehman },
{ "Pure C/F/G", "cfg", scale_pure_cfg },
};

37
aeolus/aeolus/scales.h Normal file
View file

@ -0,0 +1,37 @@
/*
Copyright (C) 2003-2010 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SCALES_H
#define __SCALES_H
struct temper
{
const char *_label;
const char *_mnemo;
float *_data;
};
#define NSCALES 11
extern struct temper scales [NSCALES];
#endif

View file

@ -0,0 +1,154 @@
# Aeolus instrument definition file
# Created by Aeolus-0.6.6 at Sat May 13 01:44:55 2006
/instr/new
/tuning 440.0 1
# Keyboards
#
/manual/new III
/manual/new II
/manual/new I
/pedal/new P
# Divisions
#
/divis/new III 1 1
/rank C 17 III_principal_8.ae0
/rank W 20 gemshorn8.ae0
/rank R 17 quintadena.ae0
/rank L 26 suabile.ae0
/rank R 21 rohrflute4.ae0
/rank R 30 III_flautodolce4.ae0
/rank C 20 quintflute.ae0
/rank L 31 superoctave2.ae0
/rank R 23 sifflet1.ae0
/rank L 13 III_cymbel.ae0
/rank R 27 new_oboe_fa.ae0
/swell
/tremul 4.0 0.4
/divis/end
/divis/new II 2 2
/rank L 23 rohrflute8.ae0
/rank C 21 harmflute8.ae0
/rank R 19 II_flautodolce4.ae0
/rank C 25 nasard.ae0
/rank L 23 ottavina2.ae0
/rank R 24 tertia.ae0
/rank L 26 sesqualtera.ae0
/rank R 30 septime.ae0
/rank R 22 none.ae0
/rank W 24 cromhorne.ae0
/rank L 18 I_melodia.ae0
/swell
/tremul 5.0 0.3
/divis/end
/divis/new I 3 3
/rank C 10 I_principal_8.ae0
/rank R 14 I_principal_4.ae0
/rank L 16 I_octave_2.ae0
/rank R 19 I_octave_1.ae0
/rank C 21 I_quinte_513.ae0
/rank R 19 I_quinte_223.ae0
/rank L 22 tibia8.ae0
/rank C 13 celesta.ae0
/rank C 5 flute8.ae0
/rank R 8 flute4.ae0
/rank R 10 flute2.ae0
/rank C 4 I_cymbel.ae0
/rank L 18 I_mixtur5fach.ae0
/rank W 0 I_trumpet.ae0
/divis/end
/divis/new P 4 4
/rank C 20 bourdon16.ae0
/rank C 28 P_principal_16.ae0
/rank R 17 P_principal_8.ae0
/rank C 21 P_principal_4.ae0
/rank L 10 P_octave_2.ae0
/rank R 15 P_octave_1.ae0
/rank L 22 P_quinte_513.ae0
/rank R 26 P_quinte_223.ae0
/rank C 18 P_mixtur5fach.ae0
/rank C 30 bassoon.ae0
/rank W 10 trombone.ae0
/rank W 15 bombarde.ae0
/rank L 5 P_trumpet.ae0
/divis/end
# Interface groups
#
/group/new III
/stop 0 1 1
/stop 0 1 2
/stop 0 1 3
/stop 0 1 4
/stop 0 1 5
/stop 0 1 6
/stop 0 1 7
/stop 0 1 8
/stop 0 1 9
/stop 0 1 10
/stop 0 1 11
/tremul 1 TR Tremulant
/group/end
/group/new II
/stop 0 2 1
/stop 0 2 2
/stop 0 2 3
/stop 0 2 4
/stop 0 2 5
/stop 0 2 6
/stop 0 2 7
/stop 0 2 8
/stop 0 2 9
/stop 0 2 10
/stop 0 2 11
/tremul 2 TR Tremulant
/coupler 2 1 C2+3 II+III
/group/end
/group/new I
/stop 0 3 1
/stop 0 3 2
/stop 0 3 3
/stop 0 3 4
/stop 0 3 5
/stop 0 3 6
/stop 0 3 7
/stop 0 3 8
/stop 0 3 9
/stop 0 3 10
/stop 0 3 11
/stop 0 3 12
/stop 0 3 13
/stop 0 3 14
/coupler 3 2 C1+2 I+II
/coupler 3 1 C1+3 I+III
/group/end
/group/new P
/stop 0 4 1
/stop 0 4 2
/stop 0 4 3
/stop 0 4 4
/stop 0 4 5
/stop 0 4 6
/stop 0 4 7
/stop 0 4 8
/stop 0 4 9
/stop 0 4 10
/stop 0 4 11
/stop 0 4 12
/stop 0 4 13
/coupler 4 3 CP+1 P+I
/coupler 4 2 CP+2 P+II
/coupler 4 1 CP+3 P+III
/group/end
/instr/end

BIN
aeolus/stops/Aeolus/presets Normal file

Binary file not shown.

View file

@ -0,0 +1,159 @@
# Aeolus instrument definition file
# Created by Aeolus-0.6.6 at Sat May 13 01:19:46 2006
/instr/new
/tuning 440.0 1
# Keyboards
#
/manual/new III
/manual/new II
/manual/new I
/pedal/new P
# Divisions
#
/divis/new IV 0 1
/rank W 0 I_trumpet.ae0
/rank R 27 new_oboe_fa.ae0
/rank W 24 cromhorne.ae0
/swell
/divis/end
/divis/new III 1 2
/rank C 17 III_principal_8.ae0
/rank W 20 gemshorn8.ae0
/rank R 17 quintadena.ae0
/rank L 26 suabile.ae0
/rank R 21 rohrflute4.ae0
/rank R 30 III_flautodolce4.ae0
/rank C 20 quintflute.ae0
/rank L 31 superoctave2.ae0
/rank R 23 sifflet1.ae0
/rank L 13 III_cymbel.ae0
/swell
/tremul 4.0 0.4
/divis/end
/divis/new II 2 3
/rank L 23 rohrflute8.ae0
/rank C 21 harmflute8.ae0
/rank R 19 II_flautodolce4.ae0
/rank C 25 nasard.ae0
/rank L 23 ottavina2.ae0
/rank R 24 tertia.ae0
/rank L 26 sesqualtera.ae0
/rank R 30 septime.ae0
/rank R 22 none.ae0
/swell
/tremul 5.0 0.3
/divis/end
/divis/new I 3 4
/rank C 10 I_principal_8.ae0
/rank R 14 I_principal_4.ae0
/rank L 16 I_octave_2.ae0
/rank R 19 I_octave_1.ae0
/rank C 21 I_quinte_513.ae0
/rank R 19 I_quinte_223.ae0
/rank L 22 tibia8.ae0
/rank C 13 celesta.ae0
/rank C 5 flute8.ae0
/rank R 8 flute4.ae0
/rank R 10 flute2.ae0
/rank C 4 I_cymbel.ae0
/rank L 18 I_mixtur5fach.ae0
/divis/end
/divis/new P 4 4
/rank C 20 bourdon16.ae0
/rank C 28 P_principal_16.ae0
/rank R 17 P_principal_8.ae0
/rank C 21 P_principal_4.ae0
/rank L 10 P_octave_2.ae0
/rank R 15 P_octave_1.ae0
/rank L 22 P_quinte_513.ae0
/rank R 26 P_quinte_223.ae0
/rank C 18 P_mixtur5fach.ae0
/rank C 30 bassoon.ae0
/rank W 10 trombone.ae0
/rank W 15 bombarde.ae0
/rank L 5 P_trumpet.ae0
/divis/end
# Interface groups
#
/group/new III
/stop 0 2 1
/stop 0 2 2
/stop 0 2 3
/stop 0 2 4
/stop 0 2 5
/stop 0 2 6
/stop 0 2 7
/stop 0 2 8
/stop 0 2 9
/stop 0 2 10
/stop 1 1 1
/stop 1 1 2
/stop 1 1 3
/tremul 2 TR Tremulant
/group/end
/group/new II
/stop 0 3 1
/stop 0 3 2
/stop 0 3 3
/stop 0 3 4
/stop 0 3 5
/stop 0 3 6
/stop 0 3 7
/stop 0 3 8
/stop 0 3 9
/tremul 3 TR Tremulant
/coupler 2 2 C2+3 II+III
/group/end
/group/new I
/stop 0 4 1
/stop 0 4 2
/stop 0 4 3
/stop 0 4 4
/stop 0 4 5
/stop 0 4 6
/stop 0 4 7
/stop 0 4 8
/stop 0 4 9
/stop 0 4 10
/stop 0 4 11
/stop 0 4 12
/stop 0 4 13
/stop 3 1 1
/stop 3 1 2
/stop 3 1 3
/coupler 3 3 C1+2 I+II
/coupler 3 2 C1+3 I+III
/group/end
/group/new P
/stop 0 5 1
/stop 0 5 2
/stop 0 5 3
/stop 0 5 4
/stop 0 5 5
/stop 0 5 6
/stop 0 5 7
/stop 0 5 8
/stop 0 5 9
/stop 0 5 10
/stop 0 5 11
/stop 0 5 12
/stop 0 5 13
/coupler 4 4 CP+1 P+I
/coupler 4 3 CP+2 P+II
/coupler 4 2 CP+3 P+III
/group/end
/instr/end

Binary file not shown.

View file

@ -0,0 +1,160 @@
# Aeolus instrument definition file
# Created by Aeolus-0.6.5 at Sat Apr 15 23:59:11 2006
/instr/new
/tuning 440.0 1
# Keyboards
#
/manual/new III
/manual/new II
/manual/new I
/pedal/new P
# Divisions
#
/divis/new Swell 0 1
/rank C 17 III_principal_8.ae0
/rank W 20 gemshorn8.ae0
/rank R 17 quintadena.ae0
/rank L 26 suabile.ae0
/rank R 21 rohrflute4.ae0
/rank R 30 III_flautodolce4.ae0
/rank C 20 quintflute.ae0
/rank L 31 superoctave2.ae0
/rank R 23 sifflet1.ae0
/rank L 13 III_cymbel.ae0
/rank R 27 new_oboe_fa.ae0
/rank L 18 I_melodia.ae0
/swell
/tremul 4.0 0.4
/divis/end
/divis/new Choir 0 3
/rank L 23 rohrflute8.ae0
/rank C 21 harmflute8.ae0
/rank R 19 II_flautodolce4.ae0
/rank C 25 nasard.ae0
/rank L 23 ottavina2.ae0
/rank R 24 tertia.ae0
/rank L 26 sesqualtera.ae0
/rank R 30 septime.ae0
/rank R 22 none.ae0
/rank W 24 cromhorne.ae0
/swell
/tremul 5.0 0.3
/divis/end
/divis/new Great 0 2
/rank C 10 I_principal_8.ae0
/rank R 14 I_principal_4.ae0
/rank L 16 I_octave_2.ae0
/rank R 19 I_octave_1.ae0
/rank C 21 I_quinte_513.ae0
/rank R 19 I_quinte_223.ae0
/rank L 22 tibia8.ae0
/rank C 13 celesta.ae0
/rank C 5 flute8.ae0
/rank R 8 flute4.ae0
/rank R 10 flute2.ae0
/rank C 4 I_cymbel.ae0
/rank L 18 I_mixtur5fach.ae0
/rank W 0 I_trumpet.ae0
/divis/end
/divis/new Pedal 4 4
/rank C 20 bourdon16.ae0
/rank C 28 P_principal_16.ae0
/rank R 17 P_principal_8.ae0
/rank C 21 P_principal_4.ae0
/rank L 10 P_octave_2.ae0
/rank R 15 P_octave_1.ae0
/rank L 22 P_quinte_513.ae0
/rank R 26 P_quinte_223.ae0
/rank C 18 P_mixtur5fach.ae0
/rank C 30 bassoon.ae0
/rank W 10 trombone.ae0
/rank W 15 bombarde.ae0
/rank L 5 P_trumpet.ae0
/divis/end
# Interface groups
#
/group/new Swell
/coupler 4 1 CP>3 P
/coupler 3 1 C1>3 I
/coupler 2 1 C2>3 II
/coupler 1 1 C3>3 III
/stop 0 1 1
/stop 0 1 2
/stop 0 1 3
/stop 0 1 4
/stop 0 1 5
/stop 0 1 6
/stop 0 1 7
/stop 0 1 8
/stop 0 1 9
/stop 0 1 10
/stop 0 1 11
/stop 0 1 12
/tremul 1 TR Tremulant
/group/end
/group/new Great
/coupler 4 3 CP>2 P
/coupler 3 3 C1>2 I
/coupler 2 3 C2>2 II
/coupler 1 3 C3>2 III
/stop 0 3 1
/stop 0 3 2
/stop 0 3 3
/stop 0 3 4
/stop 0 3 5
/stop 0 3 6
/stop 0 3 7
/stop 0 3 8
/stop 0 3 9
/stop 0 3 10
/stop 0 3 11
/stop 0 3 12
/stop 0 3 13
/stop 0 3 14
/group/end
/group/new Choir
/coupler 4 2 CP>3 P
/coupler 3 2 C1>3 I
/coupler 2 2 C2>3 II
/coupler 1 2 C3>3 III
/stop 0 2 1
/stop 0 2 2
/stop 0 2 3
/stop 0 2 4
/stop 0 2 5
/stop 0 2 6
/stop 0 2 7
/stop 0 2 8
/stop 0 2 9
/stop 0 2 10
/tremul 2 TR Tremulant
/group/end
/group/new Pedal
/stop 0 4 1
/stop 0 4 2
/stop 0 4 3
/stop 0 4 4
/stop 0 4 5
/stop 0 4 6
/stop 0 4 7
/stop 0 4 8
/stop 0 4 9
/stop 0 4 10
/stop 0 4 11
/stop 0 4 12
/stop 0 4 13
/group/end
/instr/end

Binary file not shown.

BIN
aeolus/stops/III_cymbel.ae0 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/I_cymbel.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/I_melodia.ae0 Normal file

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/I_octave_1.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/I_octave_2.ae0 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/I_trumpet.ae0 Normal file

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/P_octave_1.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/P_octave_2.ae0 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/P_trumpet.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/bassoon.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/bombarde.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/bourdon16.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/celesta.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/cromhorne.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/flute2.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/flute4.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/flute8.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/gemshorn8.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/harmflute8.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/nasard.ae0 Normal file

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/none.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/ottavina2.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/quintadena.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/quintflute.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/rohrflute4.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/rohrflute8.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/septime.ae0 Normal file

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/sifflet1.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/suabile.ae0 Normal file

Binary file not shown.

Binary file not shown.

BIN
aeolus/stops/tertia.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/tibia8.ae0 Normal file

Binary file not shown.

BIN
aeolus/stops/trombone.ae0 Normal file

Binary file not shown.

168
all.h Normal file
View file

@ -0,0 +1,168 @@
//=============================================================================
// MusE
// Linux Music Score Editor
// $Id: allqt.h,v 1.24 2006/03/02 17:08:30 wschweer Exp $
//
// Copyright (C) 2004-2011 Werner Schweer (ws@seh.de)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
#ifndef __ALLQT_H__
#define __ALLQT_H__
#include <stdio.h>
#include <limits.h>
#include <map>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <math.h>
#include <QtGui/QtGui>
#include <QtGui/QItemDelegate>
#include <QtCore/QModelIndex>
#include <QtGui/QStandardItemModel>
#include <QtGui/QSpinBox>
#include <QtGui/QFormLayout>
#include <QtGui/QDateTimeEdit>
#include <QtGui/QInputDialog>
#include <QtWebKit/QWebView>
#include <QtWebKit/QWebFrame>
#include <QtXml/QtXml>
#include <QtXmlPatterns/QXmlSchema>
#include <QtXmlPatterns/QXmlSchemaValidator>
#ifdef Q_WS_X11
#include <QtGui/QX11Info>
#endif
#include <QtCore/QPointF>
#include <QtCore/QVariant>
#include <QtCore/QMap>
#include <QtCore/QDateTime>
#include <QtCore/QtGlobal>
#include <QtCore/QtDebug>
#include <QtCore/QSharedData>
#if QT_VERSION >= 0x040400
#include <QtCore/QAtomicInt>
#endif
#if QT_VERSION >= 0x040700
#include <QtGui/QStaticText>
#endif
// #include <QtGui/QGlyphRun>
#include <QtGui/QPainterPath>
#include <QtGui/QScrollArea>
#include <QtGui/QScrollBar>
#include <QtGui/QToolBar>
#include <QtGui/QWhatsThis>
#include <QtGui/QBitmap>
#include <QtGui/QPixmap>
#include <QtGui/QDockWidget>
#include <QtGui/QStackedWidget>
#include <QtGui/QStackedLayout>
#include <QtGui/QListWidget>
#include <QtGui/QTreeWidget>
#include <QtGui/QMessageBox>
#include <QtGui/QPrinter>
#include <QtGui/QPainter>
#include <QtGui/QComboBox>
#include <QtGui/QAction>
#include <QtGui/QActionGroup>
#include <QtGui/QLayout>
#include <QtGui/QBoxLayout>
#include <QtGui/QMainWindow>
#include <QtGui/QFileDialog>
#include <QtGui/QPrintDialog>
#include <QtGui/QColorDialog>
#include <QtGui/QKeyEvent>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QSplitter>
#include <QtGui/QItemDelegate>
#include <QtGui/QStandardItemModel>
#include <QtGui/QSpinBox>
#include <QtGui/QFontDatabase>
#include <QtGui/QFontComboBox>
#include <QtGui/QApplication>
#include <QtGui/QToolTip>
#include <QtCore/QProcess>
#include <QtGui/QDesktopServices>
#include <QtGui/QTextDocument>
#include <QtGui/QTextDocumentFragment>
#include <QtGui/QTextCursor>
#include <QtGui/QAbstractTextDocumentLayout>
#include <QtGui/QToolBox>
#include <QtGui/QToolButton>
#include <QtGui/QTextBlock>
#include <QtGui/QTextList>
#include <QtGui/QTextFrameFormat>
#include <QtGui/QClipboard>
#include <QtGui/QStatusBar>
#include <QtGui/QSplashScreen>
#include <QtGui/QPushButton>
#include <QtGui/QStylePainter>
#include <QtGui/QStyleOptionButton>
#include <QtGui/QStyleFactory>
#include <QtGui/QWizard>
#include <QtGui/QRadioButton>
#include <QtGui/QFileSystemModel>
#include <QtGui/QHeaderView>
#include <QtGui/QUndoGroup>
#include <QtGui/QUndoStack>
#include <QtGui/QProgressBar>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QCheckBox>
#include <QtGui/QGraphicsView>
#include <QtGui/QGraphicsScene>
#include <QtGui/QGraphicsRectItem>
#include <QtGui/QLabel>
#include <QtGui/QFocusFrame>
#include <QtGui/QMouseEventTransition>
#include <QtGui/QCommonStyle>
#include <QtGui/QLineEdit>
#include <QtGui/QGroupBox>
#include <QtGui/QDial>
#include <QtGui/QTextEdit>
#include <QtGui/QMdiSubWindow>
#include <QtGui/QSpacerItem>
#include <QtGui/QGraphicsSceneMouseEvent>
#include <QtSvg/QSvgRenderer>
#include <QtSvg/QSvgGenerator>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkCookieJar>
#include <QtNetwork/QHostAddress>
#include <QtNetwork/QUdpSocket>
#if QT_VERSION >= 0x040800
#include <QtNetwork/QHttpPart>
#include <QtNetwork/QHttpMultiPart>
#endif
#include <QtScript/QScriptEngine>
#include <QtScript/QScriptValueIterator>
#include <QtScript/QScriptable>
#include <QtScript/QScriptClass>
#include <QtScript/QScriptClassPropertyIterator>
#if QT_VERSION >= 0x040500
#include <QtScriptTools/QScriptEngineDebugger>
#endif
#endif

124
awl/CMakeLists.txt Normal file
View file

@ -0,0 +1,124 @@
#=============================================================================
# MusE
# Linux Music Editor
# $Id:$
#
# Copyright (C) 2002-2006 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=============================================================================
include (${PROJECT_SOURCE_DIR}/build/gch.cmake)
QT4_WRAP_CPP (mocs
aslider.h
knob.h
panknob.h
volknob.h
midipanknob.h
colorlabel.h
slider.h
volslider.h
mslider.h
pitchedit.h
pitchlabel.h
poslabel.h
denomspinbox.h
)
add_library (
awl STATIC
${PROJECT_BINARY_DIR}/all.h
${PCH}
${mocs}
aslider.cpp
knob.cpp
panknob.cpp
volknob.cpp
midipanknob.cpp
colorlabel.cpp
slider.cpp
volslider.cpp
mslider.cpp
pitchedit.cpp
pitchlabel.cpp
poslabel.cpp
# posedit.cpp
utils.cpp
denomspinbox.cpp
)
set_target_properties (
awl
PROPERTIES
COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all.h -g -Wall -Wextra -Winvalid-pch"
)
ADD_DEPENDENCIES(awl mops1)
ADD_DEPENDENCIES(awl mops2)
if (NOT MINGW AND NOT APPLE)
QT4_WRAP_CPP (mocs2
aslider.h
knob.h
panknob.h
volknob.h
midipanknob.h
awlplugin.h
colorlabel.h
slider.h
volslider.h
mslider.h
denomspinbox.h
pitchedit.h
pitchlabel.h
awlplugin.h
)
add_library (
awlplugin SHARED
${PROJECT_BINARY_DIR}/all.h
${mocs2}
awlplugin.cpp
aslider.cpp
knob.cpp
panknob.cpp
volknob.cpp
midipanknob.cpp
colorlabel.cpp
slider.cpp
volslider.cpp
mslider.cpp
denomspinbox.cpp
pitchedit.cpp
pitchlabel.cpp
utils.cpp
)
## "-D_GNU_SOURCE -D_REENTRANT -DHAVE_CONFIG_H -DQT_PLUGIN -DQT_SHARED -DQT_NO_DEBUG -include ${PROJECT_SOURCE_DIR}/all.h"
#
# we cannot use our precompiled headers because of -fPIC
#
set_target_properties(awlplugin
PROPERTIES
COMPILE_FLAGS
"-fPIC -D_GNU_SOURCE -D_REENTRANT -DHAVE_CONFIG_H -DQT_PLUGIN -DQT_SHARED -DQT_NO_DEBUG -include ${PROJECT_SOURCE_DIR}/all.h"
)
install( TARGETS awlplugin DESTINATION ${QT_PLUGINS_DIR}/designer/ )
#add_executable(ltest ltest.cpp)
#target_link_libraries (ltest awlplugin msynth al ${QT_LIBRARIES})
endif (NOT MINGW AND NOT APPLE)

248
awl/aslider.cpp Normal file
View file

@ -0,0 +1,248 @@
//=============================================================================
// Awl
// Audio Widget Library
// $Id:$
//
// Copyright (C) 2002-2006 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
#include "fastlog.h"
#include "aslider.h"
namespace Awl {
//---------------------------------------------------------
// AbstractSlider
//---------------------------------------------------------
AbstractSlider::AbstractSlider(QWidget* parent)
: QWidget(parent), _scaleColor(Qt::black), _scaleValueColor(Qt::blue)
{
_id = 0;
_value = 0.5;
_minValue = 0.0;
_maxValue = 1.0;
_lineStep = 0.1;
_pageStep = 0.2;
_center = false;
_invert = false;
_scaleWidth = 4;
_log = false;
setFocusPolicy(Qt::StrongFocus);
}
//---------------------------------------------------------
// setEnabled
//---------------------------------------------------------
void AbstractSlider::setEnabled(bool val)
{
QWidget::setEnabled(val);
update();
}
//---------------------------------------------------------
// setCenter
//! If the center flag is set, a notch is drawn to
//! show the center position.
//---------------------------------------------------------
void AbstractSlider::setCenter(bool val)
{
if (val != _center) {
_center = val;
update();
}
}
//!--------------------------------------------------------
// setScaleWidth
//---------------------------------------------------------
void AbstractSlider::setScaleWidth(int val)
{
if (val != _scaleWidth) {
_scaleWidth = val;
update();
}
}
//---------------------------------------------------------
// setScaleColor
//---------------------------------------------------------
void AbstractSlider::setScaleColor(const QColor& c)
{
if (c != _scaleColor) {
_scaleColor = c;
update();
}
}
//---------------------------------------------------------
// setScaleValueColor
//---------------------------------------------------------
void AbstractSlider::setScaleValueColor(const QColor& c)
{
if (c != _scaleValueColor) {
_scaleValueColor = c;
update();
}
}
//---------------------------------------------------------
// wheelEvent
//---------------------------------------------------------
void AbstractSlider::wheelEvent(QWheelEvent* ev)
{
int div = 50;
if (ev->modifiers() & Qt::ShiftModifier)
div = 15;
_value += (ev->delta() * lineStep()) / div;
if (_value < _minValue)
_value = _minValue;
else if (_value > _maxValue)
_value = _maxValue;
valueChange();
}
//---------------------------------------------------------
// keyPressEvent
//---------------------------------------------------------
void AbstractSlider::keyPressEvent(QKeyEvent* ev)
{
double oval = _value;
switch (ev->key()) {
case Qt::Key_Home: _value = _minValue; break;
case Qt::Key_End: _value = _maxValue; break;
case Qt::Key_Up:
case Qt::Key_Left: _value += lineStep(); break;
case Qt::Key_Down:
case Qt::Key_Right: _value -= lineStep(); break;
case Qt::Key_PageDown: _value -= pageStep(); break;
case Qt::Key_PageUp: _value += pageStep(); break;
default:
break;
}
if (_value < _minValue)
_value = _minValue;
else if (_value > _maxValue)
_value = _maxValue;
if (oval != _value)
valueChange();
}
//---------------------------------------------------------
// setValue
//---------------------------------------------------------
void AbstractSlider::setValue(double val)
{
if (_log) {
if (val == 0.0f)
_value = _minValue;
else {
_value = fast_log10(val) * 20.0f;
if (_value < _minValue)
_value = _minValue;
}
}
else
_value = val;
update();
}
//---------------------------------------------------------
// valueChange
//---------------------------------------------------------
void AbstractSlider::valueChange()
{
emit valueChanged(value(), _id);
update();
}
//---------------------------------------------------------
// value
//---------------------------------------------------------
double AbstractSlider::value() const
{
return _log ? pow(10.0, _value*0.05f) : _value;
}
//---------------------------------------------------------
// minLogValue
//---------------------------------------------------------
//double AbstractSlider::minValue() const {
// return _log ? pow(10.0, _minValue*0.05f) : _minValue;
//}
//---------------------------------------------------------
// setMinLogValue
//---------------------------------------------------------
void AbstractSlider::setMinLogValue(double val)
{
if (_log) {
if (val == 0.0f)
_minValue = -100;
else
_minValue = fast_log10(val) * 20.0f;
}
else
_minValue = val;
}
//---------------------------------------------------------
// maxLogValue
//---------------------------------------------------------
//double AbstractSlider::maxValue() const {
// return _log ? pow(10.0, _maxValue*0.05f) : _maxValue;
//}
//---------------------------------------------------------
// setMaxLogValue
//---------------------------------------------------------
void AbstractSlider::setMaxLogValue(double val)
{
if (_log) {
_maxValue = fast_log10(val) * 20.0f;
}
else
_maxValue = val;
}
//---------------------------------------------------------
// init
//---------------------------------------------------------
void AbstractSlider::init(const SyntiParameter& f)
{
_minValue = f.min();
_maxValue = f.max();
_value = f.fval();
_lineStep = (_maxValue - _minValue) * 0.1;
_pageStep = _lineStep * 2.0;
}
}

Some files were not shown because too many files have changed in this diff Show more