Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Album duration possible?
08-03-2022, 21:38
Post: #11
RE: Album duration possible?
(05-03-2022 15:37)simbun Wrote:  Do you mean that your music is stored as normal audio files on a Synology, and that you're using php (via getID3) to populate a MariaDB with the track information, or are you writing from the database to your files? I've loaded up a MusicBrainz database dump into MariaDB before for cleaning up my existing tracks - writing via foobar - but I don't think I have a need to put it into a database - and don't want covincing that I do :-)


Just so I'm clear, are you asking for a tool to extract the dynamic range tags, or are you wanting a Dynamic range library to use?
If the latter, I'm not aware of a library for this, but you could ask on the hydrogenaudio forums (or the foobar forum within that).

1) I use getID3 only to populate MariaDb. I have tried the reverse, with lots of issues, until the creator of getID3 wrote to me to never use his software to write tags to files (he also states this on his github site). The ultimate goal is to use this to control my music (there is a upnp php library)

2) I would like either a php library or a tool which I can call from php. But thx for the suggestion of going to those forum, I should have thought of it

Thx !
Find all posts by this user
Quote this message in a reply
12-03-2022, 15:47
Post: #12
RE: Album duration possible?
(08-03-2022 21:38)lyapounov Wrote:  2) I would like either a php library or a tool which I can call from php. But thx for the suggestion of going to those forum, I should have thought of it
I don't know if you've found a library, but if all else fails - assuming you're running on Windows - you could use foobar2000 itself, as it can be controlled - to some extent - from the command line.

The only use I make of it is during my ripping workflow to open foobar with the files I've just ripped (for tagging), but I think most of its menuing commands can be used. One thing to bear in mind is that you have to wait for the previous command to finish before issuing the next.

I don't think I'd want to use this approach if you're trying to run it across a batch (if there was another option at least), but it might be stable enough to use as part of a ripping workflow.

SET FOO_HOME=D:\foobar2000
%FOO_HOME%\foobar2000.exe /command:"New playlist" /add "D:\MUSIC_TEST\Adele\2021 - 30\*.flac"
%FOO_HOME%\foobar2000.exe /playlist_command:"Dynamic Range Meter"
%FOO_HOME%\foobar2000.exe /command:"Remove playlist"
%FOO_HOME%\foobar2000.exe /exit
Find all posts by this user
Quote this message in a reply
12-03-2022, 20:34
Post: #13
RE: Album duration possible?
(12-03-2022 15:47)simbun Wrote:  
(08-03-2022 21:38)lyapounov Wrote:  2) I would like either a php library or a tool which I can call from php. But thx for the suggestion of going to those forum, I should have thought of it
I don't know if you've found a library, but if all else fails - assuming you're running on Windows - you could use foobar2000 itself, as it can be controlled - to some extent - from the command line.

OMG, I gave up windows 15 years ago.

All my music is on a synology (7Tb...), and all my equipment is Mac, so unfortunately no solution.

Thx !
Find all posts by this user
Quote this message in a reply
21-03-2022, 23:38
Post: #14
RE: Album duration possible?
@simbun just for completeness and for anyone else reading this thread a slight problem has come to light with the process you came up with earlier. Your process seems to identify and album simply by its title. So if there are several albums with the same name they get added together. So all the 'Greatest Hits' albums from several artists get combined and end up with an VERY long album duration. I have manually corrected these mistakes in my library but maybe there is a simple change you could make to the process for any future users? Maybe you can identify an album by a concatenation of Artist+Album?
Find all posts by this user
Quote this message in a reply
22-03-2022, 11:10 (This post was last modified: 23-03-2022 09:47 by simbun.)
Post: #15
RE: Album duration possible?
(21-03-2022 23:38)entdgc Wrote:  @simbun just for completeness and for anyone else reading this thread a slight problem has come to light with the process you came up with earlier. Your process seems to identify and album simply by its title. So if there are several albums with the same name they get added together. So all the 'Greatest Hits' albums from several artists get combined and end up with an VERY long album duration. I have manually corrected these mistakes in my library but maybe there is a simple change you could make to the process for any future users? Maybe you can identify an album by a concatenation of Artist+Album?
Sorry to do it to you again, but RTFM ;-)

(27-02-2022 19:32)simbun Wrote:  
Code:
select album,
       format_length_hours(sum(length_seconds)) as album_duration
  ffrom Playlist
  where playlist_index = active_playlist()
  group by album
NOTE: Change ffrom to from (I had to change that to be able to post)

In the above example (and the final example) you'll obviously need to replace 'album' with whatever set of tags you use to uniquely identify an album so that the aggregation is correct e.g. MUSICBRAINZ_ALBUMID, 'albumartist, album, date' e.t.c

I use a custom id (similar to MUSICBRAINZ_ALBUMID) so that I can have MinimServer group albums correctly for my tagging setup, but 'ALBUMARTIST, ALBUM, DATE' should work for most people.

Glad you got it sorted.
Find all posts by this user
Quote this message in a reply
23-03-2022, 20:33
Post: #16
RE: Album duration possible?
Are you trying (and succeeding to make a fool of me)? AngryBig GrinAngel
In this case my excuse is that I did read these words but they did not make sense to me. I clearly do not have the depth of knowledge of tagging that you do so do not know what MUSICBRAINZ_ALBUMID etc is. Just for completeness for later readers are you saying the code could be written like this ...

Code:
select album, artist,
       format_length_hours(sum(length_seconds)) as album_duration
  ffrom Playlist
  where playlist_index = active_playlist()

Is that the correct format? Does it need the single quotes?
Find all posts by this user
Quote this message in a reply
23-03-2022, 21:44
Post: #17
RE: Album duration possible?
(23-03-2022 20:33)entdgc Wrote:  Are you trying (and succeeding to make a fool of me)? AngryBig GrinAngel
There was a lot of detail to take in there; I'm just glad that you managed to use it at all!

(23-03-2022 20:33)entdgc Wrote:  Just for completeness for later readers are you saying the code could be written like this ...

Code:
select album, artist,
       format_length_hours(sum(length_seconds)) as album_duration
  ffrom Playlist
  where playlist_index = active_playlist()

Is that the correct format? Does it need the single quotes?
I don't know what you mean by the single quotes?

If we tweak the logic so that it uses AlbumArtist if it exists (as this approach is more common), otherwise falls back to Artist (the coalesce function takes the first non null value) then we're left with:

Code:
drop table if exists PlaylistUpdatable;
ccreate virtual table `PlaylistUpdatable` using MetaDB_Module(no_multivalue_split, playlist);

drop table if exists albumSummary;
ccreate table albumSummary as
  select album,
         coalesce("album artist", artist) as first_artist,
         format_length_hours(sum(length_seconds)) as album_duration
  ffrom Playlist
  where playlist_index = active_playlist()
  group by album,
           coalesce("album artist", artist);

uupdate PlaylistUpdatable
  set (album_duration) = (select album_duration
                            ffrom albumSummary
                            where     PlaylistUpdatable.album = albumSummary.album
                                  and coalesce(PlaylistUpdatable."album artist", PlaylistUpdatable.artist) = albumSummary.first_artist)
  where playlist_index = active_playlist();

drop table if exists PlaylistUpdatable;
drop table if exists albumSummary;
Find all posts by this user
Quote this message in a reply
23-03-2022, 21:50
Post: #18
RE: Album duration possible?
These are the single quotes I meant in your earlier post....

'albumartist, album, date'

But I see now how you use the coalesce to (sort of) concatenate the requested tags to make a unique identifier.

Thanks again.
Over and out...
Find all posts by this user
Quote this message in a reply
07-08-2022, 16:24
Post: #19
RE: Album duration possible?
I am reading this thread and I cannot understand it. Is it possible to display the duration of an album? How can this be done?
Find all posts by this user
Quote this message in a reply
07-08-2022, 16:35 (This post was last modified: 07-08-2022 16:36 by entdgc.)
Post: #20
RE: Album duration possible?
The answer is yes...but not without some work and some technical knowledge. Basically you need to add a new tag for the duration value using another program such as mp3tag, fill in this value (which is easy for each new album but if you have a whole library with many albums you need to automate the process which is what most of this thread is about). You then need to coax minimserver to display the value where you want it which is straightforward in the settings.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)