Korg Forums Forum Index Korg Forums
A forum for Korg product users and musicians around the world.
Moderated Independently.
Owned by Irish Acts Recording Studio & hosted by KORG USA
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scripts for dealing with e2 pattern files

 
Post new topic   Reply to topic    Korg Forums Forum Index -> Korg Electribe
View previous topic :: View next topic  
Author Message
russellclarke
Junior Member


Joined: 07 Jun 2019
Posts: 59

PostPosted: Fri Jun 07, 2019 11:53 pm    Post subject: Scripts for dealing with e2 pattern files Reply with quote

Some python scripts for converting e2 pattern files. Should work for e2s with little editing.

https://github.com/synthsofts/e2

    e2all2pat.py - Converts allpat file to a directory of e2pat files.

    e2pat2syx.py - Converts a pattern file in e2pat format to a pattern file in sysex format.

    e2syx2pat.py - Converts a pattern file in sysex format to pattern file in e2pat format.

    e2seqrot.py - Rotates sequence of specified part by specified number of steps. Takes e2pat as input.

    e2pat2all.py - Create allpatterns from a single pattern.

    e2ev.py - Split event recording by pattern, create stems, mute parts, extract and replace patterns.


Last edited by russellclarke on Thu Jul 18, 2019 7:28 pm; edited 2 times in total
Back to top
View user's profile Send private message
TheDoctor
Full Member


Joined: 28 Mar 2019
Posts: 162

PostPosted: Sat Jun 08, 2019 2:52 pm    Post subject: Re: Scripts for dealing with e2 pattern files Reply with quote

russellclarke wrote:
Some python scripts for converting e2 pattern files. Should work for e2s with little editing.

https://github.com/synthsofts/e2

    e2all2pat.py - Converts allpat file to a directory of e2pat files.

    e2pat2syx.py - Converts a pattern file in e2pat format to a pattern file in sysex format.

    e2syx2pat.py - Converts a pattern file in sysex format to pattern file in e2pat format.

    e2seqrot.py - Rotates sequence of specified part by specified number of steps. Takes e2pat as input.

I'm sorry if I sound stupid but can you explain me how it works? I don't have experience with python script
Back to top
View user's profile Send private message
russellclarke
Junior Member


Joined: 07 Jun 2019
Posts: 59

PostPosted: Sat Jun 08, 2019 3:39 pm    Post subject: Reply with quote

I've only tested these scripts on a GNU/Linux system with an e2.

Install Python 3
https://realpython.com/installing-python/

Download zip file of the scripts
https://stackoverflow.com/a/6466993

Extract the zip file.

Open a terminal and change directory to the folder with the scripts in.


Run a script with the --help flag to see a list of options and required arguments, for example:
Code:
python e2all2pat.py  --help



To split an allpat file into a directory of pattern files, the easiest way is to put the allpat file in the same folder as the scripts and run:
Code:
python e2all2pat.py

This should create a folder named split_allpat which contains 250 patterns.


To convert a pattern from e2pat format to syx format, put the pattern file in the same folder as the script and run:
Code:
python e2pat2syx.py filename.e2pat

This will create a sysex file which will dump the pattern to the current pattern on the e2. Save the pattern on the e2 by pressing write twice.


You can create a sysex file which will dump a pattern to a specific pattern number and automatically save by passing the -p flag with a number, for example:
Code:
python e2pat2syx.py -p 64 filename.e2pat

This will create a sysex file that will save the pattern to slot 64 on the e2.


Converting a pattern in syx format to a e2pat format is similar.
Code:
python e2syx2pat.py filename.syx



To rotate the sequence of part 9 by 4 steps, run:
Code:
python e2seqrot.py -p 9 -r 4 -i filename.e2pat

This will overwrite the pattern file with a new version.

Use the -o flag to specify a new output file and keep the original intact. For example:
Code:
python e2seqrot.py -p 9 -r 4 -i filename.e2pat -o rotated.e2pat



These scripts are the early stages of a larger project which is currently on hold. They're not very user friendly yet, so ask if you need further help. They may need minor edits to work on windows and for e2s files.


Last edited by russellclarke on Sat Jun 08, 2019 3:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
TheDoctor
Full Member


Joined: 28 Mar 2019
Posts: 162

PostPosted: Sat Jun 08, 2019 3:52 pm    Post subject: Reply with quote

russellclarke wrote:
I've only tested these scripts on a GNU/Linux system with an e2.

Install Python 3
https://realpython.com/installing-python/

Download zip file of the scripts
https://stackoverflow.com/a/6466993

Extract the zip file.

Open a terminal and change directory to the folder with the scripts in.


Run a script with the --help flag to see a list of options and required arguments, for example:
Code:
python e2all2pat.py  --help



To split an allpat file into a directory of pattern files, the easiest way is to put the allpat file in the same folder as the scripts and run:
Code:
python e2all2pat.py

This should create a folder named split_allpat which contains 250 patterns.


To convert a pattern from e2pat format to syx format, put the pattern file in the same folder as the script and run:
Code:
python e2pat2syx.py filename.e2pat

This will create a sysex file which will dump the pattern to the current pattern on the e2. Save the pattern on the e2 by pressing write twice.


You can create a sysex file which will dump a pattern to a specific pattern number and automatically save by passing the -p flag with a number, for example:
Code:
python e2pat2syx.py -p 64 filename.e2pat

This will create a sysex file that will save the pattern to slot 64 on the e2.


These scripts are the early stages of a larger project which is currently on hold. They're not very user friendly yet, so ask if you need further help. They may need minor edits to work on windows and for e2s files.

Thanks man,I really appreciate it
Back to top
View user's profile Send private message
Poumtschak
Senior Member


Joined: 06 Jan 2007
Posts: 295
Location: GMT+1

PostPosted: Mon Jun 10, 2019 9:46 am    Post subject: Re: Scripts for dealing with e2 pattern files Reply with quote

russellclarke wrote:
Some python scripts for converting e2 pattern files. Should work for e2s with little editing.

Very cool, thanks!
The hard pattern decoding work being already done in Max4Live, that could be the foundation of an universal pattern editor in Python.
http://www.maxforlive.com/library/device/2816/electribe2-pattern-editor
http://www.maxforlive.com/library/device/4128/electribe-control

TheDoctor wrote:
I'm sorry if I sound stupid but can you explain me how it works? I don't have experience with python script

You can also use Thonny, which is a great no brainer Python editor and environment for Windows, Mac and Linux. More user friendly.

https://thonny.org/
_________________
My electribe2 lousy patterns and stuff | KORG gear: NTS-1, nanoKEY2, electribe2/2S, WS/SR, WS/EX (on storage)
Back to top
View user's profile Send private message
russellclarke
Junior Member


Joined: 07 Jun 2019
Posts: 59

PostPosted: Fri Jul 05, 2019 12:33 am    Post subject: Reply with quote

pierluigi added e2pat2all.py.

This adds a script to take an input "Init" pattern file (e.g. 001_Init.e2pat) and use to initialize an entire .e2sallpatterns file. This simplifies the creation of default starting point for different projects.

Workflow:

    Create the desired settings for the reference Init pattern on the E2S

    Export the individual pattern using the DATA UTILITY menu

    Pass the new pattern file using the -i flag, e.g.
    Code:
    python e2pat2all.py -i 001_Init.e2pat


    Optionally pass a .e2allpatterns file (a default is provided) to maintain preferred global settings

    Load the generated allpatterns file (merged_allpat/electribe_sampler_allpattern.e2sallpat) in the E2S using the DATA UTILITY menu option


_________________
https://freesound.org/people/bangcorrupt/
http://ccmixter.org/people/bangcorrupt
https://github.com/bangcorrupt
Back to top
View user's profile Send private message
russellclarke
Junior Member


Joined: 07 Jun 2019
Posts: 59

PostPosted: Thu Jul 18, 2019 7:48 pm    Post subject: Reply with quote

Added e2ev.py - Split event recording by pattern, create stems, mute parts, extract and replace patterns.


Print info on patterns found in file.e2ev:
Code:
python e2ev.py file.e2ev -i



Split a multi pattern event recording into multiple single pattern event recordings:
Code:
python e2ev.py file.e2ev -s



Create a stem event recording consisting of parts 1, 5 and 16 named 'drums':
Code:
python e2ev.py file.e2ev -c 0 4 15 -n drums

This will create file_drums_stem.e2ev



Mute channel 16 of the event recording:
Code:
python e2ev.py file.e2ev -m 15

This will overwrite the original file.e2ev



Extract all patterns files found in file.e2ev:
Code:
python e2ev.py file.e2ev -e

Patterns will be saved as file_pat_x.e2pat



Replace the second pattern of file.e2ev with pattern.e2pat:
Code:
python e2ev.py file.e2ev -r 1 -p pattern.e2pat



More information on event recording file format:
https://pastebin.com/EFdkK2eq
_________________
https://freesound.org/people/bangcorrupt/
http://ccmixter.org/people/bangcorrupt
https://github.com/bangcorrupt
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Korg Forums Forum Index -> Korg Electribe All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group