Skip to content

Commit

Permalink
Android: distribute *.h2d and *.mo files as part of the APK, bundle t…
Browse files Browse the repository at this point in the history
…he TiMidity GUS patches to make MIDI work (#6040)
  • Loading branch information
oleg-derevenetz authored Oct 25, 2022
1 parent 47ac849 commit 1a44dba
Show file tree
Hide file tree
Showing 98 changed files with 279 additions and 23 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
- name: Install dependencies
run: |
bash script/android/install_packages.sh
sudo apt-get -y update
sudo apt-get -y install gettext
- name: Generate translations
run: |
make -C files/lang -j 2
- name: Build
run: |
cd android
Expand All @@ -38,3 +43,15 @@ jobs:
name: fheroes2_android.zip
path: fheroes2_android.zip
if-no-files-found: error
- uses: ncipollo/release-action@v1
if: ${{ github.event_name == 'push' }}
with:
artifacts: fheroes2_android.zip
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
name: Android build (latest commit)
tag: fheroes2-android
allowUpdates: true
artifactErrorsFailBuild: true
prerelease: true
replacesArtifacts: true
36 changes: 18 additions & 18 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
os: ubuntu-latest
dependencies: libsdl1.2-dev libsdl-mixer1.2-dev gettext
env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON, FHEROES2_WITH_SDL1: ON }
package_name: fheroes2_ubuntu_sdl1.zip
package_name: fheroes2_ubuntu_SDL1.zip
package_files: fheroes2 LICENSE script/linux/install_sdl_1.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d
release_name: Ubuntu (Linux) build with SDL 1.2 support (latest commit)
release_name: Ubuntu (Linux) build with SDL1 (latest commit)
release_tag: fheroes2-linux-sdl1_dev
- name: Linux SDL1 Debug
os: ubuntu-latest
Expand All @@ -24,9 +24,9 @@ jobs:
os: ubuntu-latest
dependencies: libsdl2-dev libsdl2-mixer-dev gettext
env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON }
package_name: fheroes2_ubuntu_sdl2.zip
package_name: fheroes2_ubuntu_SDL2.zip
package_files: fheroes2 LICENSE script/linux/install_sdl_2.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d
release_name: Ubuntu (Linux) build with SDL 2.0 support (latest commit)
release_name: Ubuntu (Linux) build with SDL2 (latest commit)
release_tag: fheroes2-linux-sdl2_dev
- name: Linux SDL2 Debug
os: ubuntu-latest
Expand All @@ -36,9 +36,9 @@ jobs:
os: macos-11
dependencies: sdl sdl_mixer
env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON, FHEROES2_WITH_SDL1: ON }
package_name: fheroes2_macos11_sdl1_x86-64.zip
package_name: fheroes2_macos_x86-64_SDL1.zip
package_files: fheroes2 LICENSE script/macos/install_sdl_1.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d
release_name: MacOS build with SDL 1 support (latest commit)
release_name: macOS x86-64 build with SDL1 (latest commit)
release_tag: fheroes2-osx-sdl1_dev
- name: macOS SDL1 App Bundle
os: macos-11
Expand All @@ -48,9 +48,9 @@ jobs:
os: macos-11
dependencies: sdl2 sdl2_mixer
env: { FHEROES2_STRICT_COMPILATION: ON, FHEROES2_WITH_TOOLS: ON }
package_name: fheroes2_macos11_sdl2_x86-64.zip
package_name: fheroes2_macos_x86-64_SDL2.zip
package_files: fheroes2 LICENSE script/macos/install_sdl_2.sh download_demo_version.sh extract_homm2_resources.sh changelog.txt README.txt files/lang/*.mo files/data/*.h2d
release_name: MacOS build with SDL 2 support (latest commit)
release_name: macOS x86-64 build with SDL2 (latest commit)
release_tag: fheroes2-osx-sdl2_dev
- name: macOS SDL2 App Bundle
os: macos-11
Expand Down Expand Up @@ -154,20 +154,20 @@ jobs:
run: |
cp docs/README.txt docs/README_PSV.md .
# Translations and H2D files are already included in fheroes2.vpk
zip fheroes2_psv_sdl2.zip fheroes2.vpk LICENSE changelog.txt README.txt README_PSV.md
zip fheroes2_psv.zip fheroes2.vpk LICENSE changelog.txt README.txt README_PSV.md
- uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'pull_request' }}
with:
name: fheroes2_psv_sdl2.zip
path: fheroes2_psv_sdl2.zip
name: fheroes2_psv.zip
path: fheroes2_psv.zip
if-no-files-found: error
- uses: ncipollo/release-action@v1
if: ${{ github.event_name == 'push' }}
with:
artifacts: fheroes2_psv_sdl2.zip
artifacts: fheroes2_psv.zip
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
name: PS Vita build with SDL 2.0 support (latest commit)
name: PS Vita build (latest commit)
tag: fheroes2-psv-sdl2_dev
allowUpdates: true
artifactErrorsFailBuild: true
Expand Down Expand Up @@ -197,20 +197,20 @@ jobs:
- name: Create package
run: |
cp docs/README.txt docs/README_switch.md .
zip fheroes2_switch_sdl2.zip fheroes2.nro LICENSE changelog.txt README.txt README_switch.md files/lang/*.mo files/data/*.h2d
zip fheroes2_switch.zip fheroes2.nro LICENSE changelog.txt README.txt README_switch.md files/lang/*.mo files/data/*.h2d
- uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'pull_request' }}
with:
name: fheroes2_switch_sdl2.zip
path: fheroes2_switch_sdl2.zip
name: fheroes2_switch.zip
path: fheroes2_switch.zip
if-no-files-found: error
- uses: ncipollo/release-action@v1
if: ${{ github.event_name == 'push' }}
with:
artifacts: fheroes2_switch_sdl2.zip
artifacts: fheroes2_switch.zip
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
name: Nintendo Switch build with SDL 2.0 support (latest commit)
name: Nintendo Switch build (latest commit)
tag: fheroes2-switch-sdl2_dev
allowUpdates: true
artifactErrorsFailBuild: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ jobs:
build_config: Release-SDL1
deploy_config: SDL1
package_name: fheroes2_windows_x86_SDL1
release_name: Windows x86 build with SDL1 support (latest commit)
release_name: Windows x86 build with SDL1 (latest commit)
release_tag: fheroes2-windows-x86-SDL1
- name: SDL1 x64
platform: x64
build_config: Release-SDL1
deploy_config: SDL1
package_name: fheroes2_windows_x64_SDL1
release_name: Windows x64 build with SDL1 support (latest commit)
release_name: Windows x64 build with SDL1 (latest commit)
release_tag: fheroes2-windows-x64-SDL1
- name: SDL2 x86
platform: x86
build_config: Release-SDL2
deploy_config: SDL2
package_name: fheroes2_windows_x86_SDL2
release_name: Windows x86 build with SDL2 support (latest commit)
release_name: Windows x86 build with SDL2 (latest commit)
release_tag: fheroes2-windows-x86-SDL2
- name: SDL2 x64
platform: x64
build_config: Release-SDL2
deploy_config: SDL2
package_name: fheroes2_windows_x64_SDL2
release_name: Windows x64 build with SDL2 support (latest commit)
release_name: Windows x64 build with SDL2 (latest commit)
release_tag: fheroes2-windows-x64-SDL2
name: MSVC (${{ matrix.config.name }})
runs-on: windows-2019
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ concurrency:
cancel-in-progress: true

jobs:
android:
name: Android
uses: ./.github/workflows/android.yml
make:
name: Make
uses: ./.github/workflows/make.yml
Expand All @@ -23,6 +26,7 @@ jobs:
translation:
name: Translation update
needs:
- android
- make
- msvc
uses: ./.github/workflows/translation_update.yml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,8 @@ android/local.properties
android/.idea
android/.gradle

# Automatically created Android assets
android/app/src/main/assets/files/

# Mac magic folders
.DS_Store
19 changes: 19 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,23 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':sdl2')
implementation 'org.apache.directory.studio:org.apache.commons.io:2.4'
}

task copyH2D(type: Copy) {
from('../../files/data') {
include '*.h2d'
}
into 'src/main/assets/files/data'
}

task copyTranslations(type: Copy) {
from('../../files/lang') {
include '*.mo'
}
into 'src/main/assets/files/lang'
}

preBuild {
dependsOn copyH2D, copyTranslations
}
34 changes: 34 additions & 0 deletions android/app/src/main/assets/instruments/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
There has been some interest in using this patch set commercially. I am
flattered, but I'm not sure what to say here. I know that there are some
patches that came from the ultrasnd mirrors which contained notices that
they did not wish for them to be used commercially. Since I raided the
ultrasnd archives many years ago, I couldn't remember which ones were
covered by this, so I just flatly said that the whole set was for
non-commercial use only. Since then, I have extracted the *.txt and read*.*
files out of all the archives and grep'd them for "commercial". While several
of them came up as only being for non-commercial use, there are only a few in
my set to which this applies. These are:

nearly the entire Analog drumset, drumset 25
pistol.pat
pistol2.pat (not currently mapped in cfg files)
machgun1.pat (not currently mapped in cfg files)

So, basicly you can not use the analog drums or the pistol files in any
commercial work. This is out of my hands. The rest of the patches are fully
public domain as far as I know. It should not be hard to find another
pistol which sounds almost as good. As for the analog drumset, just go buy
yourself a real TR808 or some other product far superior to these patches.

If you DO use this patch set in a commercial production, I'd like to hear
about it. A free copy of the production might be nice too :)




Eric A. Welsh
ewelsh@gpc.ibc.wustl.edu
Center for Molecular Design
Institute for Biomedical Computing
Washington University
St. Louis, MO
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/cello.pat
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/choir.pat
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/claps.pat
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/clave.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/flute.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/harp.pat
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/highq.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/kick1.pat
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/kick2.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/oboe.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/slap.pat
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/snap.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/sqrclick.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/taiko.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added android/app/src/main/assets/instruments/viola.pat
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
98 changes: 98 additions & 0 deletions android/app/src/main/assets/timidity.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#
# Set of GUS patches with MIDI instrument characteristics is taken from here:
# http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz
#

bank 0

0 instruments/acpiano amp=125
6 instruments/hrpschrd amp=115
19 instruments/church
24 instruments/nyguitar amp=150
41 instruments/viola
42 instruments/cello
43 instruments/contraba amp=150
44 instruments/tremstr
45 instruments/pizzcato amp=85
46 instruments/harp
47 instruments/timpani
48 instruments/marcato
49 instruments/slowstr
51 instruments/synstr2 amp=125
52 instruments/choir
57 instruments/trombone amp=100
60 instruments/frenchrn amp=115
68 instruments/oboe
69 instruments/englhorn
70 instruments/bassoon
71 instruments/clarinet
72 instruments/piccolo
73 instruments/flute amp=100
92 instruments/bowglass amp=200
116 instruments/taiko amp=200

drumset 0

25 instruments/snarerol keep=env amp=225 note=60
26 instruments/snap note=65
27 instruments/highq amp=50 note=65
28 instruments/slap
29 instruments/scratch1 amp=30
30 instruments/scratch2 amp=30
31 instruments/sticks note=60
32 instruments/sqrclick note=60
33 instruments/metclick note=60
34 instruments/metbell keep=loop keep=env note=60
35 instruments/kick1
36 instruments/kick2
37 instruments/stickrim
38 instruments/snare1
39 instruments/claps strip=tail
40 instruments/snare2
41 instruments/tomlo2
42 instruments/hihatcl
43 instruments/tomlo1
44 instruments/hihatpd
45 instruments/tommid2
46 instruments/hihatop
47 instruments/tommid1
48 instruments/tomhi2
49 instruments/cymcrsh1
50 instruments/tomhi1
51 instruments/cymride1 note=60
52 instruments/cymchina
53 instruments/cymbell
54 instruments/tamborin note=60
55 instruments/cymsplsh
56 instruments/cowbell
57 instruments/cymcrsh2
58 instruments/vibslap
59 instruments/cymride2 note=60
60 instruments/bongohi
61 instruments/bongolo
62 instruments/congahi1
63 instruments/congahi2 note=62
64 instruments/congalo note=62
65 instruments/timbaleh note=60
66 instruments/timbalel note=60
67 instruments/agogohi note=60
68 instruments/agogolo note=60
69 instruments/cabasa
70 instruments/maracas note=60
71 instruments/whistle1 note=60 keep=loop keep=env
72 instruments/whistle2 note=60 keep=loop keep=env
73 instruments/guiro1
74 instruments/guiro2 note=60 keep=env
75 instruments/clave
76 instruments/woodblk1 note=60
77 instruments/woodblk2 note=60
78 instruments/cuica1
79 instruments/cuica2
80 instruments/triangl1 note=60 amp=40
81 instruments/triangl2 note=60 amp=40
82 instruments/shaker
83 instruments/jingles note=92
84 instruments/belltree keep=loop keep=env
85 instruments/castinet
86 instruments/surdo1
87 instruments/surdo2
Loading

0 comments on commit 1a44dba

Please sign in to comment.