Gracenote integration

Discuss the current and future development of Max.
pianomaster
Posts: 4
Joined: Thu Apr 06, 2006 3:27 pm

Gracenote integration

Post by pianomaster » Thu Apr 06, 2006 3:30 pm

i'm not sure how things are progressing on obtaining a license to use CDDB instead of freedb (i just spent all morning re-entering track information for Die Walkure, since freedb gave me gibberish for foreign characters)...is there any way, in the meantime, to simply bypass freedb and let Max get the cd track information from CDDB by way of itunes? something like "use existing track names" or whatever you want to call it; when a cd is displayed in itunes, to use those titles rather than freedb's? any idea? thanks a lot

Felix Ding
Posts: 1
Joined: Tue May 09, 2006 4:11 am
Contact:

Post by Felix Ding » Tue May 09, 2006 4:12 am

yes, it's exact the suggestion I want to give.

aka
Posts: 13
Joined: Mon Mar 27, 2006 7:56 pm

Post by aka » Tue May 09, 2006 11:30 pm

an excellent suggestion, pianomaster - an option for accessing the on-board CD database (whatever it's called) once mac/itunes calls CDDB would be swell - I dislike the often goofy info from freedb, too.

BTW, Max is coming along superbly, Stephen - sincere thanks for all of your excellent work!

We doan need no steenkeen EAC!

Mr. Woodford
Posts: 2
Joined: Fri May 19, 2006 4:24 pm

Post by Mr. Woodford » Fri May 19, 2006 5:10 pm

Stephen- my first post, and I love Cog- can't use Max because of I'm running 10.3.9, but apropos Gracenote- email me through the board, I may be able to help with getting a sharewrae license.

Cheers,

Mr. Woodford

live4ever
Posts: 4
Joined: Wed Apr 05, 2006 5:15 pm

Post by live4ever » Sun Jun 11, 2006 8:28 pm

Here's an AppleScript I found that's supposed to grab the info that iTunes gets when a CD is inserted - I don't know if Max can use it somehow though.

Code: Select all

tell application "iTunes"
   set doRepeat to true
   repeat while doRepeat is equal to true
      try
         set myCD to some source whose kind is audio CD
         set doRepeat to false
      on error erMs number erNum
         -- error 1728 means the AudioCD was not found, so wait a little
         -- the loop should not be infitite, better to mofify it to wait only 
         -- for some time
         if erNum is -1728 then
            set doRepeat to true
         else
            set doRepeat to false
         end if
      end try
   end repeat
   set CDname to myCD's name
   -- the playlist 1 is actually the CD contents
   set myPlaylist to playlist 1 of myCD
   set theTracks to number of tracks of myPlaylist
   set evCDtrack to (get name of every track of myPlaylist)
   set evCDArtist to (get artist of every track of myPlaylist)
   set evCDGenre to (get genre of every track of myPlaylist)
   -- etc...
   -- any other CD data could be retrieved, use Script Editor,
   -- select File/Open Dictionary, and then iTunes.
   -- all the attributes of playlist object could be retrieved
end tell 

metaclam
Posts: 11
Joined: Sat Mar 04, 2006 6:19 am

rudimentary script itunes cddb-->max

Post by metaclam » Mon Oct 23, 2006 5:24 am

I have no idea why Max can't get this information from the internal database that is kept by OS X. This info should be cached as soon as iTunes loads it.

But here's a rudimentary soluation that will get the tag info from iTunes and put it into the top max window. Note some bugs in Max in the comments.

This is not extensively tested or anything, but in theory should work.

Recommended install location is in:

~/Scripts/Applications/Max/

Then can access from Script menu while Max is top.

Code: Select all

tell application "iTunes"
	set abortit to false
	try
		set myCD to some source whose kind is audio CD
	on error erMs number erNum
		-- error 1728 means the AudioCD was not found, so wait a little 
		if erNum is -1728 then
			set abortit to true
		end if
	end try
	if not abortit then
		set CDname to myCD's name
		set myPlaylist to playlist 1 of myCD
		set theTracks to tracks of myPlaylist
		tell application "Max"
			set mc to (count tracks of document 1)
			set maxdisk to document 1
		end tell
		set ic to (count theTracks)
		if mc = ic then
			repeat with i from 1 to (count theTracks)
				set atrack to item i of theTracks
				set ar to artist of atrack
				set al to album of atrack
				set tn to track number of atrack
				set tc to track count of atrack
				set ge to genre of atrack
				set co to composer of atrack
				set ye to year of atrack
				set na to name of atrack
				set comp to compilation of atrack
				set com to comment of atrack
				set dn to disc number of atrack
				set dc to disc count of atrack
				tell application "Max"
					set maxtrack to track i of document 1
					if not (rip in progress of maxtrack) and not (encode in progress of maxtrack) then
						set title of maxtrack to na
						set artist of maxtrack to ar
						set year of maxtrack to ye
						set genre of maxtrack to ge
						--set double integer of maxtrack to co
						-- max bug: for some reason "composer" compiles as "double integer"
						--set number of maxtrack to tn
					end if
				end tell
				if i = 1 then
					tell application "Max"
						set title of maxdisk to al
						set artist of maxdisk to ar
						set compilation of maxdisk to comp
						set genre of maxdisk to ge
						set year of maxdisk to ye
						set comment of maxdisk to com
						--set total tracks of maxdisk to tc
						-- max doesn't allow setting total tracks
						--set double integer of maxdisk to co
						-- max bug: for some reason "composer" compiles as "double integer"
						if dn > 1 then
							set disc number of maxdisk to dn
							--set total discs to dc
							-- setting total disks results in error
						end if
					end tell
				end if
			end repeat
		else
			display dialog "The iTunes CD track count and the Max CD track count do not match."
		end if
	else
		display dialog "Couldn't get a CD from iTunes. Please retry."
		
	end if
end tell
[/code]

User avatar
Fuga
Posts: 391
Joined: Mon Jun 05, 2006 8:30 pm
Location: Texas

Post by Fuga » Mon Oct 23, 2006 10:34 am

More than once someone has offered to work a deal with Gracenote with no response made public in these forums.

The trouble with using iTunes' information is that one has to have iTunes fired up to get it, presuming the CD hasn't been in the machine before with iTunes open. Still, I'd prefer that - say an option to let us choose to have Max start iTunes and grab the info.

xACT uses iTunes' info if available.

I missed the June posting's script and now see this one. Here's to hoping I get so bored/frustrated at work I want to goof off a tad.

Paul Gotch
Posts: 23
Joined: Mon Oct 30, 2006 10:54 pm

Post by Paul Gotch » Mon Dec 04, 2006 10:50 pm

Fuga wrote:More than once someone has offered to work a deal with Gracenote with no response made public in these forums.
See

http://www.sbooth.org/tracker/view.php?id=158

It is not possible to conform to Gracenote's licensing conditions (even for a "shareware") license for an open source project like Max. In fact it would not even be possible to link to their client library as Max is licensed under the GPL and the client library is a binary only SDK.

jrochkind
Posts: 2
Joined: Sat Sep 15, 2007 6:23 pm

Re: Gracenote integration

Post by jrochkind » Sat Sep 15, 2007 6:41 pm

I too would love it if there were some way to get the info from iTunes, even if required iTunes to be open or whatever.

The MusicBrainz info I am getting is just plain not as good as what iTunes gets from GraceNote.

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: Gracenote integration

Post by sbooth » Sun Sep 16, 2007 1:36 am

I will look again into parsing the CD Info.cidb file that iTunes and Finder use to store disc information.

mistereff
Posts: 2
Joined: Mon Nov 19, 2007 6:08 am

Re: Gracenote integration

Post by mistereff » Mon Nov 19, 2007 6:09 am

This code:

if not (rip in progress of maxtrack) and not (encode in progress of maxtrack) then
set title of maxtrack to na
set artist of maxtrack to ar
set year of maxtrack to ye as string
set genre of maxtrack to ge

No longer works in 10.5. It gives an exception at year. Changed to "as string" and also to date and date "as string" all with no luck. Anyone have any ideas please?

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: Gracenote integration

Post by sbooth » Tue Nov 20, 2007 4:34 am

I need to check in the Max.sdef file, then you will be able to get the date as a string.

mistereff
Posts: 2
Joined: Mon Nov 19, 2007 6:08 am

Re: Gracenote integration

Post by mistereff » Thu Nov 22, 2007 9:08 pm

Now fixed in 1328. Thank you Stephen!

gailstorm9
Posts: 9
Joined: Mon Mar 17, 2008 2:00 am

Re: Gracenote script doesn't get Composer tag

Post by gailstorm9 » Mon Mar 17, 2008 2:12 am

The script gets all tags from Itunes except Composer. Since I have a lot of classical music, this is preventing me from using Max as my default flac ripper which I would really like to do.

Anyone have any ideas on how to fix this?

Thanks for the excellent programs.

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Re: Gracenote integration

Post by sbooth » Mon Mar 17, 2008 2:40 am


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests