What are we doing?

Daivd with his harp. (Unknown 960AD) Both Jewish and Christians scriptures contain very early religious music, partly said to be written by David.


Introduction

Music has been around since the history of mankind. However, where most of today’s music tends to be used for personal entertainment, it was often used to give praise to deities. But are there any musicological properties of a piece of music that make it specifically suitable for religious purposes? Bach himself sometimes re-used his ‘pagan’ music for religious purposes and vice versa giving an important role to lyrics. However, we also know that Bach was a master in the writing of baroque affective music, indicating a careful use of pitch, volume, tibre, and time for bringing music to it’s purposes. So, even if there is some overlap between musical sound of pagan and religious music, there might be some aspects which fit just better for one of them.

Method

To be able to answer the research question one has to compare religious music with non-religious music. This is implemented in R using the spotifyr module which gathers data from two types of playlists: religious and non-religious. Both corpora are more useful for machine learning purposes, as for example classification, if they contain many songs. Therefore, a set of different playlists which tend to be typically religious or non-religious has been made. Depending on the results, the religious playlists could be split up further to detect if there are any difference between different religions. Differences are measured between contemporary music lists but could be further expanded to more classical oriented music.

Data, data, data

Religious Playlist ID Songs Non-religious Complement Playlist ID Songs Balance
Religious 0IJbO5M2xD33mMHaeLRdSn 101 Non Religious 4VuiQ0wD6Xh5uDYveV2b0C 183 -97
Religious Songs 1Lfv5hpiBqtxHIlaeUo8TS 44 Non Religious 3 0B6Lj8siocfyTOCzyeBYzX 59
Christian Playlist for 2017 5t4HnPlX51s5ZdC2Lucnyz 391 Top 2017 1DoUPHRIAC6YbEPiDf8IOd 99 292
Top Christian Contemporary 37i9dQZF1DWUileP28ODwg 58 Today's Top Hits 37i9dQZF1DXcBWIGoYBM5M 50 8
Top Christian 37i9dQZF1DXcb6CQIjdqKy 66 TOP 2019 208tdAvqyrtssZFKLktwkx 43 23
Islamic Song 3SxT23r9nc6M1Ew2xrVpaV 108 Top Tracks of 2018 37i9dQZF1DX1HUbZS4LEyL 100 21
Islamic Songs 1YVnT9OowJP6ayM5QRazW7 120 Top of the Charts 7b2rMhQyuX3vkgQz2umhdV 107
Islamic / Nasheeds 1dNteyophghoFsbO3lCULn 67 Pop A Capella 6I3FnHFqsEwwifL63hX3gf 100 20
Fusion Hinduism 5lNmoVhBqIY0zKcZH3RZlr 53
Sanskrit / Hindu Mantra Chants 6RLNAQJoR5OUAl5lyA8YJJ 133 2019 Hits 4JkkvMpVl4lSioqQjeAL0q 128 5
Buddhist Meditation Songs 3c4AduB9UOrxkfdW0Nh2hA 270 Top allertijden 1nwCwjYUStN0xvoSmSgS9M 785 -22
BUDISTA 1aBpY65gFEM88trlD8Beht 238
Top Jewish Music 05Um5tgwbBWNAikYlwCId6 255
Jewish Music - Driving 1m0HB9PIDiovCDtO4qc00l 402 Driving Songs Everybody Likes 1prdy5Q62wxQ0Mb4gOOfeD 604 -202

Used playlists. Balance only compares the number of songs, not their duration. Playlist names might be altered and/or shortened for readability.


Inside the Box

  • We have got a total of 2209 unique religious songs, which means there are exactly 127 doubles in the set. [1]

  • The non-religious list makes up a total of 2310 unique non-religious songs, surprisingly enough there are no doubles here. [1]

  • The balance without removed duplicates equals 48 songs in favour of religious music. After data processing the balance alters to -101 in favour of non-religious. The difference in balanced based on songs and actual measure lies in the fact that sometimes not as many songs are gathered from a playlist a there should be. This might be due to a specific spotifyr implementation, because sometimes the amount of songs which are in a playlist according to Spotify differs slightly from the actual amount retrieved.

A few important notes

First of all, it is hard to tell whether all non-religious songs are really non-religious (considering that it also contains songs with titles as pray and faithfully) (1). Moreover, the data might be biased with pop-music (2). Furthermore, one could count for more duplicates based on title if one is willing to argue for a comparison on completely different kinds of music instead of counting different covers of the same song. (3). In addition, the quality of the complements is debatable. To keep it objective I used mainly meta-data like the title of a playlist to keep the musical features separate and measurable. One could also choose to complement based on a few musical features and look for differences on other features. However, there are still some vague matches. Religious and Non-religious seem intuitively good complements where Buddhist Meditation Songs and Top allertijden look semantically further separated (4). Balance is measured before removing duplicates. For higher accuracy balance should be computed after knowing how many songs from each playlist are gathered (but it can only count for one playlist). For balance the following measure is used (5):

balance = songs_religious - songs_non-religious


[1] Using the distinct function from R.

Structures Scrutinized

Cluster analysis on the whole data set using an euclidean distance measure.


Features Everywhere

Using a cluster analysis we can get some insight in how our data is ordered. It looks like there are at least two big clusters for both the individual musical features and the individual songs in the corpus. Loudness and c01 are very closely related which is not surprising because they should represent the same measurement: the first Spotify timbre feature is loudness. However we see that energy and timbre feature c02 are also closely related to those. It seems like there are some smaller groups having different properties on those features which indicates an unusual culture or religion. Some keys are also closely clustered together which indicates the use of the same keys in musical pieces with also other similar features. Maybe we can have a closer look at those ‘general’ features?

General Gain

spotify-features

spotify-features

Using the most interesting whole-song features from the Spotify API, duration_ms and speechiness are on a re-normalized log scale.


Strange Spread

These visualisations show the spread of each musical variable. De circle with cross shows where the mean lies. There are already some interesting findings visible like the difference in danceability of religious and non religious music. On average religious music is less danceable but more acoustic compared to non-religious music. Speechiness and duration are quite the same with exceptions to many outliers. On most properties Religious music has a very wide spread. Tempo is the same on average, however there is more spread in religious music.

The Key to Religion

Predictions of the key of a piece of music according to Spotify. Keys are sorted on the most common of the whole corpus (both religious and non-religious music).


Many Mode’s

Using spotify’s key_mode property one is able to visualize how the keys are distributed for different religions. Religious songs tend to use a bit more of C major. Jewish music is using many different keys while Christian music follows the sorting order of the whole data set more general. Buddhist and Hindu music also seem quite diverse. However the total difference in religious and non-religious music is not that big. Maybe we can get more from a more emotional view of music?

Religions Range

All songs from the corpus on the AV-plane, size is popularity.


Emotions Everywhere

On the arousal-valence plane religious and non-religious music have kind of the same spread while there is a big difference for individual religions. Buddhist music tends to be quite sleepy while most Jewish music tends to be very happy. Christian and Islamic music have a wider spread like non-religious music, where the former is in the more angry corner of the plane. The different musical modes do not have much influence on the emotional placement. These results point to a research direction which focuses more on different aspects of music of different religions. For now it seems that there is indeed a difference between religious and non-religious music. However it might also be that the differences are just the result of comparing western music with non-western music. To test that hypothesis Christian and Islamic songs have to be compared more thoroughly with the non-religious data set.

Outliers Observed

Different aspects of an outlier.


Let’s inspect some outliers of different religions.

Archetypes Abstracted

Different aspects of some archetypes, keep in mind that the timescale is different for different songs.


These songs where selected based on their position on the AV-plane. They are closest to the mean of the energy and the mean of the valance of their group and represent the properties of a specific song central in their religious group.

For some songs the first and last seconds differ completely from the rest of the piece. It might well be that those seconds are just some noise, applause or other form of intro/outro.

The non-religious musical piece is clearly structured as is also the case with the Islamic and Jewish songs if we look at timbre. The Hindu, Buddhist and ‘Religious’ pieces tend to be structured in very many small pieces.

Lastly, Islamic, Non-religious, Christian, Jewish and ‘Religious’ music use many different pitches, while Buddhist and Hindu use more of the same pitch class, which might therefore be just a cultural aspect.

Faithfull Features


Predict Type

Using Random Forest on the whole dataset with 10-fold cross-validation we get an accuracy of 0.86 together with a kappa and j-index of both 0.73, which is not bad at all.

c11 tends to be very descriptive in the difference between religious and non-religious music. Religious music has more of c11 on average compared to non-religious music. Besides, non-religious music seems to have a bit more of c06.

Also, in this particular corpus religious music seems tho consist of songs of a longer duration compared to non religious music. Further investigation would be needed to verify whether longer pieces of music seem to be of a religious kind on average in general. It might be that religious music has to say more about the fundamentals of life compared to non-religious music which might be more biased with only empirical knowledge but that would be large guessing for the moment.

Wandering Worships


Predict Religion

Again using a Random Forest classifier we obtain an accuracy of 0.79 on the whole dataset with 5-fold cross-validation. The kappa and j-index this time are 0.69 and 0.56 respectively.

Loudness, energy, the higher order timbre feature c11 and acousticness tend to be the most descriptive to discriminate between different religions. Because energy and loudness seemed to be describing somewhat the same features (as also indicated by the clustering analysis) the other three components are used to visualize the different religions.

Mostly the Buddhist, Hindu and a bit of the ‘Religious’ music tend to have a lower loudness compared to the other religions. The non-religious music scores relatively low on timbre feature c11 as we saw when predicting religious music. However it seems that it is mostly the Buddhist music scoring high on that part.

‘Religious’ Revisited


Predicting the Unknown

So what does our ‘Religious’ data set contain according to our classifier? A random forest classifier trained on all other religions predicts that most of the data is actually Buddhist, Christian or Jewish music. Where the last two sound plausible, the first one might be biased by the extreme outliers the Buddhist music has shown and therefore the algorithm is trained to get it right if it predicts sounds that are a bit unusual as Buddhist. However, on the loudness scale there are indeed ‘religious’ songs very close to Buddhist music as visible on the last tab.

Finalized Findings

Conclusion

While the original question was directed to the search for specific properties of religious music, the actual research has shown that there are also many interesting differences between religions themselves.

We have seen that our data can be clustered in smaller groups and that there are general differences, like loudness, in musical features between religious and non-religious music for the current corpus. Besides, there are also features like key_mode and tempo which seem to have almost nothing to do with religious or non-religious music. Moreover, there seems to be a lot of musical difference between different religions while for every religion there is some non-religious music available with kind of the same emotional properties.

Spotify’s higher order c11 timbre feature tends to be very descriptive in the difference between religious and non-religious music because it seems to be higher on average for religious music. Also, in this corpus religious music seems tho consist of songs of a longer duration compared to non religious music. Lastly, there are also a lot of non-religious songs with a relatively high c06 feature compared to the religious songs.

To confirm these results, sortlike experiments as in this research should be carried out on different kind of corpora. While the current corpus is actually quite big it might still be biased with for example popular music. Moreover the difference between Western and Non-Western music might be biasing the algorithm also. It might be, for example, that the Top Allertijden-playlist is not very complementary to Buddhist music.


References

Burgoyne, J.A. 2019. “Computational Musicology Course Materials.” University of Amsterdam.

Plotly Technologies Inc. 2015. “Collaborative Data Science.” Montreal, QC: Plotly Technologies Inc. https://plot.ly.

Spotify. 2019. “Spotify Web Api.” https://developer.spotify.com/documentation/web-api/.

Unknown. 960AD. “David Playing His Harp.” Wikipedia.org. https://en.wikipedia.org/wiki/Religious_music#/media/File:David-harp.jpg.

Wickham, Hadley. 2016. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. http://ggplot2.org.