# Update removes initial\_key and bpm tags

**URL:** <https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147>\
**Category:** Help\
**Created:** [August 3, 2017, 7:18am UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147 "2017-08-03T07:18:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vissie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/vissie/32/152_2.png) [@Vissie](https://discourse.beets.io/u/Vissie)\
**Post date:** [August 3, 2017, 7:18am UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/1 "2017-08-03T07:18:21Z")

</div>

Hi. I’m new at beets and in the process of setting up my config file etc etc. I’m also doing testing to make sure that the behavior is what I expect. When I’m done, I’ll let beet loos on my full collection.

I noticed a funny thing today. I have a sample file that I use to test my new tags. It has no tags embedded in the file. I know this because I did a ffprobe of the file and see no tag info.

I run a import:  
beet import -s ~/Downloads/myfile\_something\_snow\_something.mp3

All works fine. I look at the tag info:  
beet edit --all snow  
Including the lyrics that I now have, there is 283 lines of tags…  
I double check this again with ffprobe and I can see all the tag info is there.  
This is all wonderful, great and as expected.  
I can re-import the same file, the same process runs, and I get told that I have a duplicate, and I remove the old file.

Then, I did a:  
beet update -p

Beet tells me:  
initial\_key: C -\>  
bpm: 155.558242798 -\>

I do not understand why? I go from no tag info, to all, then immediately doing a update, 2 fields gets blanked out.

Can someone explain to me the behavior?

I run beet 1.4.5  
Python 2.7.13

Vissie

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [August 3, 2017, 1:09pm UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/2 "2017-08-03T13:09:14Z")

</div>

I don’t see an obvious reason why his would be. If this seems like a reliably reproducible problem, could you please file a bug with complete details (and sample files) that can let other people observe the same behavior?

---

<div class="post-metadata">

**Author:** ![Vissie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/vissie/32/152_2.png) [@Vissie](https://discourse.beets.io/u/Vissie)\
**Post date:** [August 3, 2017, 1:20pm UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/3 "2017-08-03T13:20:30Z")

</div>

Sure. Let me try the same on my home PC tonight and see if I have the same there.  
Thx!

Vissie

---

<div class="post-metadata">

**Author:** ![Vissie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/vissie/32/152_2.png) [@Vissie](https://discourse.beets.io/u/Vissie)\
**Post date:** [August 7, 2017, 5:35pm UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/4 "2017-08-07T17:35:22Z")

</div>

Hi,  
Sorry I took so long to reply.

So I did the same test at home, same results:  
initial\_key: C -\>  
bpm: 155.558242798 -\> 0  
The interesting thing is that my other test music is different. With them I get about 50% that will round the bpm:  
bpm: 126.024734497 -\> 126  
bpm: 81.6080551147 -\> 81  
bpm: 148.046066284 -\> 148  
bpm: 132.799667358 -\> 132  
bpm: 139.991195679 -\> 139  
bpm: 106.260391235 -\> 106

That I believe is not an issue. This is just interesting.

Vissie

---

<div class="post-metadata">

**Author:** ![sophusweidemann](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/sophusweidemann/32/187_2.png) [@sophusweidemann](https://discourse.beets.io/u/sophusweidemann)\
**Post date:** [December 14, 2018, 11:19am UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/5 "2018-12-14T11:19:49Z")

</div>

Sorry for necrobump, but I have the exact same thing happening to me. Initial import sets bpm and initial\_key, running ‘beet up’ after will wipe those tags.

```auto
$ beet up
Eric Clapton - Blues - Before You Accuse Me (Take a Look at Yourself) (version 2)
  bpm: 120.832885742 -> 0
  initial_key: F -> 
Eric Clapton - Blues - Stormy Monday
  bpm: 88.9325408936 -> 0
  initial_key: Fm -> 
Eric Clapton - Blues - Worried Life Blues
  bpm: 105.564147949 -> 0
  initial_key: Fm -> 
Eric Clapton - Blues - Early in the Morning
  bpm: 146.572357178 -> 0
  initial_key: Fm -> 
Eric Clapton - Blues - Have You Ever Loved a Woman
  bpm: 119.680114746 -> 0
  initial_key: F -> 
[...]

```

Version info

```auto
$ uname -a
Linux weidemann 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ beet version
beets version 1.4.6
Python version 3.6.7
plugins: acousticbrainz, discogs, duplicates, fetchart, ftintitle, info, inline, missing, the

```

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [December 14, 2018, 4:35pm UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/6 "2018-12-14T16:35:12Z")

</div>

Interesting… does using `beet write` to update the files’ tags first have any effect?

---

<div class="post-metadata">

**Author:** ![sophusweidemann](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/sophusweidemann/32/187_2.png) [@sophusweidemann](https://discourse.beets.io/u/sophusweidemann)\
**Post date:** [December 19, 2018, 11:16am UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/7 "2018-12-19T11:16:03Z")

</div>

Indeed, that worked! Even though I had set `write: yes` in my config. Does this setting not imply that I want to write tags to files when importing?

Edit:  
Guess I should note that I also get weird rounding errors in my BPM, similar to previous poster (also seen in my previous post):

```auto
$ beet write
Allah-Las - Bleep: The Top 100 Tracks of 2012 - Tell Me (Whats on Your Mind)
  bpm: 127 -> 127.965560913
Altitude - The Art of Chill - Tears in the Rain (Ambient mix)
  bpm: 132 -> 132.840881348
Ancient Methods - Bleep: The Top 100 Tracks of 2013 - Knights & Bishops
  bpm: 128 -> 128.032974243
…And You Will Know Us by the Trail of Dead - IX - The Doomsday Book
  bpm: 125 -> 125.91418457
…And You Will Know Us by the Trail of Dead - IX - Jaded Apostles
  bpm: 131 -> 131.109848022
…And You Will Know Us by the Trail of Dead - IX - A Million Random Digits
  bpm: 127 -> 127.984687805
…And You Will Know Us by the Trail of Dead - IX - Lie Without a Liar
  bpm: 114 -> 114.734649658
…And You Will Know Us by the Trail of Dead - IX - The Ghost Within
  bpm: 133 -> 133.331359863
…And You Will Know Us by the Trail of Dead - IX - The Dragonfly Queen
  bpm: 163 -> 163.539581299
…And You Will Know Us by the Trail of Dead - IX - How to Avoid Huge Ships
  bpm: 123 -> 123.309066772
…And You Will Know Us by the Trail of Dead - IX - Bus Lines
  bpm: 94 -> 94.8486175537
…And You Will Know Us by the Trail of Dead - IX - Lost in the Grand Scheme
  bpm: 136 -> 136.549713135
…And You Will Know Us by the Trail of Dead - IX - Like Summer Tempests Came His Tears
[...}

```

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [December 21, 2018, 4:30pm UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/8 "2018-12-21T16:30:07Z")

</div>

Weird! I don’t have a good explanation for why those would not have been written in the first place. Is that step reproducible?

---

<div class="post-metadata">

**Author:** ![jakabadambalazs](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jakabadambalazs/32/360_2.png) [@jakabadambalazs](https://discourse.beets.io/u/jakabadambalazs)\
**Post date:** [February 17, 2020, 10:38am UTC](https://discourse.beets.io/t/update-removes-initial-key-and-bpm-tags/147/9 "2020-02-17T10:38:01Z")

</div>

I am not sure about the edit plugin - I have not tried it yet but one thing is bugging me too about the bpm value. If I have a song which from acousticbrainz has received the bpm value of “117.203399658” , beets will never able to store it correctly in the TBPM tag. In fact, repeated `beet write´ calls will produce the below result:

```auto
$ ./beet write title:She\'s Got Balls
AC/DC - High Voltage - She's Got Balls
bpm: 117 -> 117.203399658
$ ./beet write title:She\'s Got Balls
AC/DC - High Voltage - She's Got Balls
bpm: 117 -> 117.203399658
$ ./beet write title:She\'s Got Balls
AC/DC - High Voltage - She's Got Balls
bpm: 117 -> 117.203399658

```

It seems that the write command does not round the figure but probably [mutagen](https://pypi.org/project/mutagen/) does. However, with the library allowing the bpm value to be a float, in cases like this there will never be an end to this.

Quoting from the [ID3v2.4 documentation](http://id3.org/id3v2.4.0-frames) (section 4.2.3):

> The ‘BPM’ frame contains the number of beats per minute in the  
> main part of the audio. The BPM is an _ **integer** _ and represented as a  
> numerical string.

Let me throw my 2 cents in here. I am a fanatic of precision but at the same time I am also quite pragmatic. Is there anyone out there who uses the decimal figures of the bpm value? Can’t we just say that 117 is good enough for 117.203399658?

Solution?: I don’t have one but I would go for something that would allow the user to decide through configuration. Something like:

```yaml
library_item_field_type:
  bpm: (int|float)
  # ...

```

and then preconfigure it to adhere to the ID3 specs. This way we solve the problem (probably for the majority) but if someone wants he/she can still use float.

What do you recon?
