Giter Site home page Giter Site logo

nwaldispuehl / interval-music-compositor Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 3.0 27.79 MB

IntervalMusicCompositor, a multi-platform software for creating interval music compilations out of multiple sound files.

Home Page: https://nwaldispuehl.github.io/interval-music-compositor/

License: GNU General Public License v3.0

Java 97.54% CSS 0.74% Rust 1.72%
java music circuit pyramid training physical-education sports exercise break iteration

interval-music-compositor's Introduction

Interval Music Compositor

Interval Music Compositor, a multi-platform software for creating interval music compilations out of multiple sound files.

Interval Music Compositor screenshot

How to download binary?

There are pre-built distributions for the major operating systems to be found on the github releases page: Interval Music Compositor releases. A small user manual can be found on the Github project page.

How to build?

You certainly need a Java development kit (>= 17) installed on your system. Alternatively use jenv to control the used JDK. Then, clone the repository and use the packaged gradle binary to either run the program,

$ ./gradlew run

execute its tests,

$ ./gradlew check

or create the distribution for the supported operating system (Linux, Windows, and Mac). In this case, you also need to:

  • place the respective JDKs and JavaFX jmods (the 'target platform') on your system according to the jlink task in the intervalmusiccompositor.app/build.gradle file, and
  • set up a Rust build environment in the intervalmusiccompositor.updater/native-src with the respective toolchains (see README file there).

Then, build with:

$ ./gradlew distAll

The distribution archives are then to be found in the intervalmusiccompositor.app/build/distributions/ folder.

Note: The assumption is that we are using a Linux system to build the software. If you have another operating system you might need to adapt the OS-specific dependencies in intervalmusiccompositor.ui.fx/build.gradle which are only used to directly run the software with the build tool Gradle.

interval-music-compositor's People

Contributors

nwaldispuehl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

interval-music-compositor's Issues

Preview scales badly

When increasing the number of iterations the preview blocks move around instead of being always as wide as the respective pane. Some rounding issue? This should look better.

NPE when playing extract (BPM dialog) while file is still importing

When opening the BMP dialog and playing the preview on a song still being imported the following exception is thrown:

null
	at java.io.DataInputStream.readInt(DataInputStream.java:392)
	at org.tritonus.sampled.file.WaveAudioFileReader.getAudioFileFormat(WaveAudioFileReader.java:263)
	at org.tritonus.share.sampled.file.TAudioFileReader.getAudioInputStream(TAudioFileReader.java:366)
	at org.tritonus.share.sampled.file.TAudioFileReader.getAudioInputStream(TAudioFileReader.java:245)
	at ch.retorte.intervalmusiccompositor.audiofile.AudioFile.getAudioInputStream(AudioFile.java:342)
	at ch.retorte.intervalmusiccompositor.player.ExtractMusicPlayer.play(ExtractMusicPlayer.java:53)
	at ch.retorte.intervalmusiccompositor.MainControl.playMusicTrack(MainControl.java:438)
	at ch.retorte.intervalmusiccompositor.ui.bpm.BpmWindow.playTrack(BpmWindow.java:188)
	at ch.retorte.intervalmusiccompositor.ui.bpm.BpmWindow.lambda$initializeMusicControl$2(BpmWindow.java:125)

Streamline upgrade process

The upgrade process should be painless. Possible steps:

  • Changes are already shown in the upgrade dialog
  • The user can download the respective binary directly
  • The application is able to upgrade itself without user interaction.

OutOfMemoryError when adding long mp3 music file

A user gets an OutOfMemoryError when adding a particular music file to the track list:

2018-11-13--19:07:34.175 - IntervalMusicCompositor - Interval Music Compositor, V 2.9.0
2018-11-13--19:07:34.203 - IntervalMusicCompositor - System properties: os: Windows 10, os arch: amd64, jvm: 1.8.0_121, jvm arch: 32, current heap: 16,3 MB, max heap: 1,0 GB, free mem: 11,8 MB, total mem: 4,2 GB, free hdd: 37,2 GB, total hdd: 248,1 GB
[...]
2018-11-13--19:10:54.999 - unknown - Java heap space
2018-11-13--19:10:55.000 - IntervalMusicCompositorUI - java.lang.OutOfMemoryError: Java heap space
at ch.retorte.intervalmusiccompositor.decoder.Mp3AudioFileDecoder.getByteArrayOfUndefStream(Mp3AudioFileDecoder.java:152)
at ch.retorte.intervalmusiccompositor.decoder.Mp3AudioFileDecoder.tidyStream(Mp3AudioFileDecoder.java:101)
at ch.retorte.intervalmusiccompositor.decoder.Mp3AudioFileDecoder.decode(Mp3AudioFileDecoder.java:79)
at ch.retorte.intervalmusiccompositor.audiofile.AudioFile.decodeSourceFile(AudioFile.java:214)
at ch.retorte.intervalmusiccompositor.audiofile.AudioFile.createCache(AudioFile.java:164)
at ch.retorte.intervalmusiccompositor.cache.CreateCacheJob.run(CreateCacheJob.java:49)
at java.lang.Thread.run(Unknown Source)

There is no more information about the music file, but the name implies that it is of extraordinary length.

While we converted the compilation generation to streams some time ago, the import functionality still uses byte arrays for keeping the complete data set in memory. This should also be fixed.

Introduce pre-listen (and pre-view?) functionality

Currently, when setting the compilation parameters (as number of intervals, breaks, etc) a preview graphic representing the track proportions is displayed.

It would be interesting to have a preview mechanism which would allow free selection of the playback start position and would play the compilation as it would be generated. Since the data would then be available anyway, an envelope image could be also generated right away.

Output encoding may take a long time, no indication of progress in UI

The output encoding -- if used the mp3 encoder -- is the most expensive operation of the compilation generation process. This is however not adequately reflected in the progress bar which then just stands at 70% for dozens of seconds.
It would be interesting to have at least some indication of progress.

'Double whistle' special effect can be placed out of range

The maximum start time of a special effect is defined as:

maximum_special_effect_start_time := sound_period_duration - sound_effect_duration

However -- in the case of the 'double whistle' -- this appears to be not the case; it can be placed at the end of a sound interval. E.g. if the sound interval is 8 s, then the maximum time is not 7 s but actually 8 s. Which causes an exception:

2018-07-19--19:18:19.422 - Compilation - Adding sound effect double_whistle (1000) at 8000 ms
There was a problem!
If inserted at position 1411200, the inserted array of length 176360 exceeds the length of the host array: 1411200
2018-07-19--19:18:19.428 - IntervalMusicCompositorUI - ch.retorte.intervalmusiccompositor.compilation.CompilationException: There was a problem!
If inserted at position 1411200, the inserted array of length 176360 exceeds the length of the host array: 1411200
	at ch.retorte.intervalmusiccompositor.compilation.CompilationGenerator.createCompilation(CompilationGenerator.java:272)
	at ch.retorte.intervalmusiccompositor.compilation.CompilationGenerator.run(CompilationGenerator.java:102)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: If inserted at position 1411200, the inserted array of length 176360 exceeds the length of the host array: 1411200
	at ch.retorte.intervalmusiccompositor.commons.ArrayHelper.insertAt(ArrayHelper.java:62)
	at ch.retorte.intervalmusiccompositor.compilation.Compilation.addSoundEffectTo(Compilation.java:244)
	at ch.retorte.intervalmusiccompositor.compilation.Compilation.getPlaylistItemDataFrom(Compilation.java:162)
	at ch.retorte.intervalmusiccompositor.compilation.Compilation.generateCompilation(Compilation.java:82)
	at ch.retorte.intervalmusiccompositor.compilation.CompilationGenerator.createCompilation(CompilationGenerator.java:248)
	... 2 more

Track list sometimes not properly updated

Sometimes - usually when the program is out of focus during import - the finished import of tracks is not reflected in the indicator icon. i.e. it is still yellow.

side project

can you please reach out to me at [email protected]
i'd like to offer you a project which you will find easy considering this project.

Occasional NPE when scrolling in debug window

When scrolling in the debug window of the Apple OSX version of the software, then sometimes the following NPE occurrs.
It might be if the scrolling happens at the same time as something gets pushed to the debug log.

2017-10-04--20:31:19.085 - unknown - NullPointerException
2017-10-04--20:31:19.096 - IntervalMusicCompositorUI - java.lang.NullPointerException
	at javafx.scene.Scene$ScenePeerListener.scrollEvent(Scene.java:2556)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$null$369(GlassViewEventHandler.java:914)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleScrollGestureEvent$370(GlassViewEventHandler.java:896)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleScrollGestureEvent(GlassViewEventHandler.java:895)
	at com.sun.glass.ui.View.handleScrollGestureEvent(View.java:597)
	at com.sun.glass.ui.View.notifyScrollGestureEvent(View.java:1064)
	at com.sun.glass.ui.GestureSupport.handleScrollingEnd(GestureSupport.java:140)
	at com.sun.glass.ui.GestureSupport.lambda$createTouchCountListener$41(GestureSupport.java:379)
	at com.sun.glass.ui.TouchInputSupport.notifyEndTouchEvent(TouchInputSupport.java:115)
	at com.sun.glass.ui.mac.MacTouchInputSupport.notifyEndTouchEvent(MacTouchInputSupport.java:93)
	at com.sun.glass.ui.mac.MacGestureSupport.notifyEndTouchEvent(MacGestureSupport.java:81)

Increase compilation length for Windows users

Microsoft Windows is the only major desktop operating system still deploying 32bit versions. Due to this we play it safe and only assign the Windows version of the software ~950MB of maximum heap space, allowing a maximum compilation length of ~ 1 hour.

This leads to errors like this where a user tries to create a [60] [20] 50 compilation (66:40 mins):

...
2017-10-24--16:41:01.443 - MainControl - Started compilation with: [60] [20] 50 
2017-10-24--16:41:01.448 - CompilationGenerator - Progress: 0, Lese Daten ein 
2017-10-24--16:41:01.449 - CompilationGenerator - Progress: 10, Lade Musikdateien 
2017-10-24--16:41:01.450 - CompilationGenerator - Progress: 20, Lade  Pausenmusikdateien 
2017-10-24--16:41:01.451 - CompilationGenerator - Progress: 30, Erzeuge  Wiedergabeliste 
2017-10-24--16:41:01.502 - CompilationGenerator - Progress: 40, Erzeuge  Zusammenstellung 
2017-10-24--16:41:01.763 - unknown - Das Programm benötigt für einen Vorgang  mehr Hauptspeicher (RAM) als es zugewiesen erhielt. Java heap space 
2017-10-24--16:41:01.766 - IntervalMusicCompositorUI -  ch.retorte.intervalmusiccompositor.compilation.CompilationException: Das  Programm benötigt für einen Vorgang mehr Hauptspeicher (RAM) als es zugewiesen  erhielt. 
Java heap space  
  at ch.retorte.intervalmusiccompositor.compilation.CompilationGenerator.createCompilation(CompilationGenerator.java:257)      
  at ch.retorte.intervalmusiccompositor.compilation.CompilationGenerator.run(CompilationGenerator.java:102)      
  at java.lang.Thread.run(Unknown Source) 

We would like to have:

  • longer compilations for Windows users (with 64bit operating system)
  • better directions in case of the error

Offer option to instantly submit errors

In the error dialog, it would be nice to have a button like Send error report which instantly sends the stacktrace to the server. There should probably be an optional field for the users email address for additional inquiries.

Linux version should also be started with double click on application icon

The Linux version of the software still needs to be started with command line invocation of the Gradle wrapper:

$ ./bin/IntervalMusicCompositor

As Linux grows increasingly popular this should now work with a double-clickable application icon users know from every other software.

For starters this should at least work in the Gnome desktop.

Music playback fails with IllegalStateException under OpenJDK

Using the OpenJDK (java-7-openjdk-amd64), the music playback throws an IllegalStateException when stopping playback:

2014-02-54--15:04:26.174 - ExtractMusicPlayer - Started playing: some_piece.m4a
Exception in thread "PulseAudio Eventloop Thread" java.lang.IllegalStateException: drain failed
    at org.classpath.icedtea.pulseaudio.EventLoop.native_iterate(Native Method)
    at org.classpath.icedtea.pulseaudio.EventLoop.run(EventLoop.java:133)
    at java.lang.Thread.run(Thread.java:744)

Add output format choosing mechanism

Since we introduced the MP3 encoder, there now exist two fully functional encoders (MP3 and WAVE) of which only one is ever used: the MP3.

private List<AudioFileEncoder> getAudioFileEncoders() {
    ByteArrayConverter byteArrayConverter = new SoundHelper(messageBus);
    List<AudioFileEncoder> result = newArrayList();

    /*
     * Note that the order how the encoders are added matters. The compilation is encoded with the first encoder which returns true on 'isAbleToEncode'.
     */
    result.add(new Mp3AudioFileEncoder(byteArrayConverter));
    result.add(new WaveAudioFileEncoder());

    return result;

}

It would be interesting if the user could affect the choice of encoder somehow.

Program appears to be not running on Windows 10

Launch4j launcher does not start program on some Windows 10 instances. On Windows 7 it appears to run.

Also on failing Windows 10 instances the program can be started by invoking:

> java -jar IntervalMusicCompositor.exe

Introduce new version check on application startup

To improve the update rate it would be interesting if the application could check for new versions on startup.

Such feature should be deactivatable, so on first start it should ask for the users consent.

Stale output directory yields error

If the respective setting is activated, all entered values etc. are stored.

Now the output directory of a previous session might not be existing anymore, whereupon -- if the user tries to start the compilation generation -- an error is produced:

/home/user/Desktop/output/4s_4b-x2.playlist.txt (No such file or directory)

This is a bit unfortunate and also not clear enough since it contains also the filename of the compilation playlist.

The software should check for the directorys existence at:

  • startup, when user settings are loaded, and
  • right before the compilation generation starts.

Or, maybe we could install some FS watcher on the directory.

Rank jar download lower

A significant number of people appear to download the jar file instead of the OS-specific distributions (first). Most likely because it is the first entry in the download list. We should rank it down a bit.

Heap space exception for longer compilations under Windows and Linux

Currently, the Microsoft Windows and Linux distributions of the software declare a heap space size of 1024 MB, as opposed to the Mac Version with 2GB. This prevents users from creating compilations longer than around 50 Minutes with the MP3 setting, since we keep not only the PCM byte array in memory but also the newly created MP3 byte array.

Mitigation paths

  • Increase heap size
  • Make MP3 conversion smarter

Workarounds

  • Start software manually with more heap space, e.g.:

    java -jar -Xmx2g IntervalMusicCompositor.exe

  • Use WAVE as output sound format an convert in other software.

Introduce persistent user settings

It would be interesting if the application could keep between starts:

  • user preferences (e.g. for startup update check preference #26 )
  • compilation settings (sound, break, iterations, tracks, etc.)

For editing preferences a new dialog should be introduced.

Unexpected OutOfMemoryException when persisting compilation with FileOutputStream

A user reported an interesting crash when generating a compilation.
(Note: User identifying parts replaced with '********')

2017-10-06--21:45:16.030 - IntervalMusicCompositor - Interval Music Compositor, V 2.8.0
2017-10-06--21:45:16.030 - IntervalMusicCompositor - System properties: os: Windows 10, os arch: x86, jvm: 1.8.0_144, jvm arch: 32, max heap size: 989 MB
2017-10-06--21:45:16.030 - UiUserPreferences - Loading user preference 'locale' value: de
...
2017-10-06--21:46:09.159 - MainControl - Started compilation with: [60] [120] 8
2017-10-06--21:46:09.161 - CompilationGenerator - Progress: 0, Lese Daten ein
2017-10-06--21:46:09.161 - CompilationGenerator - Progress: 10, Lade Musikdateien
2017-10-06--21:46:09.161 - CompilationGenerator - Progress: 20, Lade Pausenmusikdateien
2017-10-06--21:46:09.162 - CompilationGenerator - Progress: 30, Erzeuge Wiedergabeliste
2017-10-06--21:46:09.171 - CompilationGenerator - Progress: 40, Erzeuge Zusammenstellung
2017-10-06--21:46:09.237 - Compilation - Generate compilation of length: 1440 s
2017-10-06--21:46:09.346 - Compilation - Adding to compilation at 0.0: Various - Beach Boys  Sloop John B..mp3 [87547 - 147547]
2017-10-06--21:46:09.426 - Compilation - Adding to compilation at 60.0: Break [0 - 120000]
2017-10-06--21:46:09.510 - Compilation - Adding to compilation at 180.0: Various - Byrds  Mr. Tambourine Man.mp3 [8766 - 68766]
2017-10-06--21:46:09.565 - Compilation - Adding to compilation at 240.0: Break [0 - 120000]
2017-10-06--21:46:09.648 - Compilation - Adding to compilation at 360.0: Various - Tommy Roe  Sheila.mp3 [10042 - 70042]
2017-10-06--21:46:09.687 - Compilation - Adding to compilation at 420.0: Break [0 - 120000]
2017-10-06--21:46:09.774 - Compilation - Adding to compilation at 540.0: Various - Archies  Sugar, Sugar.mp3 [63475 - 123475]
2017-10-06--21:46:09.815 - Compilation - Adding to compilation at 600.0: Break [0 - 120000]
2017-10-06--21:46:09.900 - Compilation - Adding to compilation at 720.0: Various - Hollies  Jennifer Eccles.mp3 [75568 - 135568]
2017-10-06--21:46:09.940 - Compilation - Adding to compilation at 780.0: Break [0 - 120000]
2017-10-06--21:46:10.023 - Compilation - Adding to compilation at 900.0: Various - Small Faces  Shalalalalee.mp3 [55592 - 115592]
2017-10-06--21:46:10.063 - Compilation - Adding to compilation at 960.0: Break [0 - 120000]
2017-10-06--21:46:10.150 - Compilation - Adding to compilation at 1080.0: Various - Los Bravos  Black Is Black.mp3 [76246 - 136246]
2017-10-06--21:46:10.191 - Compilation - Adding to compilation at 1140.0: Break [0 - 120000]
2017-10-06--21:46:10.273 - Compilation - Adding to compilation at 1260.0: Various - Box Tops  The Letter.mp3 [16394 - 76394]
2017-10-06--21:46:10.313 - Compilation - Adding to compilation at 1320.0: Break [0 - 120000]
2017-10-06--21:46:10.314 - Compilation - Adding sound effect gong at 0
2017-10-06--21:46:10.318 - Compilation - Adding sound effect gong at 180000
2017-10-06--21:46:10.323 - Compilation - Adding sound effect gong at 360000
2017-10-06--21:46:10.327 - Compilation - Adding sound effect gong at 540000
2017-10-06--21:46:10.331 - Compilation - Adding sound effect gong at 720000
2017-10-06--21:46:10.335 - Compilation - Adding sound effect gong at 900000
2017-10-06--21:46:10.339 - Compilation - Adding sound effect gong at 1080000
2017-10-06--21:46:10.342 - Compilation - Adding sound effect gong at 1260000
2017-10-06--21:46:10.347 - CompilationGenerator - Created temporary compilation file C:\Users\********\AppData\Local\Temp\compilation4154158354489334135.imc_wav for size 254016000
2017-10-06--21:46:10.347 - unknown - Das Programm benötigt für einen Vorgang mehr Hauptspeicher (RAM) als es zugewiesen erhielt.
null
2017-10-06--21:46:10.349 - IntervalMusicCompositorUI - ch.retorte.intervalmusiccompositor.compilation.CompilationException: Das Programm benötigt für einen Vorgang mehr Hauptspeicher (RAM) als es zugewiesen erhielt.
null
	at ch.retorte.intervalmusiccompositor.compilation.CompilationGenerator.createCompilation(CompilationGenerator.java:257)
	at ch.retorte.intervalmusiccompositor.compilation.CompilationGenerator.run(CompilationGenerator.java:102)
	at java.lang.Thread.run(Unknown Source)
...

The interesting part is that at this position in the code:

try (FileOutputStream fos = new FileOutputStream(compilationDataFile)) {
      fos.write(compilationBytes);
}

it is not immediately clear how such OutOfMemoryException could be produced.

Integrate native MP3 libraries.

Currently, the MP3 encoder ch.retorte.intervalmusiccompositor.encoder.Mp3AudioFileEncoder works in the way that it checks for a Lame binary present on the system (either in the same directory as the IMC is run, or on unixoid systems in /usr/bin/). If that is the case it:

  • uses the Wave encoder to generate a temporary Wave file, then
  • calls the Lame binary on this Wave file to generate a MP3 file and
  • deletes the Wave file afterwards.

On Linux the installation of Lame is a matter of one console command and ten seconds to wait, but on the other systems a binary package needs to be downloaded and installed, which is a bit cumbersome.

It would be nice if we could deliver the software packaged already with the respective native lame library.

Upgrade UI

The current user interface has several shortcomings, both from the users and software constructions perspective:

  • it is difficult to maintain since it was once generated with Googles Swing Designer but now maintained manually. The UI designer created a lot of complicated structures which are still in the software.
  • It is very static, that is, does not adapt to window resize
  • It looks old on the Windows platform

It would be interesting to address some of these features. This could be taken as opportunity to refresh the UI experience of the software in general.

Temporary compilation file is not deleted on Windows

When creating a compilation under Windows 10 (probably also other versions) with Java 1.8.0_121 (probably also with other versions) then the raw audio output file used as buffer (i.e. the pcm wave file) can't be deleted during the process and cloggs the temporary directory.

The files were placed in the directory C:\Users\USERNAME\AppData\Local\Temp.

Compilation should not be kept in memory as whole

Today the output compilation is kept in memory as a byte array. This is very convenient, but clogs the memory and restricts the size of the maximal compilation.

The compilation should only be treated as stream, i.e. only parts of it should be kept in memory.

Software sometimes does not terminate after quitting

Regularly quitting the software may happen via:

  • using the 'File' -> 'Quit' menu option, by
  • using the operating systems quit window widget (usually a small 'x' button in the upper left/right), or
  • receiving the termination command from the operating system (which is equivalent to the last option).

It now sometimes happens that the software keeps running after performing one of the above quitting operations. Possible candidates are the JavaFX subsystem and one of the half dozen thread pools we use for various puposes. However, the software should quit instantly.

Reduce / adapt volume of break track

A user asked for the break track to be played back with lower volume than the regular tracks since they often appear to be too loud and apparently can't be told apart good enough from the actual tracks.

Maybe we could introduce some volume selector for the break track.

Continuous enumeration crashes on playlist repeating

When selecting the CONTINUOUS enumeration with a number of iterations exceeding the length of all tracks, the following exception is thrown.

java.lang.IllegalStateException: Too few usable tracks.

	at ch.retorte.intervalmusiccompositor.playlist.Playlist.createMusicPlaylist(Playlist.java:159)
	at ch.retorte.intervalmusiccompositor.playlist.Playlist.generatePlaylistFrom(Playlist.java:103)
	...

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.