Skip to content

Commit

Permalink
0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mtolly committed Oct 31, 2016
1 parent 55b33c0 commit f1f7440
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 27 deletions.
26 changes: 11 additions & 15 deletions Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Control.Applicative ((<|>))
import Control.Monad ((>=>), forM_, unless)
import Data.Char (toLower)
import Data.List (sort, nub, partition)
import Data.Maybe (mapMaybe, fromMaybe, listToMaybe)
import Data.Maybe (catMaybes, mapMaybe, fromMaybe, listToMaybe)
import Data.Version (showVersion)
import qualified System.Console.GetOpt as Opt
import qualified System.Environment as Env
Expand Down Expand Up @@ -97,13 +97,12 @@ main = do
in do
putStrLn "Exporting backing audio (could take a while)"
runAudio [fback] others fout
case matches of
clickTracks <- mapM loadBeats $ map (\(fp, _, _) -> fp) matches
case catMaybes clickTracks of
[] -> return ()
(fp, _, _) : _ -> loadBeats fp >>= \mb -> case mb of
Nothing -> return ()
Just beats -> do
putStrLn "Exporting metronome click track"
writeMetronomeTrack (dout </> "click.wav") beats
beats : _ -> do
putStrLn "Exporting metronome click track"
writeMetronomeTrack (dout </> "click.wav") beats
case function args of
PrintUsage -> printUsage
ShowDatabase -> do
Expand All @@ -117,16 +116,13 @@ main = do
(_ , Left err ) -> error err
(Right yaifcs, Right naifcs) -> runAudio yaifcs naifcs fout
ExportClick fout -> do
matches <- searchResultsChecked args
case matches of
matches <- map (\(fp, _, _) -> fp) <$> searchResultsChecked args
clickTracks <- mapM loadBeats matches
case catMaybes clickTracks of
[] -> do
putStrLn "No songs matched your search."
putStrLn $ "Couldn't load beats.plist from any of these folders: " ++ show matches
exitFailure
(fp, _, _) : _ -> loadBeats fp >>= \mb -> case mb of
Nothing -> do
putStrLn $ "Couldn't load beats.plist from the folder: " ++ fp
exitFailure
Just beats -> writeMetronomeTrack fout beats
beats : _ -> writeMetronomeTrack fout beats
CheckPresence -> do
matches <- getAudioParts <$> searchResultsChecked args
let f = mapM (`getOneResult` matches) . mapMaybe charToAudioPart
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ release/${release}-osx-x64.zip:
stack build
cp .stack-work/install/x86_64-osx/*/*/bin/jammittools jammittools
strip jammittools
zip $@ jammittools README.md LICENSE
zip $@ jammittools README.md LICENSE easy-export.applescript
rm jammittools

release/${release}-linux-x64.tar.gz:
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

[![Available on Hackage](https://img.shields.io/hackage/v/jammittools.svg)](http://hackage.haskell.org/package/jammittools)

A command-line tool for exporting sheet music and audio from the Windows/Mac app [Jammit].
It should go without saying, but please do not distribute content from songs you have purchased --
it is for your use only!

Download the latest Windows/Mac/Linux binaries from the [releases page](https://github.com/mtolly/jammittools/releases).
A command-line tool for exporting sheet music and audio from the (defunct) Windows/Mac app [Jammit].
It should go without saying, but please do not distribute content from songs you have purchased—it is for your use only!

[Jammit]: https://www.jammit.com/

## Usage
## Easy export instructions

1. Download songs through the Windows or Mac Jammit app.

2. Download `jammittools` from the [releases page](https://github.com/mtolly/jammittools/releases).

3. Unzip somewhere, and run the included `easy-export` script. Song folders will start being extracted in that same folder.

## Command-line instructions

jammittools -?
# Print usage info.
Expand Down Expand Up @@ -105,8 +110,8 @@ This uses the `-n` flag to mix many audio files in after inverting them.
The `D` part is the backing track for the drums package. What this does is
subtract the non-drums instrument parts from this backing track, leaving you
with just the portion of the song that isn't present in any of the transcribed
parts. If you use the `-x` option to export all parts of a song, this process
will be done for you and placed in a file called `backing.wav`.
parts. If you use the `-x` or `-b` options to export all parts of a song, this
process will be done for you and placed in a file called `backing.wav`.

The resulting file has a thin layer of noise, because all the audio used in
Jammit is lossily encoded, which means the backing tracks are not quite perfect
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Sets up boxes for both Linux and Windows (Wine).
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/xenial32'
config.vm.box = 'ubuntu/vervet32'
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
Expand Down
4 changes: 4 additions & 0 deletions easy-export.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/osascript
on run argv
do shell script "\"" & (POSIX path of ((path to me as text) & "::")) & "jammittools\" -b ."
end run
3 changes: 3 additions & 0 deletions easy-export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
"$DIR/jammittools" -b .
4 changes: 2 additions & 2 deletions jammittools.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: jammittools
Version: 0.5.1
Version: 0.5.2
Synopsis: Export sheet music and audio from Windows/Mac app Jammit
Description:

Expand Down Expand Up @@ -61,7 +61,7 @@ executable jammittools
, directory >= 1.2.0.1 && < 1.3
, filepath >= 1.3.0.1 && < 1.5
, boxes >= 0.1.3 && < 0.2
, jammittools == 0.5.1
, jammittools == 0.5.2
ghc-options: -Wall -O2

source-repository head
Expand Down

0 comments on commit f1f7440

Please sign in to comment.