Coder Social home page Coder Social logo

cuegen's Introduction

CueGen

GitHub release (latest by date)

Create Rekordbox cue points from Mixed in Key cue points or Rekordbox phrases.

Features

  • Create memory cues or hot cues
  • Merge with existing cue points or overwrite
  • Configure minimum distance in bars to existing cue points
  • Configure maximum number of cue points to create
  • Configure colors
  • Assign colors based on energy level, phrase, or cue number
  • Configure cue point names (comments)
  • Set cue points only for specific tracks (based on name or creation date)
  • All generated cue points can be removed
  • Creates a database backup before each run (optional)
  • Snap cue points to beat grid
  • Add a new Rekordbox My Tag "Energy" with the track's energy level determined by Mixed in Key
  • Set track color according to Energy level
  • Optionally set intro and/or outro cue points to active loop

Requirements

  • Rekordbox 6
  • Windows or macOS
  • Mixed in Key (phrase cue points work without Mixed in Key)

Basics

CueGen operates directly on the Rekordbox database, there is no need to import/export tracks to/from XML.

Rekordbox needs to be shut down when CueGen runs. All tracks should already have been analyzed by Rekordbox to allow CueGen to snap cue points to the beginning of the bar.

In Mixed in Key you should have Serato integration checked on the settings page and have exported cue points (Click "Export cue points for existing files"). Serato integration writes cue points information to ID3 tags within the media files allowing CueGen to read it.

Usage

CueGen is a console application (open an issue if you're interested in a GUI).

Usage: CueGen.Console [OPTION]...
Create Rekordbox cue points from MIK cue points.
Version 1.0.18.0
Append - to option to disable it, e.g. --progress- or -b-.

Options:
  -h, --help                 Show this message and exit
      --dryrun               Do not alter Rekordbox database, only perform a
                               test run
      --hc, --hotcues        Create hot cue points instead of memory cue points
  -m, --merge                Merge with existing cue points (default is enabled)
  -d, --distance=VALUE       Minimum distance in bars to existing cue points (
                               default is 4)
      --colors=VALUE         Comma separated list of hot cue colors, same order
                               as in Rekordbox, top left is 1 (default is 1, 4,
                               6, 9, 12, 13, 14, 15)
  -x, --max=VALUE            Maximum number of cue points to create (default is
                               8)
      --comment=VALUE        Comment template, # will be replaced by energy
                               level (default is "Energy #")
  -g, --glob=VALUE           File glob of track file paths to include, e.g. C:\
                               Music\*.mp3 (default is all in Rekordbox
                               database)
  -r, --remove               Remove all cue points created through this program
  -b, --backup               Create database backup before creating cue points (
                               default is enabled)
  -s, --snap                 Snap cue points to nearest bar (default is enabled)
  -p, --phrase               Create cue points from phrases (default is
                               disabled)
      --my, --mytag          Create MyTag with energy level (default is
                               disabled)
  -e, --energy               Set track color according to energy level (default
                               is disabled)
      --energycolor          Set cue point color according to cue point's
                               energy level (default is enabled)
      --phrasecolor          Set cue point color according to cue point's
                               phrase (default is enabled)
      --progress             Report progress (default is enabled)
      --db, --database=VALUE File path to Rekordbox database (default is
                               autodetect)
  -v, --verbosity=VALUE      Verbosity level (default is warn, possible values
                               are off, fatal, error, warn, info, debug, trace)
  -l, --log=VALUE            File path to write log file to
  -n, --names=VALUE          Phrase names, comma separated (default are Intro,
                               Verse,Bridge,Chorus,Outro,Up,Down)
  -o, --order=VALUE          Phrase group order, comma separated groups of
                               slash separated phrase names (default is Intro,
                               Outro,Verse,Chorus,Bridge,Up/Down)
      --phraselength=VALUE   Minimum length of phrase group in bars (default is
                               4)
      --mindate=VALUE        Minimum creation date of tracks (default is any,
                               format is 2021-12-32T23:31:00, time is optional)
      --li, --loopintro=VALUE
                             Length in beats of active loop intro (default is
                               disabled)
      --lo, --loopoutro=VALUE
                             Length in beats of active loop outro (default is
                               disabled)
      --of, --offset=VALUE   Number of beats to offset cue points by, may be
                               negative (default is 0)                               

Database Backup

CueGen automatically creates a backup of the Rekordbox SQLite database master.db in the Rekordbox folder %AppData%\Pioneer\rekordbox. The backup files will have a datetime suffix, e.g. master.backup.2021-04-04-13-40-05.db. If you want to restore one of these backups, replace the master.db file with a backup file.

Mixed in Key cue points

Mixed in Key detects up to 8 cue points for each track. Each of the cue points gets assigned an energy level (in addition to the overall track energy level). CueGen uses the energy level information to assign a cue point name (such as "Energy 6") and color.

Phrase cue points

Cue points can also be created based on phrase information as analyzed by Rekordbox. For example, you can automatically set cue points where the outro starts and whenever a chorus starts.

Rekordbox assigns phrases according to a "mood" it detects. The mood can be low, mid, or high. For each mood the following phrases exist:

  • Low, Mid: Intro, Verse 1-6, Bridge, Chorus, Outro
  • High: Intro 1-2, Up 1-3, Down, Chorus 1-2, Outro 1-2

CueGen creates cue points whenever a new phrase group starts. A phrase group is a sequence of consecutive phrases that start with the same name but may have different numbers (such as "Verse 1, Verse 2, Verse 3"). Additionally, you can combine phrase groups: For example, if you combine Down and Outro into a phrase group a cue point will be created at the start of a sequence of phrases labeled Down or Outro.

Cue point selection

If the number of cue points that would be generated though either Mixed in Key or phrases exceeds the maximum number of available cue point slots, cue points are created alternatingly at the start and end (first, last, second, next to last, etc).

Colors

There are different types of colors in Rekordbox for memory cues and hot cues. Memory cues can have one of 8 eight different colors: Pink, Red, Orange, Yellow, Green, Aqua, Blue, and Purple.

Hot cues can technically have any color from a 64 color palette, of which only 16 are surfaced in Rekordbox.

Mixed in Key cue points are by default assigned a color according to their energy level. For memory cue points purple is Energy 1 and pink is Energy 8. Hot cues get similar colors picked from the 16 colors palette.

Phrase cue points by default get a color that is similar to the phrase group in Rekordbox (intro is red, chorus is green, etc).

Through the --colors command line option you can choose the palette of 8 colors that are used to map energy level, phrase, or cue point number.

My Tag Energy

Although you can't manually create new My Tag categories through Rekordbox, its database schema allows for additional ones. CueGen can generate an Energy My Tag category from the energy level detected by Mixed in Key.

Unfortunately, it currently seems impossible to use this additional My Tag as a filter.

Active Loops

CueGen can create active loops of configurable length for the first and last cue points.

Thanks

cuegen's People

Contributors

johnsome avatar mganss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cuegen's Issues

Couple of errors

Hi

Great tool. Im getting some errors. about 50% of my library throws an error-
Could not find part of the path
1172/1172Error: Error occurred during creation of cues for "9978813" from "G:/Rekordbox Tracks/Toolroom Ibiza/Ten Story - At The Downlow (Original Mix).mp3" System.IO.DirectoryNotFoundException: Could not find a part of the path 'G:\Rekordbox Tracks\Toolroom Ibiza\Ten Story - At The Downlow (Original Mix).mp3'.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String , FileMode , FileAccess , FileShare , FileOptions )
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
at System.IO.Strategies.OSFileStreamStrategy..ctor(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
at TagLib.File.LocalFileAbstraction.get_ReadStream()
at TagLib.File.set_Mode(AccessMode value)
at TagLib.NonContainer.File.Read(ReadStyle propertiesStyle) at TagLib.File.Create(IFileAbstraction abstraction, String mimetype, ReadStyle propertiesStyle)
at CueGen.TagFile..ctor(String filePath)
at CueGen.Content.GetTag()
at CueGen.Generator.CreateCuesForContent(UInt64& maxId, SQLiteConnection db, Content content)
at SQLite.SQLiteConnection.RunInTransaction(Action action)
at CueGen.Generator.Generate()

I cannot remove any cuepoints added by this program.
I cannot create memory points (not clear on how to do this)

Question. Can the phrase "Chorus" be renamed to drop? I can see a function but cant rename.

A UI version would be amazing, id share it with the Rekordbox groups im involved in for sure

Thanks

Ability To Write Serato Cue Points

Not an issue, but it sure would be amazing to be able to write rekordbox cue points as serato cue points. I was looking through the code and i see the definitions of how you are reading in the serato cue points (it's all a bit foreign to me). I don't have mixed in key, but would love for rekordbox to be able to analyze (phrase/bpm/beatgrid) and then just apply the same cue points your applying to the rekordbox database to the actual MP3's.

access to path denied error on macOS

I am getting the following error for every track when using on macOS Monterey, even with sudo:

Error: Error occurred during creation of cues for "99638553" from "FILEPATH.mp3" System.UnauthorizedAccessException: Access to the path 'FILEPATH.mp3' is denied.
 ---> System.IO.IOException: Operation not permitted
   --- End of inner exception stack trace ---
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , OpenFlags , Int32 )
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
   at TagLib.File.LocalFileAbstraction.get_ReadStream()
   at TagLib.File.set_Mode(AccessMode value)
   at TagLib.NonContainer.File.Read(ReadStyle propertiesStyle)   at TagLib.File.Create(IFileAbstraction abstraction, String mimetype, ReadStyle propertiesStyle)
   at CueGen.TagFile..ctor(String filePath)
   at CueGen.Content.GetTag()
   at CueGen.Generator.CreateCuesForContent(UInt64& maxId, SQLiteConnection db, Content content)
   at SQLite.SQLiteConnection.RunInTransaction(Action action)
   at CueGen.Generator.Generate()

MacOS : "System.NullReferenceException: Object reference not set to an instance of an object" for every mp3 in the library

Steps :

  1. Analyzed tracks in Rekordbox and then quit it.
  2. Imported the same tracks in MIK and analysed for key, with serato option checked, exported cue points for the entire collection.

Tried cuegen after these 2 steps and got the error as pasted in Title. Cue points were not visible at all by this time.
So, went ahead with a workaround to import cue points in Rekordbox, step 3 is that workaround.
3. Used a third party app called "MIXO". Imported the same tracks to which cues were written in step 2, into mixo, and exported as rekordbox xml.
4. Imported this Rekordbox xml into rekordbox through xml browse feature in settings, successfully got colour coded hot cues on entire library. But for some tracks these hot cues were all aligned, while for others they were a little off, while way too off(more than a beat or two at around 110bpm) for a few tracks.
5. Again backed up entire library with backup music as well option, for just in case, quit rekordbox.
6. went to cuegen again, thinking that maybe earlier error was coming as cue points were not visible at all, but same error displayed for every song in the library.

Version and other details are here :
Mac OS High Sierra
Rekordbox 6.5.3
Mixed in Key 8.5.3
Mixo 0.39.0

Here attaching an Mp3 file by going to finder and into rekordbox backed up music files, so as per its latest state I believe.
0377013E_74. DJ Snake - Let Me Love You.mp3.zip

Mac OS Version

Hi,

i use your Tool for Windows and it works awesome. I'm very interesting in to get a Version for Mac OS.
It would be great if you make my dreams come true. :)

Regards,
William

Rekordbox 6.5.x not recognizing the changes

Hello,

I’ve used the .exe to set the cue points but it seems that they are not appearing in the rekordbox 6. The progress mark so fine and is executing successfully finishing at 100%. Also I’ve checked the modified date for the .db file and it’s modified when I called the script.

do you have any suggestions?

Thank you for your work !

Enhancement: Offset cue

Hi, thx for a great piece of software.

One little enhancement wish though. It would be great if you could add an offset backbeat to a drop or phrase group.

Today a cue is set at the start of a phrase group. If one could add option i.e. "-backbeat=-16" then the cue would be set 16 beats prior to the start of the phrase.

Hope it makes sense.
Tia

Mac OS Error Message "Error: Error occurred during creation of cues"

Error: Error occurred during creation of cues for "49682660" from "/Users/Anonymous/Downloads/track.mp3" System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at CueGen.TagFile..ctor(String filePath)
at CueGen.Generator.CreateCuesForContent(UInt64& maxId, SQLiteConnection db, Content content)
at CueGen.Generator.<>c__DisplayClass19_3.b__8()
at SQLite.SQLiteConnection.RunInTransaction(Action action)
at CueGen.Generator.Generate()

I got this for every mp3 file.

Do you support Flac files ?

Your tool is awesome.
But unfortunately nothing happens for Flac files :

nformation: Reading tag for "99983284" from "/Users/XXXXX/XXXX/XXX/XX XX/73 - Bastille - Revolution.flac"
Information: Found 0 cue points
Information: Removing existing generated cue points for "99983284"
Information: Can create 8 cue points
Information: Updating contentCue "043db43a-054c-4a92-9c6a-35ec40af1d4f"
Information: Finished cue points creation with errors

I see cue points in MIK

No merge?

Hi, first of all....great piece of software 👍

I want to add hotcues as well as memory cues to my tracks. I'm not using MIK.

The first run creating the hotcues with --prhase is working very well.
Then I want to add some memory cues 16 bars prior to Chorus and Down phrases, but can't seem to make it work.
This: CueGen.Console --merge --names=Chorus --phrase --offset=-16 is deleting the hotcues and placing memory cue 16 bars prior to every phase....can you help?

Upgraded MIK 8->10 error

Hi Michael,
I've upgraded my MIK to version 10 and I can't get cuegen to add cues to my DB anymore. Is there a way to reset it all?

GUI version

1st! i love your tool, it's great and don't know why MiK use that great way by themselfs.

So you said if someone is intertrested in a GUI, he should write a issu. So i do it here. A lot of my DJ Friends like to use it to but never used console stuff - so they would happy to have an GUI version. THXAL

Not working on Macbook M1

Hi,

Would it be possible to get this running on Macbook M1 architecture? Would love to use it.

Error trying this:
Error: Error occurred during creation of cues for "99993103" from "..." System.IO.FileNotFoundException: Could not find file '...'.
File name: '...'
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , OpenFlags , Int32 )
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
at System.IO.Strategies.OSFileStreamStrategy..ctor(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
at TagLib.File.LocalFileAbstraction.get_ReadStream()
at TagLib.File.set_Mode(AccessMode value)
at TagLib.NonContainer.File.Read(ReadStyle propertiesStyle) at TagLib.File.Create(IFileAbstraction abstraction, String mimetype, ReadStyle propertiesStyle)
at CueGen.TagFile..ctor(String filePath)
at CueGen.Content.GetTag()
at CueGen.Generator.CreateCuesForContent(UInt64& maxId, SQLiteConnection db, Content content)
at SQLite.SQLiteConnection.RunInTransaction(Action action)
at CueGen.Generator.Generate()

Script runs with no errors but rekordbox showing no cues

First off, huge kudos on this project. Super useful.

I'm running this on OSX, Rekordbox 6.7.0. I'm trying to run it on 1 specific file to test it out. Here's the command I'm using:

./CueGen.Console -p -v trace -g "/Users/danyal/Google Drive/My Drive/Music/DJ/lossless/Dale Howard - Drums.aiff"

I want it to generate the cue points using phrase, not mixed in key. File is analyzed and has analysis lock on. Here's the output:

Information: Starting CueGen version "1.0.34.0"
Information: Rekordbox database is at "/Users/danyal/Library/Pioneer/rekordbox/master.db"
Information: Creating database backup at "/Users/danyal/Library/Pioneer/rekordbox/master.backup.2023-04-20-18-45-20.db"
Information: Getting contents from database "/Users/danyal/Library/Pioneer/rekordbox/master.db"
Information: 2371 contents read
Information: Getting cues from database "/Users/danyal/Library/Pioneer/rekordbox/master.db"
Information: 12 cues read
Information: Getting contentCues from database "/Users/danyal/Library/Pioneer/rekordbox/master.db"
Information: 28 contentCues read
Information: Getting SongMyTags from database "/Users/danyal/Library/Pioneer/rekordbox/master.db"
Information: 12066 songMyTags read
Information: Finished cue points creation without errors

Cue point 32 beats before Chorus

Hi,

Thank you for your work, it's a great great tools :)

I would like ask you if possible that create a cue point 32 bets before the Chorus ?

I try with 2 run of your tool but when I start the second run all cue point is deleted ?

I use your tool withe the phaser mode

Thanks

Option to snap to hot cue point

Is there an option to set memory cues from a hot cue point? I have already manually set some hot cue points for my tracks but the merge option doesn't seem to work with hot cues. Ideally I would need memory cues 8 or 16 bars from the hot cue point in each direction.

It will also throw an error when running --phrase-length 16 -m -s

Error: Error occurred during creation of cues for "192498168" from "C:/Music/DnB 2022/01 - Break & Total Science - Blame You.mp3" System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* , Int32 )
at System.Convert.FromBase64String(String s)
at CueGen.TagFile..ctor(String filePath)
at CueGen.Content.GetTag()
at CueGen.Generator.CreateCuesForContent(UInt64& maxId, SQLiteConnection db, Content content)
at CueGen.Generator.<>c__DisplayClass20_3.b__6()
at SQLite.SQLiteConnection.RunInTransaction(Action action)
at CueGen.Generator.Generate()

Error - Not valid base64 string

Hi, throwing this error on all but 2 songs when I try to add cues:

Error occurred during creation of cues for "96617" from "C:/Users/hears/Desktop/Stuff For LEvels/swedish_house_mafia_-don't_you_worry_child(intro_edit).mp3" System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* , Int32 )
at System.Convert.FromBase64String(String s)
at CueGen.TagFile..ctor(String filePath)
at CueGen.Content.GetTag()
at CueGen.Generator.CreateCuesForContent(UInt64& maxId, SQLiteConnection db, Content content)
at CueGen.Generator.<>c__DisplayClass20_3.b__6()
at SQLite.SQLiteConnection.RunInTransaction(Action action)
at CueGen.Generator.Generate()

Any clue how to fix this?

rekordbox cloud

when using rekordbox cloud sync none of the files are found, in rekordbox the path seems to be dropbox/folder/file

is there a way to input in the rest of the path to the dropbox folder?

Error: Error occurred during creation of cues

Hey. Got this error:

   at TagLib.File.Create(IFileAbstraction abstraction, String mimetype, ReadStyle propertiesStyle)
   at CueGen.TagFile..ctor(String filePath)
   at CueGen.Content.GetTag()
   at CueGen.Generator.CreateCuesForContent(UInt64& maxId, SQLiteConnection db, Content content)
   at CueGen.Generator.<>c__DisplayClass20_3.<Generate>b__6()
   at SQLite.SQLiteConnection.RunInTransaction(Action action)
   at CueGen.Generator.Generate()

Can you help please? Is it some kind permission issue or something else?

MacOS broken?

Struggling to get this working on MacOS.

Zip extracts CueGen.Console - Yet I'm not able to run this at all. Am I missing something obvious?

disable merge

i want to disable the merge function. How could i do that?
I think -m for merge is enabled for default.

Enhancement: Simultaneous creation of Memory and Hot Cues

Hi Michael, this is an excellent tool - thank you for creating it!
I've spent the evening testing it with my rekordbox library though I wasn't able to get it to generate both Memory and Hot Cues for my tracks.
(Why would one want to do this? Hot Cues are very handy on DJ Controllers, but older club gear and displays tend to only support Memory Cues - so personally I use them both the same way, with manually added memory cues where I want warnings etc).

Currently, if I have the tool generate one and then the other, they overwrite each other, even when using --merge.
Is this possible and I'm just holding it wrong?
Or if not, could it be implemented as an option?
Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.