diff --git a/.gitignore b/.gitignore index a2dbb0f4..9e070367 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ -# The build output folder +# The build output folders build/ - -# Resources generated with docerator on OSX -resources/pictures/docicons/osx/MilkyTracker-*.icns -resources/pictures/docicons/osx/docerator/ +build-debug/ # Editor config files .vscode/ +.vs/ + +# Audio files +*.wav +*.wav.asd diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0a8b5266..00000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: cpp -git: - submodules: true -jobs: - include: - - os: linux - dist: bionic - addons: - apt: - packages: - - libjack-dev - - liblhasa-dev - - librtmidi-dev - - libsdl2-dev - - libzzip-dev - script: &cmake_build - - mkdir build - - pushd build - - cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 .. - - cmake --build . - - cpack - - popd - - os: osx - addons: - homebrew: - packages: - - xmlto - before_install: - - pushd resources/pictures/docicons/osx - - wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/docerator/docerator-2.0.zip - - unzip docerator-2.0.zip -d docerator - - rm docerator-2.0.zip - - "/usr/bin/python genicons.py" - - popd - script: *cmake_build -deploy: - provider: releases - token: $GITHUB_TOKEN - skip_cleanup: true - file_glob: true - file: build/milkytracker-* - on: - repo: milkytracker/MilkyTracker - tags: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bce5937..85d3e191 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,9 +22,9 @@ cmake_minimum_required(VERSION 3.10) project(MilkyTracker) -# Set C++ standard to C++98 -set(CMAKE_CXX_STANDARD 98) -set(CMAKE_CXX_EXTENSIONS OFF) +# Set C++ standard to C++11 +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_EXTENSIONS ON) # Enable IDE solution folders set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -52,8 +52,8 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # Version number in format X.YY.ZZ set(VER_X 1) -set(VER_YY 03) -set(VER_ZZ 00) +set(VER_YY 05) +set(VER_ZZ 01) set(VER_FULL "${VER_X}.${VER_YY}.${VER_ZZ}") # Generate version header from the above @@ -63,7 +63,9 @@ configure_file( ) # Packaging -if(APPLE) +option(BUILD_DMG "Build DMG package on macOS" ON) + +if(APPLE AND BUILD_DMG) set(CPACK_GENERATOR DragNDrop) set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME} ${VER_FULL}") set( @@ -89,17 +91,6 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FastTracker II compatible music tracker") include(CPack) if(APPLE) - # Warn if deployment target isn't set to Lion - if(NOT CMAKE_OSX_DEPLOYMENT_TARGET MATCHES "10.7") - message(WARNING - "Your deployment target is either unset or not set to \"10.7\", " - "which means that the binaries produced may not run on earlier " - "versions of macOS.\n" - "Please re-run CMake with '-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7' " - "or change the variable in the CMake GUI to target Lion and newer." - ) - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # Set variables for generating the Info.plist file @@ -166,10 +157,16 @@ elseif(WIN32) # Windows MIDI support requires no external libraries message(STATUS "Enabled MIDI support (WinMM)") add_subdirectory(src/midi) +elseif(HAIKU) + # Haiku MIDI support requires no external libraries + message(STATUS "Enabled MIDI support (Haiku)") + add_subdirectory(src/midi) else() # Workaround for SDL bug #3295, which occurs in SDL2 <2.0.5 # https://bugzilla.libsdl.org/show_bug.cgi?id=3295 - cmake_policy(SET CMP0004 OLD) + if(${CMAKE_VERSION} VERSION_LESS "4.0.0") + cmake_policy(SET CMP0004 OLD) + endif() find_package(SDL2 REQUIRED) endif() @@ -198,8 +195,9 @@ if(UNIX) # Linux MIDI support requires ALSA and RtMidi if(ALSA_FOUND) - find_package(RTMIDI 2.1.0) - if(RTMIDI_FOUND) + find_package(RTMIDI 2.1) # 2.1.0 and compatible versions + if(RTMIDI_FOUND) # https://github.com/milkytracker/MilkyTracker/issues/309 + set(CMAKE_CXX_STANDARD 11) # https://github.com/milkytracker/MilkyTracker/issues/262 message(STATUS "Enabled MIDI support (ALSA/RtMidi)") add_subdirectory(src/midi) else() @@ -208,6 +206,14 @@ if(UNIX) else() message("MIDI support disabled (ALSA unavailable)") endif() + + # Metainfo version and timestamp configuration, mandatory for flathub + string( TIMESTAMP METAINFO_DATE "%Y-%m-%d" UTC ) + configure_file( + ${PROJECT_SOURCE_DIR}/resources/org.milkytracker.MilkyTracker.metainfo.xml.in + ${PROJECT_BINARY_DIR}/resources/org.milkytracker.MilkyTracker.metainfo.xml + @ONLY + ) endif() endif() @@ -223,6 +229,7 @@ add_subdirectory(src/fx) add_subdirectory(src/milkyplay) add_subdirectory(src/ppui) add_subdirectory(src/tracker) +add_subdirectory(src/tools/milkycli) # Set MilkyTracker target as startup project in Visual Studio set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT tracker) diff --git a/ChangeLog.md b/ChangeLog.md index ab802bef..9b7671bb 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,46 @@ # MilkyTracker ChangeLog +## 30/11/2024 (v1.05): + +* sample-editor: synth-buttons are disabled on non-generated samples (https://github.com/milkytracker/MilkyTracker/issues/341#issuecomment-2138497797) +* documentation: updated with synth / sample-editor fx usage +* ui: cleanup ui interface (classic ui available via config > layout > classic UX) +* ui: removed onboarding text in listboxes (= help button now) +* pattern recording: handle row rounding for note-offs (thanks Guy Sviry) +* pattern recording: Control roundToClosestRow using new config flag (thanks Guy Sviry) +* pattern recording: Enable RecPosProvider roundToClosestRow (thanks Guy Sviry) +* ui scaling: nearest pixel-filtering can be enabled via SCALE_NEAREST=1 env-var +* sample-editor: better compand + defaults +* smaple-editor: added vocoder, saturator, milky exciter, delay, timestretch +* system: screensaver is no longer inhibited (thanks silvermantis7) +* system: initialise ticker to 0 (thanks psykose) +* MacOS: Detect Control key in addition to Command +* MacOS: Remove docicons and fix packaging +* repo: added nix shell definition +* system: [bugfix: hint windows to find std::getenv +* ui: added vu-meters from MilkyTrackerX + +## 05/07/2023 (v1.04): + +* [pattern-editor: stamp-like drag-drop selections](https://github.com/milkytracker/MilkyTracker/pull/277) +* [UX: responsive file dialog](https://github.com/milkytracker/MilkyTracker/pull/285) +* [copy/pasting sample now reflects relative note too](https://github.com/milkytracker/MilkyTracker/pull/290) +* [liveperformance: shortcuts for channel highlighting/muting ](https://github.com/milkytracker/MilkyTracker/pull/289) +* [linux: midi-in port selection](https://github.com/milkytracker/MilkyTracker/pull/289) +* [sample-editor: fadein, fadeout, loop fold](https://github.com/milkytracker/MilkyTracker/pull/299) +* [sample-editor: improved algo & UX of compressor](https://github.com/milkytracker/MilkyTracker/pull/300) +* [improved navigation milkytracker-keyboard](https://github.com/milkytracker/MilkyTracker/pull/288) +* UX: added CTA's in instrument editor for new users + +## Bugs fixed +* switch to C11 when compiling RTMIDI +* [ability to run in non-opengl mode again](https://github.com/milkytracker/MilkyTracker/pull/289) +* Fix uninitialized read in piano control (nyanpasu64 ❤) +* Fix About screen reading uninitialized memory (nyanpasu64 ❤) +* Fix uninitialized fields in PPListBox (nyanpasu64 ❤) +* Fix uninitialized fields in PatternEditorControl (nyanpasu64 ❤) +* fix wrong cwd when loading file from command line (mothcompute ❤) + ## 12/12/2020 (v1.03): ### What's new: diff --git a/INSTALL.md b/INSTALL.md index f5f3c127..3de1010c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -82,6 +82,9 @@ line. Step 2 varies depending on the target OS/build system. On Linux and macOS (when using GNU make): +The above steps can be accomplished by running `build.sh`. This will also +attempt to generate a release package appropriate to the current system. + ``` $ make ``` @@ -101,5 +104,25 @@ recommended way of obtaining these is by using Homebrew or MacPorts. - libtool - xmlto -The correct way to build a release .DMG for macOS, including -special document icons, is to run the `build_macos.sh` script. +The correct way to build a release .DMG for macOS is to run the `build.sh` +script. + +## Rebuilding internal documentation + default addons file + +The following scripts (rarely) need to be run when one of these file changes: + +* `doc/Milkytracker.html` needs `src/tool/generateHelp.sh` (to generate `src/tracker/DialogHelpText.h`) +* `src/tools/addons.txt` needs `src/tool/generateAddons.sh` (to generate `src/tracker/Addons.h`) + +> NOTE: don't update `doc/Milkytracker.html`, instead update/mirror https://github.com/milkytracker/manual + +## Environment flags + +| env var | info | +|---------------|----------------------------------------------| +| NO_SCALE=1 | disabling resizing/scaling UI | +| SCALE_NEAREST | sharper pixels (default linear filtering is more blurry) for resizing window| +| MIDI_IN=2 | select MIDI port 2 (default=0) for midi input (requires portmidi compiled)| +| HOME | directory for home-button in filebrowser | +| NO_OPENGL | disable hardware acceleration (embedded devices e.g. | +| XDG_CONFIG_HOME | for linux: specifies where to store config | diff --git a/README.md b/README.md index 604891b9..29d4f65a 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,21 @@ MilkyTracker - Cross-Platform XM Tracker ======================================== -[![Travis Build Status](https://travis-ci.org/milkytracker/MilkyTracker.svg?branch=master)](https://travis-ci.org/milkytracker/MilkyTracker) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/milkytracker/MilkyTracker?branch=master&svg=true)](https://ci.appveyor.com/project/Deltafire/milkytracker) + + MilkyTracker is an multi-platform music application for creating .MOD and .XM module files. It attempts to recreate the module replay and user experience of the popular DOS program Fasttracker II, with special playback modes available for improved Amiga ProTracker 2/3 compatibility. -Refer to http://milkytracker.titandemo.org/?about for further details. +## [⬇ DOWNLOAD](https://milkytracker.org/downloads) + +## [CHAT COMMUNITY](https://milkytracker.org/community/) + +Refer to http://milkytracker.org/about for further details. Please read the file [INSTALL.md][] for installation instructions. diff --git a/appveyor.yml b/appveyor.yml index 69a5837e..775325ca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,13 @@ platform: - Win32 - x64 +image: + - Ubuntu1604 + - Visual Studio 2017 + +environment: + APPVEYOR_YML_DISABLE_PS_LINUX: true + install: - git submodule update --init --recursive - ps: | @@ -12,21 +19,66 @@ install: Update-AppveyorBuild -Version "$env:GIT_TAG-$env:APPVEYOR_BUILD_NUMBER" before_build: - - md c:\projects\milkytracker\build - - cd c:\projects\milkytracker\build - - if %platform% == Win32 cmake -G "Visual Studio 14" -T v140_xp .. - - if %platform% == x64 cmake -G "Visual Studio 14 Win64" -T v140_xp .. + - sh: wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - + - sh: sudo apt-get update + - sh: sudo apt-get install libjack-dev liblhasa-dev librtmidi-dev libsdl2-dev libzzip-dev -y + - sh: if [ $PLATFORM == "Win32" ]; then exit 0; fi + - sh: mkdir -p build + - sh: cd build + - sh: + - cmd: pwd + - cmd: md build + - cmd: cd build + - cmd: if %platform% == Win32 cmake -G "Visual Studio 15 2017" -T v140_xp .. + - cmd: if %platform% == x64 cmake -G "Visual Studio 15 2017 Win64" -T v140_xp .. + - cmd: dir + +for: +- + matrix: + only: + - image: Ubuntu1604 + + build_script: + - sh: cmake -DCMAKE_BUILD_TYPE=Debug .. + - sh: pwd + - sh: make + - sh: cpack -C %configuration% -D CPACK_GENERATOR="ZIP" + - sh: cd .. + - sh: unzip build/milkytracker*.zip + - sh: echo create AppImage + - sh: ls -la + - sh: cp -r milkytracker-* Milkytracker-x86_64.AppDir + - sh: cd Milkytracker-x86_64.AppDir + - sh: echo -e '#!/bin/sh\nHERE="$(dirname "$(readlink -f "${0}")")"\nLD_LIBRARY_PATH="$HERE/usr/lib:$LD_LIBRARY_PATH" $HERE/bin/milkytracker "$@"' > AppRun && chmod +x AppRun + - sh: echo CHECKING LIBS && find . -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq + - sh: mkdir -p usr/share usr/lib + - sh: objdump -p bin/milkytracker | awk '/ NEEDED/ {print $2}' + #- sh: objdump -p bin/milkytracker | awk '/ NEEDED/ {print $2}' | while read lib; do { set +e; test -f /usr/lib/x86_64-linux-gnu/$lib && cp /usr/lib/x86_64-linux-gnu/$lib usr/lib/.; set -e; } done + - sh: cp /usr/lib/x86_64-linux-gnu/{librtmidi*,libzzip-0.so.13,libsnd*,libvorb*,libFLAC*,libffi*,libogg*,liblhasa*} usr/lib/. + - sh: cd usr && ln -s lib x86_64-linux-gnu && cd - + - sh: cp ../resources/pictures/carton.png milkytracker.png + - sh: cp ../resources/milkytracker.desktop . + - sh: sed -i 's|MilkyTracker|Milkytracker|g;s|Comment=.*|Comment=A Portable SampleTracker DAW|g' milkytracker.desktop + #- sh: cp ../resources/org.milkytracker.MilkyTracker.metainfo.xml /usr/share/metainfo/ + - sh: find . + - sh: cd .. + - sh: wget 'https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage'; + - sh: chmod +x appimagetool*.AppImage + - sh: ./appimagetool-* Milkytracker-x86_64.AppDir + - sh: pwd build: - project: c:\projects\milkytracker\build\MilkyTracker.sln + project: build\MilkyTracker.sln after_build: # https://github.com/chocolatey/chocolatey/issues/431 - - cmake -E remove -f c:\programdata\chocolatey\bin\cpack.exe - - cpack -C %configuration% + - cmd: cmake -E remove -f c:\programdata\chocolatey\bin\cpack.exe + - cmd: cpack -C %configuration% artifacts: - path: build\milkytracker*.zip + - path: Milky*.AppImage deploy: description: Release $(appveyor_repo_tag_name) diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..a96f5e56 --- /dev/null +++ b/build.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# https://crascit.com/2016/04/03/scripting-cmake-builds/ + +# Set defaults +BUILD_TYPE="Release" +BUILD_DMG=ON + +# Parse arguments +while [[ $# -gt 0 ]]; do + case $1 in + Release|Debug) + BUILD_TYPE="$1" + ;; + --no-dmg) + BUILD_DMG=OFF + ;; + *) + echo "Unknown argument: $1" + echo "Usage: $0 [Release|Debug] [--no-dmg]" + exit 1 + ;; + esac + shift +done + +# Set build directory based on build type +BUILD_DIR="build" +CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_DMG=$BUILD_DMG" + +if [[ "$BUILD_TYPE" == "Debug" ]]; then + BUILD_DIR="build-debug" + # Add debug-specific flags + CMAKE_FLAGS="$CMAKE_FLAGS -DCMAKE_CXX_FLAGS_DEBUG='-g3'" +fi + +echo "Building MilkyTracker in $BUILD_TYPE mode in $BUILD_DIR..." +if [ "$BUILD_DMG" = "OFF" ]; then + echo "DMG generation: OFF" +fi + +cmake -E make_directory $BUILD_DIR +pushd $BUILD_DIR +cmake $CMAKE_FLAGS .. +cmake --build . --config $BUILD_TYPE +cpack . +popd diff --git a/build_macos.sh b/build_macos.sh deleted file mode 100755 index 07b08673..00000000 --- a/build_macos.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# https://crascit.com/2016/04/03/scripting-cmake-builds/ -unamestr=`uname` - -if [[ "$unamestr" != 'Darwin' ]]; then - echo "Platform is not macOS but $unamestr" - exit 1 -fi - -pushd resources/pictures/docicons/osx -curl -O https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/docerator/docerator-2.0.zip -unzip -o docerator-2.0.zip -d docerator -rm docerator-2.0.zip -./genicons.py -popd - -cmake -E make_directory build -pushd build -cmake -DCMAKE_BUILD_TYPE=Release .. -cmake --build . --config Release -cpack . -popd diff --git a/build_rpi.sh b/build_rpi.sh new file mode 100755 index 00000000..5e97a8d7 --- /dev/null +++ b/build_rpi.sh @@ -0,0 +1,68 @@ +#!/bin/sh +# Usage: +# locally: ./build_rpi.sh compile alpine +# ./build_rpi.sh compile raspbian +# and so on +# +# thru docker/podman: +# ./build_rpi.sh oci # this will build all binaries + +toolkit(){ + test -d rpi || git clone --depth=1 https://github.com/raspberrypi/tools rpi + test -d || mkdir build + export CC=$(pwd)/rpi/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-gcc + export CPP=$(pwd)/rpi/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-c++ + cd build + cmake -D CMAKE_C_COMPILER=$CC -D CMAKE_CXX_COMPILER=$CPP .. + # 32bit: /rpi/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-gcc + # 64bit: /rpi/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc +} + +compile(){ + echo $1 | grep alpine && { + apk update + apk add sdl2-dev cmake build-base + } + echo $1 | grep raspbian && { + apt-get update + apt-get install cmake libsdl2-dev + } + cd /src + test -d build && rm -rf build + mkdir build + cd build + cmake .. + make +} + +oci(){ + OCI=$(which docker || which podman) + which qemu-arm || sudo apt install -y qemu qemu-user-static qemu-user binfmt-support + + alpine(){ + IMAGES="arm64v8/alpine:3.18.2 arm32v7/alpine:3.18.2 arm32v6/alpine:3.18.2" + $OCI run --rm --privileged multiarch/qemu-user-static:register --reset + for IMG in $IMAGES; do + set -x + $OCI run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3 # enable arm + $OCI run -it --privileged --rm --volume=$(pwd):/src $IMG src/build_rpi.sh compile $IMG + cp build/src/tracker/milkytracker milkytracker.$( echo $IMG | sed 's/[\/:]/-/g') + done + } + + raspbian(){ + ARCHS="linux/arm/v6 linux/arm/v7 linux/arm64" + for ARCH in $ARCHS; do + set -x + $OCI run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3 # enable arm + $OCI run -it --privileged --rm --volume=$(pwd):/src --platform=$ARCH navikey/raspbian-buster src/build_rpi.sh compile raspbian + cp build/src/tracker/milkytracker milkytracker.$( echo $ARCH | sed 's/linux//g;s/[\/:]//g') + done + + } + + raspbian + #alpine +} + +"$@" diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 118f6fa1..2f6154e3 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -150,6 +150,66 @@

MilkyTracker ChangeLog

+ +

05/07/2023 (v1.04):

+ + + +

Bugs fixed

+ + + +

12/12/2020 (v1.03):

What’s new: