To test the "Until" action Macro (v11.0.3)

You didn't ONLY miss this. You also missed the part I was explaining Airy what I meant for "slow" etc...
AND plz don't take it the wrong way... I am writing with a smile on my face... no mean to scorn or something like that...

Thanks for your help and have a great weekend!

Hello.
Just a quick update. I didn't get to work on the subject of this post too much.
1- I have a wife after surgery and devoting most of my day to her care.
2- Apple takes care we never have a dull moment. All of a sudden my contacts started ״reproducing" and I found myself with thousands of duplicates. So, I had to deal with that first.
Anyway, even with all that, when I'll have "something" I'll update.
Thanks again to all and enjoy your weekend(s)!

No worries! I'm still trying to work out what you mean by "quiet" and "slow" -- we really bang through Silent Night at our local Carol Service! -- and, ultimately, you'll need to define those in terms KM (through the GUI) or a utility (volume/bpm analysis) can understand if you want to automate this even further.

Given that it's such a personal determination there may be no better way than doing as you are and giving each a quick listen.

1 Like

Sorry to cause you so much trouble.
By "quiet/slow" I mean something very peaceful like classic music, by not those, I'd say something like hard rock.
It has nothing to do with the volume or something like this.
I hope this time I "hit the nail"... :smile:
(If not, plz tell me)...

In that case my "BPM detector" would not work for detecting "quiet/slow". There are lots of classical songs with high BPM. In fact many classical songs have far more notes/second than rock.

There is probably another way to "detect musical style". Here are three options.

  1. If the music is losslessly ripped from a CD, then there should be utilities that can take an MD5 hash of your song and check from an online library what the category of song is.
  2. There's also Shazam, which I think is built into Apple's OS's, which can identify any song from a fragment, and KM could probably invoke Shazam and get the result. I think this would be easy.
  3. There's also the new Apple Intelligence, coming soon, which might have new ways to identify music.
1 Like

OK, I see all my definitions just create more confusion. So, I'll try one more time: by quiet/peaceful/slow I don't mean BPM/tempo or whatever. AND the reason there cannot be a software that can help me with THIS piece is that by those words I mean that a song MAKES ME quiet/peaceful/etc.
It can be any genre or group or kind of music, as long as if I listen to it, I FEEL peaceful.
And the reason I need to listen (sometimes) more than 1 or 2 spots is that a song can start very calm/slow/quiet/peaceful and then in the middle is "a mess" that the only way I can listen to it and stay calm is only if I take Valium (and I don't mean volume)... :smile:

From what you've described, the two simple AppleScript-based macros I posted above would do the trick for you. You can change the 3 to whatever you want, or even have a few macros - one with a 3 second skip, another with 10, etc. Maybe on Control-1, -2, -3, etc. So listen to what you need to, then Ctrl-Q (or whatever you assign) for those you deem quiet.

-rob.

1 Like

Yes, if you mean the AS you wrote, it DOES take care of the 2nd part. Today I tried Nige_S macro, eventually succeeded to learn and understand how/why it works and I think that if I combine Nige's macro with your script (that, as you mentioned, very basic and easy to understand) I eventually can start "working".

Here's a macro group that implements what I wrote above:

Add to Quiet group.kmmacros (2.6 KB)

There are four macros in the group, which is only active in Music. Three of them skip two, four, or eight seconds forward, and are assigned to Control-1, -2, and -3. The fourth assigns the current track to the Quiet group and skips the rest of the track, and it's assigned to Control-Q.

Start playing a song, press any combo of Control-1, -2, and -3 you need to skip through the track, then press Control-Q when you decide you want to add the current track to your quiet group. I didn't write a macro to skip the current track without categorizing, because you can just press the Right Arrow key in Music to do that already.

-rob.

1 Like

Thanks rob.
I will try all the above including the macro Airy created (even if for sole purpose of the opportunity of widening my knowledge of KM) and will get back with questions/decisions.
Thanks again to all!!!

Such a "personal" classification will require you to listen, since you can't decide based on metadata like genre or derived data like BPM/average volume.

We should still be able to make the job easier with KM. The "listen to bits of a track" has been covered in a variety of ways, but the "play glass sound then give me a list to classify by" seems to break your flow and add unnecessary time.

I can see a workflow that will play 2-second snatches of a track until you classify it, after which it moves to the next track automatically. Repeat until you are done for that session.

How are you planning on classifying tracks? Put them into a playlist, change the metadata on each and use a smart playlist, something else?

I was thinking of adding "Quiet" to the "grouping" field and then create a smart playlist where the condition (or 1 of them) is "grouping contains quiet".
(In a matter of fact I already have all kind of smart playlists like the above).
Something like this macro:

Now that rob has written such a simple Apple script I may use this one instead.
BTW, why did you use the "Global" with the variable "loopShouldRun" instead of "Local"? (I read the description in the Wiki but didn't find an answer to my question)

"Local" variables are only available in the executing instance that "created" them (that means that even the same macro, if run twice at the same time, will create two entirely separate sets of its local variables).

"Global" variables are available to any macro running. That makes them a good way to share values/data between macros, which is what we are doing here with the loopShouldRun flag -- when the "Stopper" macro changes the value the main macro can read that changed value and stop.

That is also why you shouldn't use global variables unless you need to -- there's always the chance that other macros might change the variable when you don't expect them to!

Regarding calculating the BPM, it was getting much more complicated than I expected. There's probably more than one way to solve the problem using math, but after reading the math on the link below, I gave up doing it automatically, and decided a manual approach was better. So I created a new macro and uploaded it to the macro forums page on this site.

Here's the page that described the math needed to calculate the BPM of a song using a 2 second sample of audio from the song.

https://www.clear.rice.edu/elec301/Projects01/beat_sync/beatalgo.html

1 Like

Thanks for taking the time to explain that AND in an "easy down to earth version"!!!
Got it! (I learn on the net by reading manuals/definitions and eventually looking at examples/videos how to implement what I learned).
For some reason with KM (although I LOVE it and use it for many years) I'm still struggling with the way those are available in the help (Wiki, forums, manual and so). My feeling has been always that things are explained with definitions within definitions or something like that, that the "language" spoken is a foreign one), something like "not beginners friendly". (Beginners I mean by those that don't have any "software background"),

Any documentation, even a Forum post, has to make some assumptions about the reader. And not all styles work for all people. So if there's anything you don't understand just ask here -- there's a whole bunch of clever people able to explain things at many levels and in different ways, some of which will surely work for you.

1 Like

Hi again!
So, I succeeded eventually to put together the macro I initially wanted only thanks and because of your help!!!
Some remarks:
Airy, I tried to work with your macro. The stopper works for me, I just removed the condition "ABS(MOUSEY()-70)>5" because I thought it would be better for me not to "tie" the mouse that it won't be able to move without stopping the macro.
When I tried the main macro I didn’t succeed to play several parts of the song, only 1 skip/play. I don’t know if I did something wrong. (And I double checked and set up the timeout setting for "after 2 seconds")

Rob, for some reason when I tried to integrate the AppleScript for adding “Quiet” it didn’t work and got an error message:

So, this is the macro. It has 2 versions, one only KM and the 2nd, I integrated Nige’s AppleScript. As I said earlier, I prefer to work with KM, since I’m able to modify/change/adapt it, even with my limited knowledge, which I’m not able to with AS.

Final macro Play parts of song> quiet or next (BASED ON NIGE'S)+ QUIET KM & "+1" AppleScript (NIGE'S).kmmacros (44.7 KB)

Final macro Play parts of song> quiet or next (BASED ON NIGE'S) ONLY KM.kmmacros (47.1 KB)

STILL OPEN TO IMPROVEMENTS AND SO (more efficient/elegant/shorter/etc')

THANK YOU ALL for your help, encouragement and patience! AS ALWAYS it's been an awesome help!!! I appreciate that SO MUCH!!! I am so happy to have had widen my knowledge of KM!!!

BTW, I think the most important thing I gained: I defined to myself what a slow/quiet music means to me! :rofl::rofl::rofl:

Airy, hopefully sometime in the near future I'll be able to "dive" and learn what you brought here.
Thanks A LOT for everything!

That's fine. I intentionally gave you two choices to pick from.

1 Like

Glad you got it working!

-rob.

1 Like