music from mac

Discussion in 'Mac Basics and Help' started by skd, Oct 16, 2006.

  1. skd macrumors 6502

    Joined:
    Aug 27, 2006
    Location:
    carmel, ca
    #1
    "I set it to fade out over a period of two hours, then sleep my MBP (connected to hifi) when I go to sleep. It then wakes up at 6 am every week day and plays my 'wake up playlist', fading in over a period of 10 minutes. :p I love my Mac."
    I saw this on another thread......can someone eplain how I can get my mac to do this?
    thanks
     
  2. emptyCup macrumors 65816

    emptyCup

    Joined:
    Jan 5, 2005
    #2
    You need some sort of third party program for that. See if anything here works for you.
     
  3. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #3
    No you don't. You could very easily do this with Automator. And in a minute I can show you how.
     
  4. skd thread starter macrumors 6502

    Joined:
    Aug 27, 2006
    Location:
    carmel, ca
  5. 2nyRiggz macrumors 603

    2nyRiggz

    Joined:
    Aug 20, 2005
    Location:
    Thank you Jah...I'm so Blessed
    #5
    ^A shuttle leaves every eight minutes....don't miss it.


    Bless
     
  6. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #6
    Ok here we go this is a bit of a mix between some Automator action and Applescript but I will show you everything so no need to worry.
    Note: If you are not using OS 10.4 (Tiger) then this solution will not work for you!

    I will focus on starting up your Mac in the morning and having it fade in slowly for however long of time you want (I'll do 10 minutes as you asked).

    Ok open up Automator you will have 3 columns, the Library, the Actions, and the Workflow area. I will describe how to build the workflow by saying the names of each column (iTunes, Volume, Set to 0) means choose iTunes from the Library, find the Volume Action, and set that action to 0 in the workflow.

    Ok it's for real now.
    iTunes: Set iTunes Volume: Set volume to 0
    iTunes: Get Specified iTunes Items: Click the + and select the Playlist you want.
    iTunes: Start iTunes Playing: No setting.
    Automator: Run Applescript: (copy the following code into the Applescript workflow box):
    Code:
    tell application "iTunes"
    	set sound_level to 100
    	set sound volume to 0
    	play
    	repeat while sound volume < sound_level
    		set sound volume to sound volume + 5 --Set increment of Volume
    		delay 120 --Set increment of time for how often Volume is increased
    	end repeat
    end tell
    Now you are all done. You will notice the comments in the applescript code. The +5 is saying the volume will increase that much (out of 100) and the Delay is the amount of time (in seconds) in between each volume increase. So take 10 minutes (600 seconds) and divide by 5 (volume increment) and you get 120, and this is what the delay is set to. You can adjust this as you see fit.
    Oh, and when you save the workflow save it as an Application and then go to System Preferences>Login Items and select your new Automator program. Then you'll need to tell your Mac to turn on every weekday (Energy Saver Preferences).
     
  7. patrick0brien macrumors 68040

    patrick0brien

    Joined:
    Oct 24, 2002
    Location:
    The West Loop
    #7
    -skd

    Or you can try calling a script from your iCal for the wakeup.

    1. Write a script to fade the music over a given time using something like:

    tell application "finder"
    set volume 8
    launch application "iTunes"
    tell application "iTunes"
    play the playlist "GOTOSLEEP"
    delay 120
    set volume 7.5
    delay 120
    set volume 7
    delay 120
    set volume 6.5
    delay 120
    set volume 6
    delay 120
    set volume 5.5
    delay 120
    set volume 5
    delay 120
    set volume 4.5
    delay 120
    set volume 4
    delay 120
    set volume 3.5
    delay 120
    set volume 3
    delay 120
    set volume 2.5
    delay 120
    set volume 2
    delay 120
    set volume 1.5
    delay 120
    set volume 1
    delay 120
    tell application "iTunes" to quit
    End tell
    End tell
    end tell


    2. Write a script for iCal to open at an apponted time...

    tell application "finder"
    set volume 8
    launch application "iTunes"
    tell application "iTunes"
    play the playlist "GOODMORNING"
    End tell
    end tell


    Disclaimer: I put these together off the cuff - haven't compiled. there may have been something I miised like a tell or end tell.
     
  8. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #8
    So did my solution get you to the moon? Or were you scared off by it? I tried it this morning, worked fine.

    Oh, and Patrick, try a loop to change the volume increments. All that code is confusing.
     
  9. skd thread starter macrumors 6502

    Joined:
    Aug 27, 2006
    Location:
    carmel, ca
    #9
    thanks

    GS12
    Having never done anything like this I didn't think I would be sucessful. But, it worked!! I'm an architect and spend most of my time using my computer to produce drawings. I just made the switch to mac at the beginning of the year and continue to be impressed with the mac and it's community. How did you learn this? Again thanks.
     
  10. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #10
    I learned most of the Automator stuff through interest (it isn't easy, yet not too hard). And the AppleScript stuff I am still learning, but basic stuff is no problem.

    Also I taught myself this stuff out of the monotony of not wanting to actually do it myself. There is a lot of power in a computer if you can get automation scripts to work for you. Brings back that bit of computer magic.

    I'm glad it worked for you. Now you wanna build me a house?
     
  11. patrick0brien macrumors 68040

    patrick0brien

    Joined:
    Oct 24, 2002
    Location:
    The West Loop
    #11
    -GimmeSlack12

    Yeah, thought of that later, this was the best I could do from memory in a pinch.
     

Share This Page