12 posts / 0 new
Last post
kristopher wess...
Offline
Joined: 03/25/2015 - 00:07
creating content packs?

How are content packs made/ compiled?

 

mike
mike's picture
Online
Joined: 12/18/2011 - 15:53
Are you talking about for

Are you talking about for Google Play? Or just sharing.

The .causticpack format is just a zip file that Caustic can load and extract into the user's documents directory.

Putting something up on Google Play requires you to build an installer. I know Rej had one years ago that compiled in Eclipse but the project he used doesn't really compile anymore, the Android SDK has changed.

The only other option is to write an installer using Android Studio and Java.

smarty
smarty's picture
Offline
Joined: 12/18/2016 - 22:45
this is a sample i made..tell

this is a sample i made..tell me if its good...am starting to learn caustic doh but i can play many instruments in real live

Caustic Song file (optional): 

kristopher wess...
Offline
Joined: 03/25/2015 - 00:07
well it seems as though

well it seems as though installers already exist lol

 

mike
mike's picture
Online
Joined: 12/18/2011 - 15:53
> well it seems as though

well it seems as though installers already exist lol

Eh yeah I get the joke but it's not easy if you don't know what you are doing. :)

If you can compile an Android Studio app, then you are half way there. There is no majic when it comes to creating an installer that copies files from the compiled assets of the apk to the device.

I think the thing is, I just don't want to share my code right now. smiley (If you know how to use Android Stuido)

askdougtech
askdougtech's picture
Offline
Joined: 10/28/2016 - 14:36
I have some sounds that I

I have some sounds that I have developed for Caustic that I would like to release for free in the Play Store. Does anyone have any Android SDK code they can release to the community that would allow me to compile an APK content pack without reinventing the wheel?

Jason
Jason's picture
Offline
Joined: 03/23/2012 - 21:32
It's not that easy.  

It's not that easy.   Developers have specific guidelines and code for allowing anything to be added to their host app.   Your best bet is to follow the advice above, and compile into a ZIP and then convert it to the CausticPack format.    That can be much more easily and freely shared with all platforms that host Caustic.

The idea for posting on public markets suggests that you have actual quality and great quantity of truly original content, support docs or videos, sounds and presets for all synth machines, and much more.
Anything I've made over the past four years has taken months and months of development and prep work before it even saw the light of day -- a painfully time-consuming effort.

Furthermore, the requirements for GooglePlay have been amped up significantly over the past two years, and you have to constantly keep up with the regs and changes, or your listings can be suspended.  Amazon is even worse (I've shut down that operation recently myself) The whole process is not as easy as you think it may be.

For those thinking they will make some quick big money will be for a long term disappointment.  Go CausticPack. Store it and link to it on DropBox (a well-known and safe storage place to safely link to on public forms and social media) Just sayin'.   

askdougtech
askdougtech's picture
Offline
Joined: 10/28/2016 - 14:36
Is there a guide for creating

Is there a guide for creating .causticpack files?

mike
mike's picture
Online
Joined: 12/18/2011 - 15:53
> Is there a guide for

Is there a guide for creating .causticpack files?

It's a zip file with the root being "caustic". So lay the file out just like the caustic folders, then zip with "caustic" at the root of the zip file.

- MyZip/caustic/presets/pcmsynth/my-pack/PCMPreset.pcmsynth

- MyZip/caustic/presets/beatbox/my-pack/MyKit.beatbox

- MyZip/caustic/samples/pcmsynth/my-pack/SoundFile.wav

askdougtech
askdougtech's picture
Offline
Joined: 10/28/2016 - 14:36
Thanks Mike. Back in the 80s

Thanks Mike.

mike
mike's picture
Online
Joined: 12/18/2011 - 15:53
Yeah, if you are using

Yeah, if you are using Android Studio, you need to create an assets folder (through the menu).  In that folder you then place your "caustic" root with all you stuff.

The tricky part is getting at those assets to copy over onto the device. The thing is, the assets are NOT in a directory when you app is installed, they are just a blob of bytes.

So you need to parse the files and get a file stream.

Here is a check of what I use in my file service;

public List<PackInstallFile> collectPackFiles(AssetManager assetManager) throws IOException {
    List<PackInstallFile> files = new ArrayList<>();

    collectPaths(assetManager, files, "caustic");

    return files;
}

private void collectPaths(AssetManager assetManager,
                          List<PackInstallFile> files,
                          String path) throws IOException {

    String[] children = assetManager.list(path);
    for (String child : children) {

        if (child.contains(".")) {
            files.add(new PackInstallFile(path + "/" + child));
        } else {

            //String chunk = path.equals("") ? child : "/" + path;
            collectPaths(assetManager, files, path + "/" + child);
        }
    }
}

Then an AsyncTask to install in the background;

@Override
protected Integer doInBackground(List<PackInstallFile>... params) {

    List<PackInstallFile> files = params[0];
    total = files.size();

    for (int i = 0; i < total; i++) {
        current = i;
        currentFile = files.get(current);

        try {
            currentFile.install(assetManager, targetDirectory);
            publishProgress(currentFile, current, total);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    return null;
}

Then the installer, this is in the PackInstallFile that wraps the File pointer to each individual file collected from the assets folder.

public void install(AssetManager assetManager, File targetDirectory) throws IOException {

    targetFile = new File(targetDirectory, assetPath);
    copyAsset(assetManager, rawAssetPath, targetFile);
}


private static void copyAsset(AssetManager assetManager, String fromAssetPath, File targetFile) throws IOException {
    InputStream in;
    OutputStream out;

    in = assetManager.open(fromAssetPath);

    //targetFile.mkdirs();

    // target file already exists, no overwrite
    if (targetFile.exists())
        return;

    if (!targetFile.getParentFile().exists())
        targetFile.getParentFile().mkdirs();

    //targetFile.createNewFile();

    out = new FileOutputStream(targetFile);

    copyFile(in, out);

    in.close();

    out.flush();
    out.close();
}

Note these are chunks of code in my whole framework but they should be quite complete to help you out.

 

askdougtech
askdougtech's picture
Offline
Joined: 10/28/2016 - 14:36
Mike, thank you for

Mike, thank you for supporting the Caustic community! Much appreciated!