Showing posts with label Software. Show all posts
Showing posts with label Software. Show all posts

Thursday, July 7, 2016

Android WavPack port (unofficial) to compress wav files

I have ported wavpack-4.80.0 to Android. Convert high quality wav files to smaller wv wavpack files without loosing any quality. Its an unofficial port of popular WavPack utility (version WavPack 4.80.0). It can convert wav files to wv and wv back to wav files in batch. Convert 100+ files in batch. If you have synth instruments/samples in wav format then compressing them to wv is extremely useful. It uses lossless compression method which is just like zip, rar, 7z which don't destroy even a single bit from data files.

  • Converts WAV to WV and WV to WAV
  • Convert in batch. Select lots of WAV & WV files randomly. Compresses or decompresses depending upon extension.




Download link:
http://play.google.com/store/apps/details?id=org.greh.wavpacktoolx

Monday, June 27, 2016

Android app to extract soundfont (SF2) from sfArk

Update:

This project is now also archived. I will not work on it and removed from my playstore account. I am abandoning many of my projects because on Android its getting very tough to maintain them to work on all devices and updating them to newer Android versions. However i can republish it to my archived project's PlayStore profile. For now the apk can be download from apk websites which have copy of the playstore version. However non-playstore versions are not recommended because they have chances of being hacked and with malicious code. You at your own risk.



Decades ago Soundfont files were packed to reduce their size to manage for storage limited devices. Many developers came up with tools to compress SF2 files. Major of them are sfArk & sfpack formats. Now we have lots of space and those formats are mostly abandoned by their makers. Also the software support from 3rd party is almost dead. Some PC apps like Polyphone support extraction of sfark and sfpack files.

I have ported unsfark & sfArkXtm to Android which handles both sfArk formats. Simple advice is to just stay away from these formats. Convert them to sf2 files and use latest methods to compress them or use sf3 if supported.


Android sfArk extractor port link (n/a right now):

http://play.google.com/store/apps/details?id=org.greh.sfarkextractor


It detects old sfArk (unsfark) & new sfArk (sfArkXtm) and extracts sf2 to destination directory. If you are a developer and you need source of android lib files please mail me i will either upload here or mail you. There is not much of changes done to the code.

Extracting shockwave flash (swf) files in Android using swfextract unofficial Android port

(This project is archived)


Do you have swf files from which you want to extract audio/graphics etc assets? You lost .fla files and want assets back? Or do you want you favorite music or graphics out of swf file?

If above is your need there are swf extractors. swftools is a collection of such tools. But swfextract is the app which extracts assets out. Below is the link of Android port of this app which can very easily do this job.

Link: http://play.google.com/store/apps/details?id=org.greh.swfextractorx

It can extract many files at once. It creates swf named folders and extracts data into it.

Sunday, June 5, 2016

Convert JPG pictures to desired size limits

You clicked a selfie and want to reduce its size from some MBs to few KB as a profile pic? Or a huge scanned document to smaller size? There are software to achieve this task.


1. Jpegoptim

This is free open-source app which optimizes jpg files. You can build it from source for whatever supported Operating system your want. I ported it to Android and with ease it allows JPG optimizations and size reduction without changing resolution. Download it from herer - http://play.google.com/store/apps/details?id=org.greh.imagesizereducer



2. ImageMagick 6.9+

This is free, OpenSource and multiplatform application which is available on almost all latest popular Linux distros and can be downloaded on Windows, Mac. Download it and convert images like this command:

convert -define jpeg:extent=100KB input.png output.jpg


There can be some problem in older versions and jpg to jpg might not work. At-least this is what i encountered while converting from jpg to jpg using extent. ImageMagick 6.8.



3. IrfanView + RIOT plugin
Download IrfanView windows app and using jpg saver plugin we can choose target maximum file size.

Monday, May 23, 2016

Play midi files without midi driver using soundfonts on Android

Audience: Normal user
Platform:  Android


After trying to setup midi in Linux i decided to use Software Synthesis based players with custom soundfonts. Before that i will give basics of midi. Skip to APPs section if you don't want to read about midi system below.


How MIDI works?
Suppose you have memorized a pattern on piano notes and playing it on piano. Unfortunately there is no synthesizer (synth) & speaker attached. So before setting it up with synth you wrote every piano key activity on a paper or a file. You saved it like "C4 C4 D4# ... PITCH_WHEEL ... VOLUME_UP etc". Now you know the pattern, raga or rhythm of your music. Midi file is exactly this saved record!. Means there is no SOUND DATA. You write on paper that you payed a sitar or guitar. But how does that sound? To save that we really need sound file itself. That is the reason midi files are very small because there is no sound data inside mid files.

Now we know what is MID file. Now comes Synthesizer. That missing sound is produced by synth that is why the name. Midi tells a synth to play an instrument named guitar. Therefore depending upon a synth midi sound different. The big problem is that we create a music with our instruments and assume mid file will play same but if instruments are of low quality or even different in timbre may give totally different music. There are many solutions to this. Easiest solution is to produce stream music like mp3 ogg. However what is there are 1000 midi musics but very less disk space?. Its always recommended to keep midi files with original set of instruments so that in future we can reuse them for editing, remixing or other work. What we do is collect all the instruments sounds recorded and save in a bundle called SoundFont. Just like a font which contains set of Alphabets of a language.



So we have a solution.
Midi + SoundFont = Low size & preserved quality of OST (original sound track). 
More details about the topics covered can be found on wiki or tutorials on web.



APPs:

For windows, Mac related midi can be found on this link http://adamrehn.com/articles/playing-midi-soundfonts/


Android Version:
There are some apps which play midi using soundfont viz -

DroindSound, Timidity AE Player, LiveMidi, Midi Voyager, SoundFont-Midi-Player


SoundFont-Midi-Player is my own player i developed to play midi files with different soundfonts fast. It can change soundfonts easily and fast!. Do try it here -

https://play.google.com/store/apps/details?id=org.greh.soundfontmidiplayer

  • Switches between SoundFonts fast
  • Test SoundFont instruments using piano & USB MIDI Keyboard
  • Play Piano together with Midi music. However it also changes the instrument being played in Midi music.
  • Supports USB MIDI keyboard. Supports PITCH BEND messages, Pedal, Volume, Key events. AFAIK not all android apps do this. Tested M-AUDIO KeyRig 49 on Moto-G phone. Doing pitch bend on Android phone using USB Midi keyboard needs good response. I tested this app on some low end phones and it works fine.
  • Samplerates from 22050 to 96000Hz
  • Reverb & Chorus effects
  • Crystalizer audio effect. (Currently disabled)
  • FluidSynth is powerful and i think my app is the only one using latest FluidSynth 1.1.6 with GLIB Android build. Powered by Unmodified FluidSynth 1.1.6 Android Version. If modified source is used i will make the source available here.
  • More features described in PlayStore page.


Features to add:
- Hack Soundfont instrument without altering soundfont files to test midi music


Pro version i am planning to build with more useful features:
- Export as streaming music to ogg- Export self contained midi music i.e. rmid, (mod?)

Saturday, July 6, 2013

Power of Two image resizer

This java app automatically resizes images to closest power of two making them suitable for OpenGL/GLES. Useful for mobile developers using OpenGLES.


Usage: java -jar ClosestPOTResizer.jar in.png OR in.jpg


Its just 7KB app. Runs on java 1.2 or above. The download package contains source code of the app and inside distributable folder the executable jar is present.

Download: ClosestPOTResizer.7z


Source code:

/* ##################################################### */

package closestpotresizer;

import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.IndexColorModel;
import java.io.File;
import java.io.FileInputStream;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
import javax.imageio.stream.ImageOutputStream;

/**
 *
 * @author Bindesh Kumar Singh
 * @contact bindeshkumarsingh@gmail.com
 * @website http://www.ourinnovativemind.in
 */

public class ClosestPOTResizer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
//        System.out.println("" + POTResizer.getClosestPOT(500, false));
//        System.out.println("" + POTResizer.getClosestPOT(500, true));
        try {
            if (args.length < 1) {
                System.out.println("Usage: java -jar ClosestPOTResizer.jar \"in.png OR in.jpg\"");
                return;
            }
            POTResizer r = new POTResizer();
            r.resize(args[0]);
        } catch (Exception ex) {
            Logger.getLogger(ClosestPOTResizer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}

class POTResizer {
   
    public void resize(final String infile) {
        try {
            BufferedImage img = ImageIO.read(new FileInputStream(infile));
           
            // get extension
            int len = infile.length();
            String extension = infile.substring( infile.lastIndexOf('.') + 1, len );
            String outfile = "POT_" + infile;
           
            // get current size
            int w = img.getWidth();
            int h = img.getHeight();

            // closest POT
            int potW = getClosestPOT(w, true);
            int potH = getClosestPOT(h, true);

            // resize to POT
            img = getScaled(img, potW, potH);

            // save resized image
            storeImage(img, new File(outfile), extension, 0.9f);

        } catch (Exception exp) {
            Logger.getLogger(POTResizer.class.getName()).log(Level.SEVERE, null, exp);
        }
    }

    public boolean storeImage(BufferedImage bi, File outputFile, String extension, float quality) {
        // e.g. storeImage( image, new File( "file.png" ), BufferedImageUtil.IMAGETYPE_PNG, 0.8f);
        try {
            //reconstruct folder structure for image file output
            if (outputFile.getParentFile() != null && !outputFile.getParentFile().exists()) {
                outputFile.getParentFile().mkdirs();
            }
            if (outputFile.exists()) {
                outputFile.delete();
            }
            //get image file suffix
            //get registry ImageWriter for specified image suffix
            // BufferedImageUtil.IMAGETYPE_PNG, 0.8f)
            Iterator writers = ImageIO.getImageWritersBySuffix(extension);
            ImageWriter imageWriter = (ImageWriter) writers.next();
            //set image output params
            ImageWriteParam params = new JPEGImageWriteParam(null);
            params.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
            params.setCompressionQuality(quality);
            params.setProgressiveMode(javax.imageio.ImageWriteParam.MODE_DISABLED);
            params.setDestinationType(new ImageTypeSpecifier(IndexColorModel
                    .getRGBdefault(), IndexColorModel.getRGBdefault()
                    .createCompatibleSampleModel(16, 16)));
            //writer image to file
            ImageOutputStream imageOutputStream = ImageIO
                    .createImageOutputStream(outputFile);
            imageWriter.setOutput(imageOutputStream);
            imageWriter.write(null, new IIOImage(bi, null, null), params);
            imageOutputStream.close();
            imageWriter.dispose();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

    static public int getClosestPOT(int number, boolean higher) {
        int ret = 2;
        while (ret < number) {
            ret *= 2;
            if (!higher && ret > number) {
                ret /= 2;
                return ret;
            }
        }
        return ret;
    }

    static public BufferedImage getScaled(BufferedImage img,
            int targetWidth,
            int targetHeight) {

        BufferedImage scaledImage = new BufferedImage(
                targetWidth, targetHeight, img.getType());// BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2d = scaledImage.createGraphics();
        g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                RenderingHints.VALUE_INTERPOLATION_BILINEAR);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.drawImage(img, 0, 0, targetWidth - 1, targetHeight - 1, null);
        return scaledImage;
    }
   
   
}

/* ################################################### */



TAGS:
Power of two image converter resizer POT

Monday, July 1, 2013

Make sprite sheet from frame files with auto-crop and merge.

My another tool for GrehGameEngine Tools Collection.

It takes all user provided images then auto-crops them and merges to build a sprite sheet. It also exports frame information file containing frames information in % of sheet size.

USAGE:
java -jar SpriteSheetFromPNGs.jar "1st.png" "2nd.png" "3rd.png" "#.png" ...  more files, file names are not fixed you can use any png files.

OUTPUT:
"sheet.png" with all images cropped and merged. "sheet.png.conf" with frames position and size data relative to "sheet.png". i.e. x, y, w, h of frames in % of sheet's size.


Download:
SpriteSheetFromPNGs.7z


Requirements:
It is a java app and needs Java 5.


Tags: sprite, sprite sheet,  auto crop and merge

Tuesday, April 2, 2013

HQ2X rescaler, java app

HQnX (hq2x, hq3x, hq4x) algorithm can enhance the quality of a pixelated image. Nice software for pixel artists.


Usage:


java -jar ImageScaler_HQ2X.jar "image_file"


Download link: contains source code (NetBeans project) and binary in dist folder.
ImageScaler_HQ2X.7z



NOTE: The HQ2X code is not mine, it belongs to

http://www.hiend3d.com/hq2x.html
Maxim Steptin

I took hq2x java code from internet and utilized to build this app.

Sprite Frame Designer - animate regions of an Atlas image

I created this app to work with areas/regions of an atlas image to create sprite. This app can let you visualize a sprite sheet by creating frames of desired areas of image. It can export the frames in % size, % position of image. Means resizing image doesn't affect the frame information. However editing positions of framed areas can corrupt the information.

 The package contains a default Sprite sheet i created using my SpriteEditor app.

Tutorial:
1. Open the app by executing "bat" file on Windows, or SH (shell script) file on Linux.
2. Now Open your desired png image with sprites.
3. Select Frame 0, using the Rectangular blinking selection choose your frame area.
4. Create frame 2, do the same.
5. Adjust the animation time by setting value in Delta (ms) field.

The rectangular marker has 2 blinking circles, Left circle moves frame, right circle resizes frame.

You can export the frame information in a text file. This file is specific to the image you opened.

Try the inbuilt animation by executing the app and then opening the walk.conf file from res directory.


Download link:
SpriteFrameDesigner.7z

Software requirements:
1. Linux / BSDs / Windows
2. JRE - java runtime Environment. JDK 5 is used for development.


Example output of frame information in walk.conf present in res directory:
/* start */ 

kull_frames = 4; /* Total frames in walk animation */
Frame_1 = [array] 0.0 0.0 26.171875 93.75 0.0 0.0 100;
Frame_# ...

Frame_4 = [array] 71.09375 0.0 28.125 97.65625 -2.734375 0.0 100;

/* Finish */


Frame_# = [array] X% Y% Width% Height% HotSpotX% HotSpotY% Delta_Milliseconds;

X% = X% of image width. Same for Y%.

Width% = Frame width in % of image width.
Height% = Frame height in % of image height.
HotSpotX,Y = Game Engine dependent thing, ignorable.
Delta = Delta draw time of this frame in milliseconds.

calculated frame pixel positions by example:
Let Image size = 200x100
And Frame_1 is X = 50%, Y = 20%, W = 100%, H = 50%.
X = 100, Y = 20, W = 200, H = 50.  

Search tags:
Sprite sheet visualizer,  sprite sheet area exporter,


Thursday, September 13, 2012

Skeleton Based Sprite Editor

I am finally done with my Skeleton based sprite editor. Almost within 10 days of development my app is ready to use.

Features
  1. It can create skeletons with bones and add image over them.
  2. It can animate the skeletons easily with better motion, just like happens in reality.
  3. Joints behave realistic when moved since the skeletal engine has forward and inverse kinematics implemented.
  4. Made using java, therefore portable on most of operating systems. Tested on Windows & Linux.
  5. Export images of the animations.


Below is a snap of app running in Windows XP.






Limitations / future plannings:
  1. Export of videos. However you can use external snap apps to achieve it.
  2. Documentation, there is no documentation right now, but very soon I'll pack the app with tutorial PDF.
  3. Locked at 30FPS.

Download URL:
SpriteEditor_binary.7z ( version 2013.1.24 )

SpriteEditor.7z ( version 2013.04.02 )




How-to:
To test the app,
1. On Windows: double click the ".bat" file, from Menu click "Open Skeleton For Animation", then select human.skeleton from the res folder of this app from where you executed the bat file. A model will be shown in the screen on right of app window. Go to "Manage Animations" tab. Select any animation e.g. Jump. Click "Work on selected animation", click animate. Use the slider to control  animation speed. Never forget to click "Work on selected animation".

On Linux: execute the shell / .sh file from terminal. Or give executable flag to the sh file from its properties and double click it. The same as above in windows. Please report any bug you find.


If you want more powerful application then head towards Animata:
http://animata.kibu.hu/index.html

This little app is enough to let you achieve complex 2d animation/morphing you desire.



Search TAGs:
Sprite editor skeleton editor sprite maker skeletal animation system skeletal sprite

Wednesday, October 5, 2011

Very good multimedia converters.

I was searching for a converter that can convert audio to mobile formats, i found SUPER (C), it is a great utility for multimedia workers. One more software i found excellent for audio production/conversion is "Extreme Sample Converter".

1. SUPER (C)
Link: http://www.erightsoft.com/SUPER.html

It can convert Audio/videos to many formats including rare MMF (Yamaha's SMAF mobile format, but i haven't tested it). AMR, 3GP,  common audio and videos formats like FLV, SWF, AVI, formats for portable devices like IPhone, BlueRay, Nintendo DS (DPG), etc.


2. Extreme Sample Converter
Link: http://www.extranslator.com/

It can convert to almost all console, mobile, DLS, SF2 sound fonts, VSTi, AKAI, FLAC, YAMAHA etc containers. I converted Microsoft Windows (actually Roland) "General Midi DLS", gm.dls to gm.sf2, SoundFont and using in Midi Synthesis.

Wednesday, October 22, 2008

MyAudioPlayer_portable

My updated portable version audio player - MyAudioPlayer_portable

Features:
Normal interface, module audio format, streaming media OGG, MP#, WAV etc
GUI same for both Linux and Windows. Mac version is not avail currently.

Download: MAP_portable.exe

Sunday, December 16, 2007