Thursday, October 25, 2012

Hydrogen drumkit creator script V5 is here !

YES I KNOW!
It should have been V3, but V3 and V4 sucked big time so i had to put them down ...
amen

Anyway :
here is V5 !

And what does it do that V2 couldn't do ?
It can take an existing drumkit as input and convert it to FLAC and OGG

Why ?
Because that is really cool + it reduces the size of the drumkit drastically.
An example: Gabriel's 'AC guitar strums' drumkit (the one that won the Hydrogen Drumkit contest) is 370MB in it's original form (using WAV samples), 135MB in FLAC format and only 7MB in OGG format !!
Of course the conversion to OGG does have an impact on the sound quality while the FLAC version maintains the same quality as the original.
What format you want to use is you choice, but 1 good reason to use OGG is to save space, both on disk and in RAM when the drumkit is loaded.


How does it work ?
To get help about the syntax just run the script with -h or --help as argument.
For V5 the only difference is the addition of the -c or --convertto option :


 -c, --convertto : convert the drumkit (or rather the samples in the kit)
                   to FLAC or OGG.  This will decrease the drumkit size.
                   usage : -c ogg, or -c flac

Note :
You need to have Sox installed on your pc. The script uses Sox to do the actual audio conversion. (it is available in the repositories of all major distributions, just use synaptic or yum or ... to install it)
If Sox is not installed the script will inform you about this.


Whats the catch ?
OGG and FLAC drumkits can only be used for Hydrogen version 0.9.6 and up.
Currently you cant specify the settings for the conversion to ogg or flac.


Where can i get it + how do i install it ?
EDIT (6/11/2012) : script V5.1 is now available

You don need to install anything.  Just put the script in a dir of your choice, make it executable (chmod +x createH2kit_V5.py) and run it like this :

   ./createH2kit_V5.py -i "/absolute/path/to/drumkit.h2drumkit" -c ogg
or
   ./createH2kit_V5.py -i "/absolute/path/to/drumkit.h2drumkit" -c flac


Whats with all the questions ?
YES, what's with all the questions? stop it!


More info about the previous versions of the script can be found here


Enjoy!

11 comments:

  1. hello!
    long time, no see,

    iḿ getting this but i´m not sure if iḿ doing it wrong, i have to be on the folder (cd) and then write ./createH2kit_V5.py -i "/absolute/path/to/drumkit.h2drumkit" -c ogg ??

    and what does absolute path to drumkit exactly means??

    this is what i get on the console (assuming that i make the chmod right :p)

    superbelin@ubuntu:~/Escritorio/Composiciones musicales en Belvideo/000.0 Neo Hydrogen Drumkits/0.0CrearDrumkit$ ./createH2kit_V5.py -i /home/superbelin/Escritorio/"Composiciones musicales en Belvideo"/"000.0 Neo Hydrogen Drumkits"/"belofilms.com - Glockenspiel 2.0.h2drumkit"
    input is a file > assuming this is a espeak h2 file
    create espeak files
    filepath = /home/superbelin/Escritorio/Composiciones musicales en Belvideo/000.0 Neo Hydrogen Drumkits
    skipping line VP ��yp
    o �
    ���L bo{�� ��g�}�A�� �7��A��� {�c ��=�LwϾϜ���T�s�x�:u��޻ꪞ鹫�����~�� ?)u�䩩3�6�0k � ��:k��I3� �NJE[4Ś���
    +_mڴ� ������[`-۴nռE��kުe� m�����_�ys���AQ0g֬��پ����?������?n��1n��9��vm= �o�`���G��?�� m�[���?���Z�_� ���o����?���^=z
    Y� û
    �>yF

    line format not OK (missing '*')
    �,� oH@�� 0���H����D �]�TX�,���e� _�Df� "�����žpF���m g�l
    6l
    �eS��NS��� ��0�= �U�4�7G � � �_� e��2

    filename = /home/superbelin/Escritorio/Composiciones musicales en Belvideo/000.0 Neo Hydrogen Drumkits/1-1 �� � � �U@P0q\�8�|���ܑH�S^���py�G" �5+ � �5�|�MW$���D���Șߑ�� ���C$��S$r�|�
    $�� �.��k�T !�.wav
    �,� oH@�� 0���H����D �]�TX�,���e� _�Df� "�����žpF���m,Z g�l
    6l
    �eS��NS��� ��0�= �U�4�7G � � �_� e��2
    -w "/home/superbelin/Escritorio/Composiciones musicales en Belvideo/000.0 Neo Hydrogen Drumkits/1-1 �� � � �U@P0q\�8�|���ܑH�S^���py�G" �5+ � �5�|�MW$���D���Șߑ�� ���C$��S$r�|�
    $�� �.��k�T !�.wav"
    Traceback (most recent call last):
    File "./createH2kit_V5.py", line 787, in
    RetValue = main()
    File "./createH2kit_V5.py", line 266, in main
    return CreateEspeakFiles(Input)
    File "./createH2kit_V5.py", line 591, in CreateEspeakFiles
    os.system(command)
    superbelin@ubuntu:~/Escritorio/Composiciones musicales en Belvideo/000.0 Neo Hydrogen Drumkits/0.0CrearDrumkit$

    ReplyDelete
    Replies
    1. hi Belo!

      an example :
      i have a drumkit in my homedir in the subdir 'wavdrumkit' called 'original.h2drumkit' that i want to convert to flac

      the exact syntax would be this:

      ./createH2kit_V5.py -i "/home/thijs/wavdrumkit/original.h2drumkit" -c flac

      so 'absolute/path/to/drumkit' simply means the 'complete' path to the file

      hope this helps (if not, dont hesitate to let me know)
      grtz
      Thijs

      Delete
  2. Hi and thank you for this great script! Just a question: the script creates an XML file and a TAR file. What do i do?

    ReplyDelete
    Replies
    1. hmm ... it should only create a .h2drumkit file
      can you post the complete output of the script here?

      Delete
    2. http://pastebin.com/j3LfS8ru

      Delete
    3. aha
      all you have to do is make sure that the path you enter ends with a '/'
      try -i "/home/stfux/Desktop/samples/" (mind the last slash)
      that should do the trick
      i'll fix that asap

      Delete
    4. i just uploaded script V5.1 that fixes this issue :-)

      Delete
  3. i would like to suggest a new feature:
    it is a bit boring renaming every file with the ID and the velocity, so i was wondering if it could be possible to use a default velocity (0 for example, or given at the beginning of the script when it asks name, author, etc) and use the order of the files inside the directory as ID
    greetings :-)

    ReplyDelete
    Replies
    1. hi,
      it would make it a bit harder -but doable i guess-
      however, you still need to make sure that something in the naming of the files assures that the sorting order is correct.
      by renaming the files to 'x-y name.wav' it is really easy to do

      I might add this later, but it's not a top priority so dont hold your breath ;-)

      Delete
  4. Simply awesome! Thanks for sharing!

    Just a tip that maybe helpful for some people:

    If you are working with Linux (not sure if it works also in MacOs), you can very easily write a script for renaming all the files in a directory for adding the x-y prefix. I'm using a script that I called add-prefix.sh. I can call the script, from a terminal, adding the folder where my wav files are located as a parameter:

    ./add-prefix.sh music-files/

    The script I'm running is:

    #!/bin/bash

    SAVEIFS=$IFS
    IFS=$(echo -en "\n\b")

    folder="$1"
    x=0

    cd $folder
    for file in *
    do
    x=$(($x + 1))
    mv "$file" "`echo $x-0 $file`"
    done

    IFS=$SAVEIFS

    ReplyDelete