0% found this document useful (0 votes)
19 views78 pages

Fyp Report

Uploaded by

pinky142124
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views78 pages

Fyp Report

Uploaded by

pinky142124
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama,Belgaum-590018

A PROJECT REPORT
ON
”AI approach to discover similar music pattern and build a
recommendation System”
Submitted in partial fulfilment of the requirements for the award of the degree of

BACHELOR OF ENGINEERING
IN
INFORMATION SCIENCE AND ENGINEERING
Submitted by

Shristi Purusarthi 1CR20IS152


Shruti Sagar 1CR20IS153
Vishnu Shriya 1CR20IS189

Under the Guidance of


Prof. Deepa Harish
Assistant Professor, Department of ISE, CMRIT

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING


CMR INSTITUTE OF TECHNOLOGY
AECS LAYOUT, ITPL PARK ROAD, BENGALURU - 560037
2023-24
CMR Institute of Technology
AECS Layout, Bengaluru-560037

Department of Information Science and Engineering

CERTIFICATE

Certified that the project work entitled ”AI approach to discover similar music
pattern and build a recommendation System” is a bonefide work carried out by
Shristi Purusarthi 1CR20IS152
Shruti Sagar 1CR20IS153
Vishnu Shriya 1CR20IS189

in partial fulfillment for the award of Bachelor of Engineering in Information Sci-


ence and Engineering of the Visvesvaraya Technological University, Belgaum during the
year 2023-2024. It is certified that all corrections/suggestions indicated for internal as-
sessment have been incorporated in the report deposited in the department library.The
project report has been approved as it is satisfied the academic requirements in respect
of project work prescribed for the said Degree.

Ms. Deepa Harish Dr. Jagadishwari V


Project Guide Head of the Department

NAME:

USN:
ABSTRACT

To determine how similar two songs are, an algorithm has been created. Knowing the
note structures and fundamental frequencies of each note in the two songs under ex-
amination allowed for the determination of how similar the song patterns were. This
study makes use of the statistical concept known as Correlation of Coefficient. Using
the 16 Note-Measure Method yields the correlation of Coefficient. The patterns of
the two songs under consideration are comparable if the correlation coefficient is close
to 1. If not, there is just a specific amount of resemblance. A number of songs with
an Indian Classical Music (ICM) background make use of this fundamental idea.

The relationship between statistical analysis and music theory is illustrated by


using the correlation coefficient to compare songs based on their basic frequencies
and pitch structures. Through decomposing musical compositions into their most
basic components—notes and frequencies—and applying mathematical methods to
measure how similar those elements are, scholars and artists can obtain important
insights into the underlying structures and patterns of music.This method is espe-
cially crucial when discussing Indian Classical Music (ICM), a genre that is known
for its intricate melodies and rhythms. Using the correlation coefficient approach,
ICM is considered a mature study since it stresses improvisation within established
ragas and houses. Researchers and practitioners can use this method to examine the
connections between various compositions, decipher the subtleties of improvisational
variation, and even obtain deeper

To fully comprehend musical compositions, one must grasp the intricate link that
exists between statistical analysis and music theory. This research attempts to ex-
plore the essence of music via a mathematical lens by comparing songs according to
their basic frequencies and pitch using the correlation coefficient. By deconstructing
compositions into its fundamental pitch and frequency elements, scholars and artists
may assess how similar various musical works are to one another, providing insight
into the underlying structures and patterns of musical expression.In Indian Classi-
cal Music (ICM), where improvisation within well-known ragas and talas forms the
fundamental basis of the genre, this method has particular importance. ICM turns
as a productive research platform that offers insight into the intricate interactions
between.

i
ACKNOWLEDGMENT

The satisfaction and euphoria that accompany a successful completion of any


task would be incomplete without the mention of people who made it possible. Suc-
cess is the epitome of hard work and perseverance, but steadfast of all is encouraging
guidance. So, it is with gratitude that we acknowledge all those whose guidance and
encouragement served as beacon of light and crowned our effort with success.

We would like to thank Dr. Sanjay Jain, Principal, CMRIT, Bangalore,


for providing an excellent academic environment in the college and his never-ending
support for the B.E program. We would like to express our gratitude towards Dr.
Jagadishwari.V, Professor and HOD, Department of Information Science and Engi-
neering CMRIT, Bangalore, who provided guidance and gave valuable suggestions
regarding the project.

We consider it a privilege and honour to express our sincere gratitude to our in-
ternal guide Prof. Deepa Harish , Assistant Professor, Department of Information
Science and Engineering, CMRIT, Bangalore, for their valuable guidance throughout
the tenure of this project work.

We would like to thank all the faculty members who have always been very co-
operative and generous. Conclusively, we also thank all the nonteaching staff and all
others who have done immense help directly or indirectly during our project.

Shristi Purusarthi
Shruti Sagar
Vishnu Shriya

ii
Contents
Abstract i

Acknowledgment ii

Table of Content iv

List of Figures v

1 PREAMBLE 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Existing System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Drawbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Proposed System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Plan of Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6 Objective of the System . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 LITERATURE SURVEY 9

3 THEORETICAL BACKGROUND 15
3.1 Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Django . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 SQL Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4 System Requirements Specification 22


4.1 Functional Requirement . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2 Non-Functional Requirements . . . . . . . . . . . . . . . . . . . . . . 22
4.2.1 Product Requirements . . . . . . . . . . . . . . . . . . . . . . 23
4.2.2 Organizational Requirements . . . . . . . . . . . . . . . . . . 23
4.2.3 User Requirements . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2.4 Basic Operational Requirements . . . . . . . . . . . . . . . . . 24
4.2.5 System Configuration . . . . . . . . . . . . . . . . . . . . . . . 25

5 System Analysis 26
5.1 Feasibility Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.1.1 Economical Feasibility . . . . . . . . . . . . . . . . . . . . . . 26
5.1.2 Technical Feasibility . . . . . . . . . . . . . . . . . . . . . . . 26
5.1.3 Operational Feasibility . . . . . . . . . . . . . . . . . . . . . . 26
5.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.2.1 Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . 27

iii
5.2.2 Technical Analysis . . . . . . . . . . . . . . . . . . . . . . . . 27
5.2.3 Economical Analysis . . . . . . . . . . . . . . . . . . . . . . . 27

6 System Design 28
6.1 System Development Methodology . . . . . . . . . . . . . . . . . . . 28
6.2 Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.3 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.4 Tools Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.5 Dataset Explaination . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

7 Implementation 37
7.1 Authentication : Login-Sigup . . . . . . . . . . . . . . . . . . . . . . 37
7.2 About Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.3 Django framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.4 Configuration page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.5 Views.py(API Calls and Page rendering . . . . . . . . . . . . . . . . . 45
7.6 URL Configuration of APIs . . . . . . . . . . . . . . . . . . . . . . . 48
7.7 Registration configuration from backend . . . . . . . . . . . . . . . . 49
7.8 Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.9 Javascript Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.10 Views.py(API Calls and Page rendering . . . . . . . . . . . . . . . . . 55

8 Testing 58
8.1 Testing Methodologies . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.1.1 White Box Testing . . . . . . . . . . . . . . . . . . . . . . . . 58
8.1.2 Black box testing . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.2 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.3 System Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.4 Quality Assurance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.5 Quality Factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.6 Functional Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

9 Results and Discussions 62


9.1 Key Components and Features . . . . . . . . . . . . . . . . . . . . . . 62
9.2 Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
9.3 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
9.4 Application Screenshots . . . . . . . . . . . . . . . . . . . . . . . . . 64

10 Future works and Contributions 67

11 Conclusion 69

iv
List of Figures
2.1 Relationship between music recommendation and therapy . . . . . . . 11
6.2 Waterfall model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.3 Flow daigram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.4 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.5 System architecture flow . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.6 ER Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.7 white box testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8.8 black box testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
9.9 User Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
9.10 Home page after login . . . . . . . . . . . . . . . . . . . . . . . . . . 64
9.11 A search space for user for recommendation on songs . . . . . . . . . 65
9.12 List Of songs Recommendation . . . . . . . . . . . . . . . . . . . . . 65
9.13 Mood search for user . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
9.14 Recommendation for mood search . . . . . . . . . . . . . . . . . . . . 66

v
1 PREAMBLE music recommendation system

1 PREAMBLE
1.1 Introduction

Unraveling the complexity of musical compositions requires an understanding of the


intricate link between statistical analysis and music theory. This research intends
to explore the essence of music via a quantitative lens by comparing songs based on
their basic frequencies and pitch using the correlation coefficient. Researchers and
musicians can quantify the degree of resemblance between various musical compo-
sitions by dissecting them into their fundamental pitch and frequency components.
This process sheds information on the underlying patterns and structures of musical
expression.This method is especially important for Indian classical music (ICM), as
the essence of the genre is improvisation within well-known ragas and talas. ICM
becomes a productive study platform that offers insight into the intricate interactions
by utilizing the correlation coefficient approach.

The correlation coefficient will be used in this study to compare songs based on
their basic frequencies and pitch structures in order to shed light on the intricate link
between statistical analysis and music theory. Scientists and musicians can quantify
the degree of resemblance between various pieces of music by reducing them down into
their most fundamental components, notes and frequencies. This analytical technique
not only uncovers the compositions’ underlying links, but it also serves as a frame-
work for comprehending the complexities of music production.This study focuses on
the notion of Indian Classical Music (ICM), a genre renowned for its profundity and
intricacy. In ICM, improvisation is an essential component of creative expression in
established ragas and houses. The correlation coefficient approach is applied here.

This presents an overview of music recommendation systems and examines the


revolutionary potential of these technologies to influence how music is discovered,
consumed, and interacts with. At its heart, the music recommendation system em-
ploys algorithms and machine learning techniques to assess massive quantities of user
data, including listening and preference information as well as contextual elements
such as mood, pace, and genres. Using this abundance of data, recommendation
algorithms may provide personalized music suggestions based on the user’s specific
interests and preferences.Music recommendation systems are important for more than
just convenience; they may also stimulate exploration, discovery, and peace in music
consumption. Introducing people to new artists, genres, and music that suit their
tastes.

Dept. of ISE, CMRIT, Bengaluru-560037 1


1 PREAMBLE music recommendation system

1.2 Existing System


One of the biggest problems facing music recommendation systems nowadays is the
difficulty of putting suggestions into practice, which is mostly caused by the difficulty
of data presentation and the dearth of thorough information. Understanding user
preferences—which include both explicit and implicit signals from things like listen-
ing history, playlist building, and user interactions on the platform—is crucial to the
operation of music recommendation systems. But there’s a big challenge in translat-
ing this massive and diverse data into useful insights, particularly when it comes to
identifying and analyzing underlying patterns and trends. among.

The purpose of this study is to shed light on the intricate link between statistical
analysis and music theory by comparing songs based on their basic frequencies and
pitch structures. Scientists and musicians can quantify the degree of resemblance
between various pieces of music by reducing them down into their most fundamental
components - notes and frequencies. This analytical technique not only uncovers the
compositions’ underlying links, but it also gives a foundation for comprehending the
complexities of music creation.This study focuses on the notion of Indian Classical
Music (ICM), which is noted for its tremendous depth and intricacy. Improvisation
is an important aspect of creative expression in established ragas and houses in ICM.
The correlation coefficient approach is used here.

1.2.1 Drawbacks

The existing music recommendation system and applications presents several chal-
lenges and shortcomings that hinder users experience and not designed according to
the user’s need and requirement:
1. Variety of recommendations.: Many existing music recommendation sys-
tems tend to prioritize popular or mainstream content, resulting in a lack of recom-
mendation diversity. As a result, users may be exposed to a narrow range of artists,
genres or songs, limiting opportunities for research and discovery.
2. Context settings capture inability: Contextual preferences, which can
greatly impact music listening decisions, such as mood, activity level, or time of day,
may be difficult for existing recommendation algorithms to quantify. Recommenda-
tions that don’t fit the user’s present environment or mood may arise from ignoring
these elements.
3. Inefficient use of dynamic settings: Due to a variety of circumstances,
including mood, life events, and changing musical interests, user preferences and tastes
are dynamic and subject to change over time. Because existing recommendation
algorithms may find it difficult to adjust to these changing preferences, users may

Dept. of ISE, CMRIT, Bengaluru-560037 2


1 PREAMBLE music recommendation system

receive recommendations that are out of date or do not reflect their current interests.
4. Restricted investigation of long-tail or specialized content: Current
recommendation algorithms could prioritize popular or mainstream information over
long-form or specialty content, which could be relevant to specific user groups. This
may result in lesser-known performers, genres, or forms of cultural expression going
unnoticed, which might lead to exciting discoveries.

Dept. of ISE, CMRIT, Bengaluru-560037 3


1 PREAMBLE music recommendation system

1.3 Proposed System

In order to clarify the complex relationship between statistical analysis and music
theory, the correlation coefficient will be employed in this study to compare songs
based on their fundamental frequencies and pitch structures. When it comes to mu-
sic, scientists and musicians can measure how similar different pieces are to one other
by breaking each song down into its most basic elements: notes and frequencies. This
analytical method provides a foundation for understanding the intricacies of mu-
sic production in addition to revealing the compositions’ underlying connections.The
concept of Indian Classical Music (ICM), a genre recognized for its depth and com-
plexity, is the main subject of this study. In traditional ragas and houses in Indian
classical music, improvisation is a crucial part of the creative process. The method of
correlation coefficients.

1. Sophisticated music therapy: Based on raga patterns, comparable song


identification in music therapy offers a customized and emotionally impactful healing
method. Therapists can improve engagement and therapeutic success by developing
strong relationships with their clients by selecting music that corresponds with their
unique tastes and emotional states. .

2. Increased selection of songs.: The digital music collection incorporates the


names of ragas with their therapeutic qualities to provide customized music-based
healing therapies. A vast selection of music that are suited to the tastes and feel-
ings of their clients are available to therapists, which improves client engagement and
therapeutic efficacy. In order to achieve holistic wellbeing, this invention encourages
cooperation and the fusion of technology and conventional medical procedures.

3. Personal music analysis: With the study of their own compositions in


mind, artists can identify songs with comparable structural traits using correlation
coefficient analysis.This technology allows musicians to curate playlists and collections
based on their preferences, which enhances the enjoyment and engagement of music
listening.

4. Calculating the similarity in music: By examining the basic frequencies


and pitch structures of various musical compositions, researchers and artists may ob-
jectively assess on similar they are to one another using the correlation coefficient
approach. A systematic method for comparing chemicals and illuminating the links
between them is provided by this statistical methodology.

Dept. of ISE, CMRIT, Bengaluru-560037 4


1 PREAMBLE music recommendation system

5. Indian Classical Music (ICM) being the main focus: The study par-
ticularly focuses on Indian Classical Music (ICM), which is renowned for its richness
and nuance. ICM is a perfect place to investigate the correlation coefficient technique
since improvisation is essential to creative expression in the school’s traditional ragas
and music houses.

Dept. of ISE, CMRIT, Bengaluru-560037 5


1 PREAMBLE music recommendation system

1.4 Plan of Implementation

A. Phase I:

1. Project Inception: Initial planning and conceptualization of music recom-


mendation system features.
2. Algorithm development: Designing the algorithm for the recommendation
of songs based on frequency.
3. Frontend and Backend Development: Building the frontend interface and
robust backend systems.
4. Testing and Quality Assurance: Thorough testing to ensure functionality,
security, and performance meet standards.
5. Deployment: Making Music recommendation application accessible to the
users for intial usage and feedback to end users for improvise.
6. User Feedback and Iteration: Continuous improvement based on user in-
put and insights.

B. Phase II:

1. Data Collection and Preprocessing: Gathering and preparing song sam-


ples for analysis.
2. Model Training: Training machine learning models for finding the matching
frequency songs.
3. Prediction and Evaluation: Integrating the trained models into music
recommendation syatem for real-time assessing performance.
4. Deployment and User Education: Rolling out the finding music with sim-
ilar frequency and educating users on its benefits and proper use.

Through these structured phases, music recommendation system aims to transform


communication and information exchange in the musical sector.

Dept. of ISE, CMRIT, Bengaluru-560037 6


1 PREAMBLE music recommendation system

1.5 Problem Statement


Problem: The goal of this project is to create a method that uses natural lan-
guage processing (NLP) to find comparable musical patterns. Using natural language
processing techniques to analyze and understand musical data, finding patterns in
many genres and styles, and developing a trustworthy algorithm that can help musi-
cians and music lovers explore and find related musical patterns are the challenges.

Affects: Developing an approach to discovering similar musical patterns using


NLP techniques requires addressing the challenges of bridging the semantic gap be-
tween textual descriptions and musical compositions, analyzing and interpreting di-
verse musical data, and accommodating the wide range of musical genres and styles.
By overcoming these challenges, the resulting algorithm has the potential to provide
valuable insights and assistance to musicians and music enthusiasts in exploring and
discovering musical patterns more effectively and efficiently.

Impact: Developing an NLP-based approach to finding similar musical patterns


offers exciting possibilities across several domains. It could revolutionize music dis-
covery, providing personalized suggestions and expanding exploration. Additionally,
it could serve as a valuable tool for music creation, fostering creativity and facili-
tating experimentation. Its analysis of music from diverse cultures could promote
cross-cultural appreciation. In education, it could enhance music theory learning and
ear training.

Solution: Developing a solution for discovering similar musical patterns through


NLP involves three main steps. Firstly, creating a versatile algorithm that can extract
meaningful features from textual descriptions and musical data is essential. Secondly,
integrating NLP, machine learning, and signal processing techniques to analyze and
identify patterns in rhythm, melody, harmony, and timbre is crucial. Lastly, incor-
porating user feedback mechanisms and an intuitive interface ensures personalized
recommendations and easy exploration for users.

1.6 Objective of the System


The goal is to develop an algorithm using the Correlation of Coefficient with the 16
Note-Measure Method to assess the similarity between Indian Classical Music (ICM)
songs based on note structures and fundamental frequencies. This algorithm will be
utilized to create a digital music library that catalogs songs, their respective ragas,
and their potential healing properties in music therapy. The objective is to enable a

Dept. of ISE, CMRIT, Bengaluru-560037 7


1 PREAMBLE music recommendation system

mobile app to recommend alternate songs for therapeutic purposes by leveraging em-
bedded raga patterns. Specifically, the system aims to achieve the following objectives:

1. Comprehensive Platform: Offer a diverse range of features and tools within


a single platform.Provide users with access to various functionalities, including music
discovery, composition tools, educational resources, and collaboration opportunities.

2. Empowering Users: Enable users to explore and engage with music in mean-
ingful ways.Provide tools and resources that empower users to create, discover, and
share music according to their interests and preferences.

3. Facilitate Collaboration: Offer features that enable users to collaborate on


musical projects, share ideas, and provide feedback to one another.

4. Continuous Improvement: Strive for ongoing enhancements and updates to


the platform.Gather user feedback to identify areas for improvement and implement
changes to enhance user experience and functionality over time.

Dept. of ISE, CMRIT, Bengaluru-560037 8


2 LITERATURE SURVEY music recommendation system

2 LITERATURE SURVEY
Finding similar musical patterns using natural language processing (NLP) techniques
is a major difficulty in music exploration. Together, artists and enthusiasts are at-
tempting to bridge the gap between computational linguistics and music in order to
analyze and interpret musical data across a wide range of genres and styles. They
refer to influential scholarly works for direction when negotiating this difficult terrain.
Serra, Xavier, and colleagues’ ”Text Mining for Music Analysis: A Survey” offers
an introduction to text mining methods used in music analysis. Although it is not
exclusively centered around NLP, it emphasizes the possibility of deriving insightful
information from musical texts, such lyrics and reviews.
Tzanetakis and Cook’s ”Automatic Music Genre Classification of Audio Signals”
is the result of more investigation. This paper explores genre classification, which is
a critical first step in finding patterns across a variety of musical styles, even though
it is not specifically related to NLP. Knowing how genres are classified paves the way
for using NLP to find minute parallels.
Last but not least, Sengupta et al.’s ”Analyzing Musical Content of Indian Classi-
cal Music: A Survey” provides insightful techniques for feature extraction, similarity
assessment, and pattern detection that are relevant to all musical styles. Even though
it is unique to Indian classical music, its findings are universal and have motivated
the use of NLP approaches to the complex musical data analysis process. Overall,
Equipped with knowledge gained from these pieces, artists and connoisseurs set out to
create a dependable algorithm that facilitates the investigation and identification of
related melodic patterns in a variety of genres and styles. They see a future in which
music, in all its forms, is understood, valued, and celebrated through this confluence
of creativity and computing.
A. Evolution of Music Therapy and Its Importance
Similar to other sectors utilizing cutting-edge technologies, music therapy has seen
tremendous evolution in recent years [1].A major actor in mental healthcare, music
therapy has emerged while other industries, such as healthcare, music directors, and
retail, have embraced digital disruption. Music therapy has progressively adopted
strategies to optimize mental health issues and handle a variety of challenges as tech-
nology advances. The advent of music therapy has been sparked by the confluence
of technologies like the Internet of Things (IoT), Wireless Sensor Networks (WSN),
and Cyber-Physical Systems (CPS), which present previously unheard-of chances to
transform mental health issues[2].
It has long been recognized that music has the power to evoke emotions, pro-
mote relaxation, and enhance wellbeing. A structured framework for using music’s
therapeutic potential in medical settings has also emerged concurrently with the for-

Dept. of ISE, CMRIT, Bengaluru-560037 9


2 LITERATURE SURVEY music recommendation system

malization of music therapy.[3]. In line with the principles of music therapy, the effort
seeks to assist musicians and music enthusiasts in discovering and analyzing similar
musical patterns. The project uses natural language processing (NLP) techniques to
analyze and interpret musical data with the goal of creating algorithms that can bet-
ter comprehend musical patterns in a variety of genres and styles.[4]. It is impossible
to overestimate the significance of music therapy in spite of these difficulties.
The project’s incorporation of music therapy ideas highlights the comprehensive
approach to music appreciation and inquiry. The project aims to create algorithms
that both discover comparable musical patterns and resonate with the human expe-
rience, so creating stronger connections between music and its listeners, by taking
into account the emotional and psychological aspects of music. [5].The process of
identifying related musical patterns was completely transformed with the advent of
computational techniques. In order to automatically evaluate musical data and ex-
tract characteristics like pitch, duration, and timbre, researchers started creating algo-
rithms. Large-scale music collection analysis was made possible by these algorithms,
which made it easier to spot trends among different genres, styles, and cultural con-
texts. [6].
In general, the process of identifying commonalities in musical patterns is indica-
tive of the fusion of conventional musicology, computer methods, and cognitive science
concepts. The search for comparable musical patterns is set to take off, expanding
our knowledge and appreciation of music across generations and cultures as interdis-
ciplinary cooperation and technology continue to grow.[7].
B. Transformative Potential of similar music patters

Similar music patterns can be found using NLP techniques, opening doors to a vast
musical universe. They facilitate the seamless transition across genres and styles for
both musicians and audiences, which extends their horizons and fosters a deeper ap-
preciation for many musical traditions. Instead of being limited to well-known places,
people can embark on audio experiences that transcend cultural boundaries and his-
torical periods.The discovery of recurrent musical patterns can serve as a source of
inspiration for composers, producers, and performers. Composers can gain a greater
understanding of the basic ideas of musical expression by recognizing recurring themes
in melody, harmony, rhythm, and structure throughout a wide range of musical com-
positions. This new insight fuels their capacity to produce, investigate, and push the
bounds of artistic discovery.

Similar musical patterns found using NLP approaches offer scholars, educators,
and students useful instructional tools. Educators can demonstrate basic ideas in
music theory, composition, and analysis by examining the underlying structures and

Dept. of ISE, CMRIT, Bengaluru-560037 10


2 LITERATURE SURVEY music recommendation system

Figure 2.1: Relationship between music recommendation and therapy

Dept. of ISE, CMRIT, Bengaluru-560037 11


2 LITERATURE SURVEY music recommendation system

motifs shared by a variety of musical works. This nurtures the next generation of
artists and music lovers by facilitating a deeper understanding and enjoyment of mu-
sical workmanship. [8].

Furthermore, our research shed light on the transformative potential of the In-
ternet of Things (IoT) in finding similar music patterns. By seamlessly connecting
physical devices and leveraging existing communication technologies, IoT facilitates
the automation and control of musical processes [2]. The exponential growth of IoT-
connected devices underscores its burgeoning importance in driving efficiency and
productivity across various sectors, including music industry.

Moreover, we explored the diverse array of IoT applications in similar music pat-
terns, ranging from precision farming to livestock monitoring [9]. These applications,
underpinned by IoT’s connectivity and data analytics capabilities, hold immense
promise in enhancing musical productivity and sustainability. With projections in-
dicating significant growth in the global IoT market, the potential for IoT-driven
innovations in musical industry or healthcare is boundless.
In conclusion, our research illuminates the transformative potential of IoT, WSNs,
and CPS in revolutionizing musical patterns. By harnessing the power of these tech-
nologies, similar music patterns promises to usher in a new era of efficiency, sustain-
ability, and resilience in musical operations [4].
Here are our insights from the referred papers as a part of our literature survey:
[10] Customized Music Suggestion Through Collaborative FilteringWriters: H. Ning
and Q. Li; IEEE Journal; 2020. Results: This paper focuses on collaborative filter-
ing approaches for personalized music recommendation systems. Though unrelated to
NLP, it emphasizes how crucial recommendation engines are in helping consumers find
music that suits their tastes. Creating efficient algorithms requires an understand-
ing of user behavior and preferences, which may influence the creation of NLP-based
methods for identifying related musical patterns.

[8] In particular, the use of NLP approaches to music lyrics is examined in this
work. The study looks for stylistic characteristics, sentiment, and thematic patterns
in songs by examining the textual content of the lyrics. The study shows how NLP
may be applied to musical texts in order to extract significant insights, which may
help create methods for identifying related musical patterns based on lyrical content.

[1] The goal of this research is to use topic modeling techniques to identify trends
in music collections. Using the thematic content of music metadata and annotations,
the research aims to categorize and cluster musical works according to their under-

Dept. of ISE, CMRIT, Bengaluru-560037 12


2 LITERATURE SURVEY music recommendation system

lying themes and motifs. The findings show how latent patterns in music collections
can be found using topic modeling. This is helpful when looking for patterns in music
that are similar across different genres and styles using natural language processing
(NLP) approaches.

[2] This study looks into sentiment analysis techniques used on music reviews to
find trends in people’s perceptions and responses to music. By analyzing the tone
of evaluations, the research attempts to identify common themes, listeners’ prefer-
ences, and trends. The findings demonstrate the potential of sentiment analysis to
detect patterns in music consumption behaviors. This information could be useful in
developing algorithms that use natural language processing (NLP) to locate similar
musical patterns.

[4] This paper focuses on collaborative filtering approaches for personalized mu-
sic recommendation systems. Though unrelated to NLP, it emphasizes how crucial
recommendation engines are in helping consumers find music that suits their tastes.
Creating efficient algorithms requires an understanding of user behavior and prefer-
ences, which may influence the creation of NLP-based methods for identifying related
musical patterns.

[9] By examining song similarity networks, this study explores patterns in the
evolution of musical genres. It highlights the significance of examining similarity re-
lationships between songs, albums, and singers even though it has nothing to do with
NLP specifically. One of the main challenges of the research is find and interpret pat-
terns across many musical styles, and this understanding is essential for that purpose.

[11] In particular, the use of NLP approaches to music lyrics is examined in this
work. The study looks for stylistic characteristics, sentiment, and thematic patterns
in songs by examining the textual content of the lyrics. This research is very per-
tinent to the project since it shows how natural language processing (NLP) may be
utilized to glean insightful information from musical texts, which could help in the
identification of related musical patterns based on lyrical content.

[8] In order to identify trends in how people perceive and react to music, this study
investigates sentiment analysis techniques used on music reviews. The study tries to
find common themes, preferences, and trends among listeners by assessing the mood
expressed in reviews. In the context of the project, this research may shed light on
the patterns in music consuming behavior that sentiment analysis might reveal, which
may help develop algorithms for identifying similar patterns in music using natural

Dept. of ISE, CMRIT, Bengaluru-560037 13


2 LITERATURE SURVEY music recommendation system

language processing techniques.

[7] In exploring the field of personalized music recommendation systems, this study
highlights the importance of collaborative filtering methods. Collaborative filtering al-
gorithms can efficiently propose music based on user preferences and actions, thereby
catering to individual tastes. The research findings can offer significant direction for
creating algorithms that identify comparable musical patterns. Comprehending the
functioning of collaborative filtering might provide valuable perspectives for devel-
oping algorithms that efficiently detect trends in music consumption habits, thereby
enabling customized musical exploration.

[6] Using song similarity networks, this study aims to understand trends in the de-
velopment of musical genres. The study illuminates disruptions within these networks
and offers insights into modifications and innovations within musical compositions by
examining similarity relationships between songs, albums, and artists. The project’s
objective of identifying comparable music patterns using NLP approaches can be
improved by comprehending disruptions in song similarity networks. This study em-
phasizes how crucial it is to examine similarity links in order to find and understand
patterns across a variety of musical genres.

[3] This essay investigates the use of natural language processing (NLP) methods
to the analysis of song lyrics, with the goal of identifying stylistic components, sen-
timent, and thematic patterns. The project can benefit greatly from the research’s
discoveries, which show how NLP can glean valuable information from musical compo-
sitions. Comprehending the emotional and thematic elements of song lyrics can offer
more profound understandings of the underlying patterns in musical compositions, so
enriching the knowledge of music patterns and augmenting the efficacy of the project.

[12] The purpose of this study is to find patterns in music collections using topic
modeling approaches. The study intends to classify and cluster musical compositions
according to underlying themes and motifs by examining the thematic content of mu-
sic metadata and annotations. The research’s conclusions provide a useful way for
applying NLP techniques to find recurring musical patterns in a variety of genres and
styles. Gaining a grasp of the subject organization of music collections helps enhance
one’s comprehension of musical patterns by illuminating the similarities and differ-
ences across musical compositions.

[13] This study investigates the use of sentiment analysis tools to music reviews
in order to identify trends in how music is perceived and received. The study tries to

Dept. of ISE, CMRIT, Bengaluru-560037 14


3 THEORETICAL BACKGROUND music recommendation system

find common themes, preferences, and trends among listeners by assessing the mood
expressed in reviews. By showing how sentiment analysis can reveal patterns in music
consumption behavior, the study’s insights can guide the creation of computers that
find comparable music patterns using natural language processing (NLP) approaches.
Gaining an understanding of the affective and perceptual components of music eval-
uations might help reveal the underlying trends in music consumption.

[14] This study sets out to explore the intricate world of song similarity networks
in an effort to unravel the evolution of musical genres. Through examining the rela-
tionships between songs, albums, and performers, the research reveals breaks in these
networks and illuminates the transformational changes in musical works. The knowl-
edge gained by studying song similarity network disruptions provides a strong basis
for the project’s goal of identifying comparable musical patterns through the applica-
tion of natural language processing. Exploring the nuances of similarity connections
opens up new avenues for pattern recognition and interpretation across a range of
musical genres, enhancing the process of musical discovery.

[5] This study explores the field of natural language processing (NLP) as it re-
lates to song lyrics, aiming to decipher the sentiment, thematic layers, and stylistic
subtleties that are present in songs. The project is expected to benefit greatly from
the insights gained from this initiative, which demonstrate the transformative power
of NLP in obtaining meaningful insights from musical texts. Exploring the thematic
and emotional depths of song lyrics reveals hidden patterns in musical compositions,
increasing the project’s effectiveness in identifying patterns in music.
By critically analyzing these papers, it becomes evident that there is a growing
body of research on the integration of technology in musical patterns. These studies
provide valuable insights into the benefits, challenges, and potential applications of
digital solutions in musical therappy practices, highlighting the importance of tech-
nological innovation in addressing global food security and sustainability challenges.

3 THEORETICAL BACKGROUND
Theoretical background highlighting some topics related to the project work is given
below. The description contains several topics which are worth to discuss and also
highlight some of their limitation that encourage going on finding solution as well as
highlights some of their advantages for which reason these topics and their features
are used in this project.

Dept. of ISE, CMRIT, Bengaluru-560037 15


3 THEORETICAL BACKGROUND music recommendation system

3.1 Python
In general, developing an application is a multifaceted and demanding endeavor.
There exist various frameworks tailored , each with its own set of strengths and
weaknesses. While Android offers a native framework based on Java, and iOS pro-
vides one based on Objective-C / Swift, Python presents an alternative approach to
mobile app development through several frameworks and tools.

In Python’s simplicity and versatility to offer high-performance rendering directly


on the operating system’s canvas. With an extensive collection of widgets, PyQt fa-
cilitates rapid UI design akin to HTML, complete with support for animations and
gestures.

Python’s extensive ecosystem and community support enhance development, chal-


lenges include potential performance overhead and managing dependencies. Nonethe-
less, Python with PyQt remains a compelling choice for creating cross-platform ap-
plications with rich, native-like experiences.

Features of Python

1. Programming language with versatility.


2. A vast framework and library environment.
3. Interoperability between platforms.
4. Quick development and prototyping.
5. Thick assistance in creating graphical user interfaces (GUIs).
6. Community Support.

Advantages of Python

1. The development process is accelerated by the clean, straightforward syntax


that is relatively easy for developers to acquire and master.
2. Python frameworks make it possible to reuse code across many platforms, which
reduces the need for duplicate coding and boosts productivity.
3. There is a sizable and vibrant Python development community that provides
copious amounts of documentation, tutorials, forums, and open-source contributions.
This kind of community help speeds up troubleshooting, learning, and teamwork.

Disadvantages of Python

Dept. of ISE, CMRIT, Bengaluru-560037 16


3 THEORETICAL BACKGROUND music recommendation system

1. Python may run more slowly and use more memory, especially when running
computationally demanding or performance-critical applications.
2. In situations when extensive concurrent processing is required, the performance
of multithreaded applications may be impacted by Python’s Global Interpreter Lock,
which can restrict concurrency and parallelism.
3. Managing dependencies in Python can be difficult, particularly when handling
incompatible versions, conflicting dependencies, or problems with package installation.
Virtual environments and dependency resolution tools like pip assist to lessen these
difficulties, but they might need more work.

3.2 Django
Django is a great option for creating dependable and scalable online applications
because of its broad ecosystem, built-in functionality, clear design principles, quick
development speed, and friendly community. Whether creating a basic blog or a
sophisticated business solution, Django offers the resources and tools required to op-
timize the development process and produce web applications of excellent quality
quickly.

Among high-level web frameworks developed in Python, Django stands out for its
pragmatic, clean design and quick development time. Its fundamental tenet, ”Don’t
Repeat Yourself” (DRY), promotes the use of reusable components and makes it an
effective tool for developing intricate online applications. Django’s built-in adminis-
trative interface is one of its most remarkable features; it facilitates data management
duties by automatically generating an admin interface based on the models of the
application. With its great degree of customization, this administrative interface may
be made to meet the demands of any kind of project.

Features of Django

1. An extensive admin interface that comes ready to use, saving developers from
having to write special code to handle users, permissions, and site content.
2. The Model-View-Template (MVT) architectural pattern, which improves code
maintainability and encourages a distinct division of responsibilities.
3. Makes it simple to design and handle HTML forms securely by including built-in
form classes and validation features.
4. Web applications with integrated authentication and authorization procedures,
which simplify the management of user accounts, permissions, and access control.

Dept. of ISE, CMRIT, Bengaluru-560037 17


3 THEORETICAL BACKGROUND music recommendation system

5. Thick assistance in creating graphical user interfaces (GUIs).

Advantages of Django

1. Django adheres to best practices and the ”Don’t Repeat Yourself” (DRY)
philosophy, which helps developers create web applications more rapidly by reusing
code components.
2. A vast array of online applications, including intricate enterprise-level apps and
APIs, as well as basic blogs and content management systems (CMS), may be created
using Django.
3. Django is incredibly scalable and easily manages heavy traffic loads. It facili-
tates both vertical and horizontal scaling by utilizing more potent hardware and load
balancing.

Disadvantages of Django

1. Django has a steep learning curve, especially for people who are not familiar
with Python or web development. It could take some time and effort to comprehend
its ORM ideas and MVC (Model-View-Template) architecture.
2. Because Django is an opinionated framework with preset conventions and pat-
terns, developers who prefer greater freedom in their development approach may find
that their options for flexibility and customization are limited.

3.3 SQL Workbench


SQL Workbench is a versatile and user-friendly integrated development environment
(IDE) designed for SQL database management and development tasks. It offers a
comprehensive set of features, including SQL query editing, database administra-
tion, and data modeling capabilities. With its intuitive interface and powerful tools,
SQL Workbench simplifies database-related tasks, making it a popular choice among
database administrators, developers, and data analysts.
Support for several database systems, such as MySQL, PostgreSQL, Oracle, Mi-
crosoft SQL Server, and others, is one of SQL Workbench’s primary features. Because
of its cross-platform interoperability, users can operate with several databases in a
single environment with ease. In addition, SQL Workbench offers powerful format-
ting, code completion, and syntax highlighting features that improve efficiency and
readability of code. The tool’s capacity to carry out intricate SQL queries, oversee
database connections, and provide query outcomes in tabular or graphical forms bol-
sters its standing as a dependable and effective SQL development tool.

Dept. of ISE, CMRIT, Bengaluru-560037 18


3 THEORETICAL BACKGROUND music recommendation system

Advantages of Using SQL Workbench with Python

Integrating SQl workbench with Python brings several advantages, including:


1. Seamless Integration: Integrates seamlessly with Python, allowing develop-
ers to execute SQL queries and manage databases directly from their Python envi-
ronment. This tight integration streamlines the database-related aspects of Python
development, enhancing productivity and workflow efficiency.
2. Comprehensive Database Support: Supports a wide range of database
systems commonly used with Python, including MySQL, PostgreSQL, SQLite, and
more. This broad compatibility ensures developers can work with different database
technologies within a unified environment, without the need for multiple tools or
interfaces.
3. Efficient Data Analysis: Python’s extensive libraries for data manipulation
and analysis, such as Pandas and NumPy, complement SQL Workbench’s capabilities
for querying and visualizing data. Developers can leverage Python’s rich ecosystem to
perform advanced data analysis tasks on the results of SQL queries, enabling deeper
insights and informed decision-making.
4. Enhanced Scripting Capabilities: Python’s scripting capabilities comple-
ment SQL Workbench’s features for scripting and automation, allowing developers
to automate database-related tasks using Python scripts. This combination enables
the creation of custom workflows and automation scripts tailored to specific project
requirements, improving efficiency and scalability.
5. Cross-Functional Development:Python is a versatile programming lan-
guage that may be used not just for database management but also for web de-
velopment, data science, machine learning, and other software development fields.
Developers can easily incorporate database operations into their larger development
processes by utilizing SQL Workbench with Python. This promotes cross-functional
cooperation and knowledge exchange.
6. Simplified Database Interaction:SQL queries produced dynamically within
Python scripts allow developers to easily interface with databases because of Python’s
readability and simplicity. By doing away with the necessity for manual intervention
in database management chores, this method lowers errors and speeds up develop-
ment cycles.

The combination of SQL Workbench with Python offers developers a powerful


toolkit for database management, data analysis, and application development. By
leveraging Python’s flexibility and SQL Workbench’s comprehensive database sup-
port, developers can streamline their workflows, improve productivity, and build ro-
bust, data-driven applications more effectively.

Dept. of ISE, CMRIT, Bengaluru-560037 19


3 THEORETICAL BACKGROUND music recommendation system

Features of SQL Workbench

Designed for database management and development chores, SQL Workbench is


an integrated development environment (IDE) that is both powerful and versatile. It
provides an extensive feature set designed to satisfy the requirements of data analysts,
developers, and database administrators. The following are some of SQL Workbench’s
primary features:
1. Cross-Platform Compatibility: Broad accessibility for users across different
platforms.
2. Comprehensive Database Support: Broad compatibility allows users to
work with different database technologies seamlessly within a single environment.
3. Database Schema Management: simplifies the process of database design
and maintenance.
4. Data Visualization: tools for visualizing query results in tabular or graphical
formats, making it easier for users to analyze and interpret data retrieved from the
database.
5. Database Administration: Tasks, such as user management, database
backup and restore, and monitoring database performance metrics. This function-
ality enables users to perform essential administrative tasks efficiently.
6. Connection Management: Manage database connections easily, enabling
them to connect to multiple databases simultaneously and switch between different
connections seamlessly.
7. Customizable Interface: SQL Workbench offers a customizable user inter-
face, allowing users to configure the layout, themes, and preferences according to their
preferences and workflow requirements.
8. Extensibility: Highly extensible, allowing users to enhance its functionality
by integrating third-party plugins and extensions to meet specific requirements or add
additional features.
9. Scripting and Automation: Supports scripting and automation through
the use of macros and batch files, enabling users to automate repetitive tasks and
streamline their workflow.
10. SQL Query Editor: Provides a robust SQL query editor with syntax high-
lighting, code completion, and formatting features, making it easier for users to write,
edit, and debug SQL queries efficiently.

Advantages of SQL workbench with Python

1. Comprehensive Database Support: SQL Workbench seamlessly integrates


with various database systems commonly used in Python and Django projects, includ-

Dept. of ISE, CMRIT, Bengaluru-560037 20


3 THEORETICAL BACKGROUND music recommendation system

ing MySQL, PostgreSQL, Oracle, and Microsoft SQL Server. This broad compatibility
ensures developers can efficiently manage and interact with databases regardless of
the backend technology.
2. Efficient SQL Query Development: A user-friendly interface for creating,
running, and troubleshooting SQL queries is offered by SQL Workbench. This fea-
ture allows Python and Django developers to write sophisticated queries to access,
modify, and examine data contained in their databases, improving the functionality
and efficiency of their applications.
3. Data Visualization: SQL Workbench offers built-in tools for visualizing
query results, enabling developers to analyze and interpret data more effectively. By
presenting query results in tabular or graphical formats, developers can gain valuable
insights into the database contents, facilitating informed decision-making during the
development process.
4. Cloud Messaging: Firebase Cloud Messaging (FCM) enables developers to
send push notifications to their Flutter apps across platforms. It provides reliable
message delivery and powerful targeting options to engage users effectively.
SQL Workbench seamlessly integrates with Python and Django projects, allowing
developers to execute SQL queries and manage databases directly from their preferred
development environment. This tight integration streamlines the database-related
aspects of Python and Django development, improving productivity and collaboration
among team members.

Dept. of ISE, CMRIT, Bengaluru-560037 21


4 System Requirements Specification music recommendation system

4 System Requirements Specification


Before any real design or development work starts, an organization’s understanding of
a customer’s or potential client’s system needs and dependencies is effectively outlined
in a System Requirement Specification (SRS). The data gathered for the analysis is
transformed into a paper outlining a set of specifications. It provides a succinct
explanation of the functions the system ought to do as well as the limitations it must
adhere to. Generally speaking, the SRS is a document that outlines exactly what the
suggested program need to accomplish without going into specifics about how it will
do it. It functions as a two-way insurance policy, guaranteeing that at any given time,
the client and the business are both aware of each other’s needs from that standpoint.

4.1 Functional Requirement


A software system’s function and how it must respond to particular inputs or cir-
cumstances are specified by its functional requirements. These could consist of com-
putations, processing and manipulation of data, and other specialized features. The
following functional needs are found in this system:
1. The entire code must be written in python and Django.
2. API must be properly connected.
3. The lists of song datasets must be properly trained.
4. API must be embedded properly.
5. NLP Interpretation and Feature Deletion:NLP can be used to analyze textual
data, such as lyrics.Take out the themes, sentiment, and semantic elements.
6. Identification of Patterns and Comparative Analysis:Put pattern recognition al-
gorithms into practice.Compare musical compositions according to their shared char-
acteristics.
7. User Communication and Input:Provide interfaces that are easy to use. Request
input from users in order to provide tailored recommendations.
8. Give musical pattern visualization tools.Provide elucidation tools to enhance
comprehension.

4.2 Non-Functional Requirements


Requirements classified as non-functional are those that are unrelated to the specific
task that the system is meant to perform. Instead of concentrating on specific be-
haviors, they establish the benchmarks that can be used to assess how well a system
performs. They may be related to emergent system properties including dependability,
store occupancy, and response time. External factors such as user needs, budgetary

Dept. of ISE, CMRIT, Bengaluru-560037 22


4 System Requirements Specification music recommendation system

constraints, organizational policies, or the necessity for interoperability with other


hardware and software systems can all result in non-functional requirements:
• Product Requirements
• Organizational Requirements
• User Requirements
• Basic Operational Requirements

4.2.1 Product Requirements

Platform Independency: Standalone executables for embedded systems can be


created so that the algorithm developed using available products could be downloaded
on the actual hardware and executed without any dependency on the development
and modeling platform.

Correctness: It computes using a clearly defined set of steps and guidelines, and
thorough testing is done to verify that the data is accurate.

Modularity: The complete product is broken up into many modules, and well-
defined interfaces are developed to explore the benefit of the flexibility of the product.

Accessibility: Ensure the application is accessible to users with varying levels of


digital literacy and technological resources.

Scalability: Design the platform to accommodate a growing user base and evolv-
ing agricultural needs over time.

Another name for non-functional requirements is system characteristics. These


attributes fall into two categories: evolution quality and execution quality. While
testability, maintainability, extensibility, or scalability are components of evolution
quality, execution qualities are those that are noticed during runtime and include se-
curity and usability of the system.

4.2.2 Organizational Requirements

Process Guidelines: The application is developed according to the guidelines


established by software engineering ethics, which are the same guidelines followed by
developers worldwide.

Dept. of ISE, CMRIT, Bengaluru-560037 23


4 System Requirements Specification music recommendation system

Design Methods:One of the crucial phases in the software engineering process is


design. The process of transitioning from the problem domain to the solution domain
begins at this point. Stated differently, designing needs-based solutions starts with
what is actually needed.

Localized Support: Offer customer support and assistance in multiple lan-


guages, ensuring that farmers from diverse linguistic backgrounds can effectively uti-
lize the platform.

4.2.3 User Requirements

1. It should be possible for users to establish profiles with their favorite artists,
genres, and moods.
2. It should be possible for users to search for music using a variety of parameters,
including lyrical themes, pace, mood, and genre.
3.Based on user input and preferences, the system ought to suggest related songs
or artists.
4. Personalized recommendations based on each user’s listening history and pref-
erences should be provided by the system.
5. It is important to protect and maintain users’ listening history and personal
information.Data protection laws should be followed, and the system should be trans-
parent about how data is used and stored.

4.2.4 Basic Operational Requirements

The eight main roles of systems engineering are performed by the customers, with
particular attention paid to the operator as the prime customer. Operational require-
ments will specify the fundamental necessity and will, at the very least, pertain to
the following aspects:-

Mission profile or scenario: It explains the steps taken to achieve the mission’s
goal. It also determines the system’s efficacy or efficiency.

workspace settings: It provides a synopsis of how the system is used. deter-


mines suitable settings for efficient system performance.

The life cycle of an operation: It specifies the lifetime of the system.

Dept. of ISE, CMRIT, Bengaluru-560037 24


4 System Requirements Specification music recommendation system

Data Security: Prioritize the security and privacy of user data, adhering to
industry-standard encryption protocols and data protection regulations.

4.2.5 System Configuration

H/W System Configuration:


- Processor - 13/Intel Processor(minimum)
- Speed - 2.0 GHz
- RAM - 8GB (minimum)
- Hard Disk - 160 GB
- Keyboard -ypical Windows Keyboard
- Mouse - Dual or Triple Button
- Monitor - SVGA

S/W System Configuration:


- Operating System: Windows 7/8/10
- Coding Language: Python,Html,Jss
- Tools: VSCode, Pycharm

Mobile Compatibility:
Ensure that the application is optimized for mobile devices, allowing farmers to
access critical information and features while working in the field.

Online Functionality:
Crop Connect relies on online connectivity for real-time weather updates, crop
management resources, and seamless communication among users. This infrastruc-
ture ensures farmers stay informed and connected, accessing agricultural insights any-
where, anytime.

Dept. of ISE, CMRIT, Bengaluru-560037 25


5 System Analysis music recommendation system

5 System Analysis
The process of analyzing an issue involves determining its optimal solution. System
analysis is the process by which we identify the issues that now exist, specify the needs
and goals, and assess the potential solutions. It is a way of looking at the company
and the issue it faces, as well as a collection of tools that aid in resolving these issues.
A feasibility study is crucial to system analysis because it provides the goal for design
and development.

5.1 Feasibility Study


When given infinite time and infinite resources, all systems are possible. Unfortu-
nately, the real world does not operate under this situation. Therefore, it is advisable
and vital to assess the system’s viability as soon as possible. It is possible to save
months or years of work, thousands of rupees, and countless hours of professional
shame by identifying an inadequate system early on in the defining stage.

• ECONOMICAL FEASIBILITY
• TECHNICAL FEASIBILITY
• SOCIAL FEASIBILITY

5.1.1 Economical Feasibility

Determine the cost of buying gear, obtaining software licenses, hiring individuals
with skills in machine learning, signal processing, and natural language processing,
and acquiring datasets.

5.1.2 Technical Feasibility

The purpose of this study is to evaluate the system’s technical requirements, or its
technical feasibility. Any system that is created must not place a heavy burden on
the technical resources that are available. As a result, the client will face strict re-
quirements. Since deploying the designed system will only require minimum or null
changes, it must have modest requirements.

5.1.3 Operational Feasibility

Determine whether or not musicians, music lovers, and music streaming services are
willing to accept and use the method to find comparable musical patterns.Think
about how the project might affect current workflows, procedures, and systems in
communities or organizations that are part of the music industry.

Dept. of ISE, CMRIT, Bengaluru-560037 26


5 System Analysis music recommendation system

5.2 Analysis
5.2.1 Performance Analysis

A performance analysis is conducted on a system that finds similar musical patterns


through natural language processing (NLP). The system’s efficacy, scalability, and
efficiency are assessed. Reducing the time required for collecting, organizing, and
evaluating musical data requires accurate and efficient data processing.

5.2.2 Technical Analysis

The system will only be useful if it can be transformed into an information system that
satisfies the technological needs of the company. There are a few things to consider
in relation to all of these technical analysis issues:
• Changes to bring in the system: All changes should be in a positive direction,
there will be increased levels of efficiency and better customer service.
• Required skills: Platforms tools used in this project are widely used. So the
skilled manpower is readily available in industry.
• Acceptability:The system’s architecture is kept practical enough that there
shouldn’t be any issues from the user’s perspective.
Ensure that the app’s architecture and design facilitate seamless integration with
existing agricultural information systems and databases.
Consider scalability to accommodate potential future expansions of the app’s fea-
tures and user base.

5.2.3 Economical Analysis

Evaluating the costs and benefits of creating a system for finding comparable musi-
cal patterns is part of the economic analysis process. Purchasing hardware, hiring
qualified staff, licensing software, and obtaining datasets are among the expenses.The
costs are compared to the advantages, which include better music recommendations
and higher user involvement.

Dept. of ISE, CMRIT, Bengaluru-560037 27


6 System Design music recommendation system

6 System Design
A useful engineering depiction of a proposed construction is called a design. It is
the most important stage of a system’s development. The process of converting the
requirements into a software representation is known as software design. In software
engineering, design is where it is nurtured. The new system needs to be built based
on the needs of the users and a thorough analysis of the current system. This stage
of the system design process is it.

6.1 System Development Methodology


The process of finishing a product or solving an issue with a product is called the
system development method. The phases, steps, and procedures that make up the
software development process are what are used to characterize the finished product.
It adheres to a set of procedures that advance the product. The waterfall model is
the development methodology used in this project.

Model phases

The waterfall model is a sequential software development process where require-


ments are initiated, analyzed, designed, implemented, tested, and maintained, with
progress appearing to flow gradually downward (like a waterfall) at each stage.
• Analysis of Requirements: Gathering the system’s needs is the focus of this
phase. This procedure entails reviewing requirements and producing documentation.
Textbf• System Architecture: The system specs are converted into a software
representation while keeping the needs in mind. The designer places a lot of emphasis
on data structures, algorithms, software architecture, etc. at this phase.
• Coding: The programmer begins coding at this stage in order to provide a
complete sketch of the final product. Put another way, only computer code that is
readable by machines is created from system specifications.
Advantages of the Waterfall Model:

• Clear project objectives.


• Stable project requirements.
• The system’s progress is quantifiable.
• Tight sign-off specifications.
• A clear understanding of software development logic exists.
• Creating an official specification.

Dept. of ISE, CMRIT, Bengaluru-560037 28


6 System Design music recommendation system

Figure 6.2: Waterfall model

6.2 Flow Diagram


It is a simple graphical formalism that can be used to represent a system in terms of
the input data to the system, various processing carried out on these data, and the
output data generated by the system.

The music recommendation system’s data flow between its various modules is
depicted in the block diagram. The User Input Module is where it starts, where
users provide the necessary data, including song titles, or preferred moods. The Data
Parsing Module processes the input data to extract pertinent song-related information
after the inputs are successfully supplied. Subsequently, in order to analyze song
patterns, the Feature Extraction Module finds important musical elements including
note structures and fundamental frequencies.

Dept. of ISE, CMRIT, Bengaluru-560037 29


6 System Design music recommendation system

Figure 6.3: Flow daigram

6.3 Methodology
The development of our music recommendation system is structured into two major
phases, as illustrated in [Figure 6.4]. Each phase is meticulously designed to achieve
specific objectives and ensure a seamless user experience.

A. Phase I In Phase I, we are focusing on comprehensive development to meet


the unique needs of our consumers of the music recommendation system. There are
several important phases:
Here is the revised text based on the given figure and the project’s structure:

We begin the process in Phase I by carefully organizing and designing the main
characteristics, functionality, and user interface of our music recommendation system.
This establishes the framework for further stages of development.

Dept. of ISE, CMRIT, Bengaluru-560037 30


6 System Design music recommendation system

Figure 6.4: System architecture

The first stage of our development process is the thorough management of music
data, which entails the following crucial actions:
1. **Music Data Processing**: We collect and get ready to analyze musical data.

2. **Feature Extraction**: To enable precise recommendations, important musi-


cal features are taken out of the data.

Users receive the recommendations. Customers are guaranteed a unique and in-
teresting user experience since they can input the name of an album to obtain a list
of songs with comparable raga patterns or based on mood searches.
After development is finished, testing and quality assurance are the next steps.
The functionality, security, and performance of the music recommendation system
are rigorously tested to make sure they live up to the highest expectations. The
fastest possible resolution of any problems or errors found during this stage ensures
that the user experience is perfect.
After testing successfully, we make the music recommendation system available
to the whole audience. As the technology becomes available to consumers and of-

Dept. of ISE, CMRIT, Bengaluru-560037 31


6 System Design music recommendation system

fers tailored music recommendations based on raga patterns and mood searches, this
represents a big milestone.

Figure 6.5: System architecture flow

B. Phase II
In Phase II, our objective shifts towards integrating advanced features that enhance
the music recommendation system’s capabilities. This phase involves several integra-
tion stages:

1. **Enhanced Recommendation Algorithms**:putting into practice more ad-


vanced machine learning models to enhance the relevance and accuracy of music
recommendations.
2. **User Personalization**: Developing personalized recommendation strategies
based on individual user preferences and listening history.

3. **Real-time Data Processing**: Integrating systems for real-time processing and


analysis of new music data and user interactions.

4. **Scalability and Performance Optimization**: Ensuring that the system can


handle a growing number of users and large volumes of music data efficiently.

Dept. of ISE, CMRIT, Bengaluru-560037 32


6 System Design music recommendation system

5. **User Feedback Integration**: Creating mechanisms for users to provide feedback


on recommendations, which will be used to continually refine and improve the system.

By focusing on these integration stages, we aim to deliver a more intelligent, re-


sponsive, and user-centric music recommendation experience. .

6.4 Tools Used


A range of tools and technologies were employed throughout the development of our
music recommendation system to guarantee strong performance, an intuitive interface,
and the smooth incorporation of sophisticated functionalities. The main instruments
utilized are listed :

1. Django:
-Django is a high-level Python web framework that encourages effective development
and clear, uncomplicated design. A group of talented developers built Django, which
takes care of many of the bothers involved with web development so you can focus on
building your project instead of having to start from scratch.
Significance: Django is appropriate for many different types of online applica-
tions, such as scientific computing platforms, social networks, and content manage-
ment systems.
Advantages:
- Django is designed to help developers scale from simple to complex web applica-
tions. Its modular design and reusability of components allow for better scalability.
- Django’s automated admin interface is one of its best qualities. Without needing
to create any more code, managing site content is made simple with this dynamic and
customized admin panel.
-The Model-View-Controller (MVC) architectural paradigm, which Django ad-
heres to, helps to manage and scale applications by separating the functionality from
the user interface.

1. Python:
Python is a object-oriented language which provied high end built-in functionality to
the programmers. Significance: Python is a versatile and powerful programming
language that simplifies complex software development tasks and is renowned for its
readability and ease of use.
Advantages:

Dept. of ISE, CMRIT, Bengaluru-560037 33


6 System Design music recommendation system

- Python’s simple and intuitive syntax promotes faster learning and reduces the
time needed to develop and debug code.
- A vast standard library and extensive collection of third-party packages allow
developers to implement a wide range of functionalities without having to write code
from scratch.
- Python supports multiple programming paradigms, including procedural, object-
oriented, and functional programming, offering flexibility in designing and organizing
code.
- The language’s integration capabilities with other technologies, such as C/C++,
Java, and .NET, enable seamless incorporation of Python into existing systems.
3. Django API: - The Django framework has an interface called the Django API
that lets programmers design and administer web APIs for their apps.
Significance: In web applications developed with Django, the Django API is
essential for enabling connection between frontend and backend components, guaran-
teeing smooth data interchange and interaction.
Advantages:
- Full support for creating RESTful APIs, which enables programmers to specify end-
points, serialize data, and effectively process HTTP requests.
- Developers may implement user authentication and permissions efficiently thanks to
integration with Django’s authentication and authorization system, which guarantees
secure access to API endpoints.
- The development process is streamlined by built-in capabilities like the Django Rest
Framework (DRF).
4. Music Pattern Dataset: Advantages of Utilizing Music Pattern Datasets:
Comprehensive datasets including a broad variety of musical patterns are beneficial
to our endeavor. system.
Advantages:
- The robustness of our approach for identifying comparable music patterns is im-
proved by having access to a variety of datasets with different music patterns. Exten-
sive datasets provide efficient training of models across many musical genres, hence
enhancing the precision of pattern identification.

6.5 Dataset Explaination


Music databases and repositories were among the sources of the datasets we used in
our effort to identify patterns in comparable music and develop a recommendation
engine. A vast variety of musical tracks organized by genres, styles, and patterns can
be found in these datasets.

1. Dataset Origin:

Dept. of ISE, CMRIT, Bengaluru-560037 34


6 System Design music recommendation system

Figure 6.6: ER Diagram

-The main forum for data sharing and cooperation between researchers, hobbyists,
and data scientists is Kaggle. It provides access to a huge library of datasets from
many different fields, including agriculture.
2. Composition:
To enable effective model creation and evaluation, the dataset is organized in
compliance with industry best practices, dividing samples into distinct sets for training
and testing.
3. Structure:
Subfolders with audio samples from diverse genres and styles facilitate thorough
model learning, making it possible to identify subtle patterns in music from a variety
of categories.

4. Audio Variety:
By exposing the model to a wide range of musical genres, this diversity ensures the
model’s robustness and promotes accuracy and adaptability in tasks involving genre
categorization and mood analysis.
5. Machine Learning Training:
- The dataset enables machine learning algorithms to identify underlying patterns
and structures in music through platforms such as Teachable Machine Learning.
- Through the process of extracting pertinent information from audio recordings,
models are trained so that algorithms can be trained to correlate particular musical
attributes, genres, or moods with these features.
6. Numpy Implementation:
- Numpy, a potent Python numerical computing toolkit, is used to process the
recommendations after the recommendation model training is complete.
- Numpy’s fast computation of musical pattern similarities is made possible by
its effective array operations and mathematical functions, which provide precise and
timely recommendations.
7. Quality Assurance:
- Rigorous testing and validation procedures are essential to ensure the reliability

Dept. of ISE, CMRIT, Bengaluru-560037 35


6 System Design music recommendation system

and effectiveness of the trained models.


- The ”test” set, comprising unseen images, is used to evaluate the model’s per-
formance metrics, such as accuracy, precision, recall, and F1-score.
- Metrics provide insights into the model’s ability to correctly classify diseases
while minimizing false positives and false negatives, thereby ensuring actionable and
reliable results for farmers.

8. Importance and Future Considerations:


- Content-Based Filtering: Customize recommendations to individual preferences
by examining music metadata such as artist, genre, tempo, and mood.
- Integration of External Data: To improve recommendation algorithms and iden-
tify changing trends, integrate data from other sources like social media and music
streaming services.
- Investigation of Novel Algorithms: To find complex patterns and relationships
in music data, experiment with cutting-edge machine learning algorithms, such as
ensemble techniques or deep learning models.

Dept. of ISE, CMRIT, Bengaluru-560037 36


7 Implementation music recommendation system

7 Implementation
7.1 Authentication : Login-Sigup

{%e x t e n d s ’ base . html ’%} {% b l o c k code %}


<!−− ======= Hero S e c t i o n ======= −−>
<s e c t i o n i d=”hero ” c l a s s =”hero d−f l e x a l i g n −items−c e n t e r ”>
<d i v c l a s s =” c o n t a i n e r ”>
<d i v c l a s s =”row”>
<d i v c l a s s =”c o l −xl −4”>
<h2 data−aos=”fade −up”>Login </h2>
<b l o c k q u o t e data−aos=”fade −up” data−aos−d e l a y =”100”>
<p>
<form a c t i o n =”” method=”p o s t”>
{% c s r f t o k e n %}
<c e n t e r >
<h4>
<t a b l e >

{{ l o g i n f o r m }}

</t a b l e >
</h4>
</c e n t e r >
<button type=”submit ” c l a s s =”btn btn−primary ” >Submit</button

</div>
</form>
</p>
</b l o c k q u o t e >
<d i v c l a s s =”d−f l e x ” data−aos=”fade −up” data−aos−d e l a y =”200”>
<a
h r e f =”h t t p s : / /www. youtube . com/ watch ?v=LXb3EKWsInQ”
c l a s s =” g l i g h t b o x btn−watch−v i d e o d−f l e x a l i g n −items−c e n t e r ”
>
</div>
</div>
</div>
</div>
</ s e c t i o n >

Dept. of ISE, CMRIT, Bengaluru-560037 37


7 Implementation music recommendation system

</form>
<!−− End Hero S e c t i o n −−>
{% e n d b l o c k %}

.
Album Page
<!DOCTYPE html>
<html l a n g=”en”>
<head>
<meta c h a r s e t =”u t f −8” />
<meta c o n t e n t=”width=d e v i c e −width , i n i t i a l −s c a l e =1.0” name=”v i e w p o r t

< t i t l e >Music template </ t i t l e >


<meta c o n t e n t =”” name=” d e s c r i p t i o n ” />
<meta c o n t e n t =”” name=”keywords ” />

<!−− F a v i c o n s −−>
<l i n k h r e f =”/ s t a t i c / a s s e t s /img/ f a v i c o n . png” r e l =”i c o n ” />
<l i n k
h r e f =”/ s t a t i c / a s s e t s /img/ apple−touch−i c o n . png”
r e l =”apple−touch−i c o n ”
/>

<!−− Google Fonts −−>


<l i n k r e l =”p r e c o n n e c t ” h r e f =”h t t p s : / / f o n t s . g o o g l e a p i s . com” />
<l i n k r e l =”p r e c o n n e c t ” h r e f =”h t t p s : / / f o n t s . g s t a t i c . com” c r o s s o r i g i n
<l i n k
h r e f =”h t t p s : / / f o n t s . g o o g l e a p i s . com/ c s s 2 ? f a m i l y=Open+Sans : i t a l , wght@
r e l =” s t y l e s h e e t ”
/>

<!−− Vendor CSS F i l e s −−>


<l i n k
h r e f =”/ s t a t i c / a s s e t s / vendor / b o o t s t r a p / c s s / b o o t s t r a p . min . c s s ”
r e l =” s t y l e s h e e t ”
/>
<l i n k
h r e f =”/ s t a t i c / a s s e t s / vendor / b o o t s t r a p −i c o n s / b o o t s t r a p −i c o n s . c s s ”
r e l =” s t y l e s h e e t ”

Dept. of ISE, CMRIT, Bengaluru-560037 38


7 Implementation music recommendation system

/>
<l i n k h r e f =” a s s e t s / vendor / aos / aos . c s s ” r e l =” s t y l e s h e e t ” />
<l i n k
h r e f =”/ s t a t i c / a s s e t s / vendor / g l i g h t b o x / c s s / g l i g h t b o x . min . c s s ”
r e l =” s t y l e s h e e t ”
/>
<l i n k
h r e f =”/ s t a t i c / a s s e t s / vendor / s w i p e r / swiper −bundle . min . c s s ”
r e l =” s t y l e s h e e t ”
/>
<l i n k
h r e f =”/ s t a t i c / a s s e t s / vendor / r e m i x i c o n / r e m i x i c o n . c s s ”
r e l =” s t y l e s h e e t ”
/>

<!−− Template Main CSS F i l e −−>


<l i n k h r e f =”/ s t a t i c / a s s e t s / c s s /main . c s s ” r e l =” s t y l e s h e e t ” />

<!−− =======================================================
∗ Template Name : Nova − v1 . 3 . 0
∗ Template URL: h t t p s : / / bootstrapmade . com/ nova−b o o t s t r a p −b u s i n e s s −t e m p
∗ Author : BootstrapMade . com
∗ L i c e n s e : h t t p s : / / bootstrapmade . com/ l i c e n s e /
======================================================== −−>
</head>

<body c l a s s =”page−i n d e x”>


<!−− ======= Header ======= −−>
<header i d=”header ” c l a s s =”header d−f l e x a l i g n −items−c e n t e r f i x e d −top
<d i v
c l a s s =”c o n t a i n e r −f l u i d c o n t a i n e r −x l d−f l e x a l i g n −items−c e n t e r j u
>
<a h r e f =”i n d e x . html ” c l a s s =”l o g o d−f l e x a l i g n −items−c e n t e r ”>
<!−− Uncomment th e l i n e below i f you a l s o wish t o use an image
<!−− <img s r c =” a s s e t s /img/ l o g o . png” a l t =””> −−>
<h1 c l a s s =”d−f l e x a l i g n −items−c e n t e r ”>MUSIC</h1>
</a>

<i c l a s s =”mobile−nav−t o g g l e mobile−nav−show b i bi− l i s t ”></i >

Dept. of ISE, CMRIT, Bengaluru-560037 39


7 Implementation music recommendation system

<i c l a s s =”mobile−nav−t o g g l e mobile−nav−h i d e d−none b i bi−x”></i >

<nav i d=”navbar ” c l a s s =”navbar”>


<ul>
<l i >
<a h r e f =”/userhome”><h4>UserHome</h4></a>
</ l i >
<l i >
<a h r e f =”/album”><h4>Album</h4></a>
</ l i >
<l i >
<a h r e f =”/ r e s u l t 2 ”><h4>Mood</h4></a>
</ l i >
<l i >
<a h r e f =”/ r e s u l t ”><h4>Result </h4></a>
</ l i >
<l i >
<a h r e f =”/”><h4>Logout </h4></a>
</ l i >
</ul>
</nav>
<!−− . navbar −−>
</div>
</header>
<!−− End Header −−>
{% b l o c k code%} {% e n d b l o c k %}
<a
h r e f=”#”
c l a s s =” s c r o l l −top d−f l e x a l i g n −items−c e n t e r j u s t i f y −co nte nt −c e n t e r
><i c l a s s =”b i bi−arrow−up−s h o r t ”></ i
></a>

<d i v i d=” p r e l o a d e r ”></div>

<!−− Vendor JS F i l e s −−>


< s c r i p t s r c =”/ s t a t i c / a s s e t s / vendor / b o o t s t r a p / j s / b o o t s t r a p . bundle . min
< s c r i p t s r c =”/ s t a t i c / a s s e t s / vendor / aos / aos . j s ”></ s c r i p t >
< s c r i p t s r c =”/ s t a t i c / a s s e t s / vendor / g l i g h t b o x / j s / g l i g h t b o x . min . j s ”></
< s c r i p t s r c =”/ s t a t i c / a s s e t s / vendor / s w i p e r / swiper −bundle . min . j s ”></ s c

Dept. of ISE, CMRIT, Bengaluru-560037 40


7 Implementation music recommendation system

< s c r i p t s r c =”/ s t a t i c / a s s e t s / vendor / i s o t o p e −l a y o u t / i s o t o p e . pkgd . min . j


< s c r i p t s r c =”/ s t a t i c / a s s e t s / vendor /php−email−form / v a l i d a t e . j s ”></ s c r

<!−− Template Main JS F i l e −−>


< s c r i p t s r c =”/ s t a t i c / a s s e t s / j s /main . j s ”></ s c r i p t >
</body>
</html>

7.2 About Page

{%e x t e n d s ’ base2 . html ’%} {% b l o c k code %}


<!−− ======= Hero S e c t i o n ======= −−>
<s e c t i o n i d=”hero ” c l a s s =”hero d−f l e x a l i g n −items−c e n t e r ”>
<d i v c l a s s =” c o n t a i n e r ”>
<d i v c l a s s =”row”>
<d i v c l a s s =”c o l −xl −4”>
<h2 data−aos=”fade −up”>Welcome User . . . . < / h2>
<b l o c k q u o t e data−aos=”fade −up” data−aos−d e l a y =”100”>
<p>
<h2>
Enjoy your music . what you want
</h2>
</p>
</b l o c k q u o t e >
<d i v c l a s s =”d−f l e x ” data−aos=”fade −up” data−aos−d e l a y =”200”>
<a
h r e f =”h t t p s : / /www. youtube . com/ watch ?v=LXb3EKWsInQ”
c l a s s =” g l i g h t b o x btn−watch−v i d e o d−f l e x a l i g n −items−c e n t e r ”
>
</div>
</div>
</div>
</div>
</ s e c t i o n >
<!−− End Hero S e c t i o n −−>
{% e n d b l o c k %}

7.3 Django framework

Dept. of ISE, CMRIT, Bengaluru-560037 41


7 Implementation music recommendation system

”””
Django s e t t i n g s f o r music p r o j e c t .

Generated by ’ django−admin s t a r t p r o j e c t ’ u s i n g Django 4 . 0 . 8 .

For more i n f o r m a t i o n on t h i s f i l e , s e e
h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / t o p i c s / s e t t i n g s /

For t he f u l l l i s t o f s e t t i n g s and t h e i r v a l u e s , s e e
h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / r e f / s e t t i n g s /
”””

from p a t h l i b import Path

# B u i l d paths i n s i d e t he p r o j e c t l i k e t h i s : BASE DIR / ’ s u b d i r ’ .


BASE DIR = Path ( f i l e ) . r e s o l v e ( ) . parent . parent

# Quick−s t a r t development s e t t i n g s − u n s u i t a b l e f o r p r o d u c t i o n
# See h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / howto / deployment / c h e c k l i s t /

# SECURITY WARNING: keep th e s e c r e t key used i n p r o d u c t i o n s e c r e t !


SECRET KEY = ’ django−i n s e c u r e −mhr8∗ b hl#@−y ! ∗ k2 ∗ p 2 l =!)3n5@) −! u0 ) d 6 z e #7f 5+

# SECURITY WARNING: don ’ t run with debug turned on i n p r o d u c t i o n !


DEBUG = True

ALLOWED HOSTS = [ ]

# Application d e f i n i t i o n

INSTALLED APPS = [
’ django . c o n t r i b . admin ’ ,
’ django . c o n t r i b . auth ’ ,
’ django . c o n t r i b . c o n t e n t t y p e s ’ ,
’ django . c o n t r i b . s e s s i o n s ’ ,
’ django . c o n t r i b . messages ’ ,
’ django . c o n t r i b . s t a t i c f i l e s ’ ,

Dept. of ISE, CMRIT, Bengaluru-560037 42


7 Implementation music recommendation system

’ musicapp ’ ,
]

MIDDLEWARE = [
’ django . middleware . s e c u r i t y . S e c u r i t y M i d d l e w a r e ’ ,
’ django . c o n t r i b . s e s s i o n s . middleware . S e s s i o n M i d d l e w a r e ’ ,
’ django . middleware . common . CommonMiddleware ’ ,
’ django . middleware . c s r f . CsrfViewMiddleware ’ ,
’ django . c o n t r i b . auth . middleware . A u t h e n t i c a t i o n M i d d l e w a r e ’ ,
’ django . c o n t r i b . messages . middleware . MessageMiddleware ’ ,
’ django . middleware . c l i c k j a c k i n g . XFrameOptionsMiddleware ’ ,
]

ROOT URLCONF = ’ music . u r l s ’

TEMPLATES = [
{
’BACKEND’ : ’ django . t e m p l a t e . backends . django . DjangoTemplates ’ ,
’ DIRS ’ : [ ] ,
’APP DIRS ’ : True ,
’OPTIONS ’ : {
’ context processors ’ : [
’ django . t e m p l a t e . c o n t e x t p r o c e s s o r s . debug ’ ,
’ django . t e m p l a t e . c o n t e x t p r o c e s s o r s . r e q u e s t ’ ,
’ django . c o n t r i b . auth . c o n t e x t p r o c e s s o r s . auth ’ ,
’ django . c o n t r i b . messages . c o n t e x t p r o c e s s o r s . messages ’ ,
],
},
},
]

WSGI APPLICATION = ’ music . wsgi . a p p l i c a t i o n ’

# Database
# h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / r e f / s e t t i n g s /#d a t a b a s e s

DATABASES = {
’ default ’ : {

Dept. of ISE, CMRIT, Bengaluru-560037 43


7 Implementation music recommendation system

’ENGINE ’ : ’ django . db . backends . s q l i t e 3 ’ ,


’NAME’ : BASE DIR / ’ db . s q l i t e 3 ’ ,
}
}

# Password v a l i d a t i o n
# h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / r e f / s e t t i n g s /#auth−password−v a l i d

AUTH PASSWORD VALIDATORS = [


]

# Internationalization
# h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / t o p i c s / i 1 8 n /

LANGUAGE CODE = ’ en−us ’

TIME ZONE = ’UTC’

USE I18N = True

USE TZ = True

# S t a t i c f i l e s (CSS , J a v a S c r i p t , Images )
# h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / howto / s t a t i c − f i l e s /

STATIC URL = ’ s t a t i c / ’

# D e f a u l t primary key f i e l d type


# h t t p s : / / docs . d j a n g o p r o j e c t . com/ en / 4 . 0 / r e f / s e t t i n g s /#d e f a u l t −auto−f i e l d

DEFAULT AUTO FIELD = ’ django . db . models . BigAutoField ’

7.4 Configuration page

from django . apps import AppConfig

Dept. of ISE, CMRIT, Bengaluru-560037 44


7 Implementation music recommendation system

c l a s s MusicappConfig ( AppConfig ) :
d e f a u l t a u t o f i e l d = ’ django . db . models . BigAutoField ’
name = ’ musicapp ’

7.5 Views.py(API Calls and Page rendering

# this all librarys


from django . s h o r t c u t s import re n de r , r e d i r e c t
from django . c o n t r i b import messages
from django . c o n t r i b . auth . models import User
from . forms import NewUserForm
from django . c o n t r i b . auth import l o g i n , a u t h e n t i c a t e
from django . c o n t r i b . auth . forms import AuthenticationForm # add t h i s
import pandas as pd
import s e a b o r n as s n s
import m a t p l o t l i b . p y p l o t as p l t
from s k l e a r n . f e a t u r e e x t r a c t i o n . t e x t import C o u n t V e c t o r i z e r
from s k l e a r n . f e a t u r e e x t r a c t i o n . t e x t import T f i d f V e c t o r i z e r
from s k l e a r n . m e t r i c s . p a i r w i s e import c o s i n e s i m i l a r i t y
import r e
import n l t k
from n l t k . c o r p u s import stopwords

# Cr eate your v i e w s h e r e .

# This i s t h e home page


def index ( request ) :
r e t u r n r e n d e r ( r e q u e s t , ’ i n d e x . html ’ )

# This i s about i t s a s m a l l i n f o r m a t i o n about your p r o j e c t

d e f about ( r e q u e s t ) :
r e t u r n r e n d e r ( r e q u e s t , ’ about . html ’ )

# R e g i s t e r page

Dept. of ISE, CMRIT, Bengaluru-560037 45


7 Implementation music recommendation system

def r e g i s t e r ( request ) :
i f r e q u e s t . method == ”POST” :
form = NewUserForm ( r e q u e s t .POST)
i f form . i s v a l i d ( ) :
form . s a v e ( )
messages . s u c c e s s ( r e q u e s t , ” R e g i s t r a t i o n s u c c e s s f u l . ” )
return r e d i r e c t (” l o g i n ”)
messages . e r r o r (
request , ” Unsuccessful r e g i s t r a t i o n . Invalid information . ” )
form = NewUserForm ( )
r e t u r n r e n d e r ( r e q u e s t=r e q u e s t , template name=” r e g i s t e r . html ” , c o n t e x

# Login page

def mood result ( request ) :


r e t u r n r e n d e r ( r e q u e s t=r e q u e s t , template name=”m o o d r e s u l t . html ” )
def result2 ( request ) :
r e t u r n r e n d e r ( r e q u e s t=r e q u e s t , template name=” r e s u l t 2 . html ” )
def login ( request ) :
i f r e q u e s t . method == ”POST” :
form = AuthenticationForm ( r e q u e s t , data=r e q u e s t .POST)
i f form . i s v a l i d ( ) :
username = form . c l e a n e d d a t a . g e t ( ’ username ’ )
password = form . c l e a n e d d a t a . g e t ( ’ password ’ )
u s e r = a u t h e n t i c a t e ( username=username , password=password )
i f u s e r i s not None :

messages . i n f o ( r e q u e s t , f ”You a r e now l o g g e d i n as { userna


r e t u r n r e d i r e c t ( ” userhome ” )
else :
messages . e r r o r ( r e q u e s t , ” I n v a l i d username o r password . ” )
else :
messages . e r r o r ( r e q u e s t , ” I n v a l i d username o r password . ” )
form = AuthenticationForm ( )
r e t u r n r e n d e r ( r e q u e s t=r e q u e s t , template name=” l o g i n . html ” , c o n t e x t ={

# u s e r Home page

Dept. of ISE, CMRIT, Bengaluru-560037 46


7 Implementation music recommendation system

d e f userhome ( r e q u e s t ) :
r e t u r n r e n d e r ( r e q u e s t , ’ userhome . html ’ )

# r e s u l t page

def r e s u l t ( request ) :
i f r e q u e s t . method == ”GET” :
g l o b a l data , b
data = pd . r e a d c s v ( ” musicapp / l a t a m a n g e s h k a r s o n g s . c s v ” )
data . drop ( ’ ID ’ , a x i s =1, i n p l a c e=True )
data . drop ( ” Length (ms ) ” , a x i s =1, i n p l a c e=True )
data . drop ( ” A c c o u s t i c n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ” D a n c e a b i l i t y ” , a x i s =1, i n p l a c e=True )
data . drop ( ” Energy ” , a x i s =1, i n p l a c e=True )
data . drop ( ” I n s t r u m e n t a l n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ” Valence ” , a x i s =1, i n p l a c e=True )
data . drop ( ” L i v e l i n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ” Loudness ” , a x i s =1, i n p l a c e=True )
data . drop ( ” S p e e c h i n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ”Tempo” , a x i s =1, i n p l a c e=True )
data . drop ( ” Time S i g n a t u r e ” , a x i s =1, i n p l a c e=True )
data [ ” c o m b i n e d f e a t u r e s ” ] = data [ ” Name ” ] + ” ” + \
data [ ” Album”]+” ”+data [ ” R e l e a s e Date ”]+” ”+data [ ’ L y r i c s ’ ]

def cleaning ( text ) :


t e x t = r e . sub ( ” [ ˆ a−zA−Z ] ” , ” ” , t e x t )
text = text . lower ()
text = text . s p l i t ()
s t o p s = s e t ( stopwords . words ( ” e n g l i s h ” ) )
t e x t = [w f o r w i n t e x t i f not w i n s t o p s ]
text = ” ”. join ( text )
return text
data [ ” c o m b i n e d f e a t u r e s ” ] = data [ ” c o m b i n e d f e a t u r e s ” ] . apply (
f u n c=c l e a n i n g )
t f v = T f i d f V e c t o r i z e r ( m a x f e a t u r e s =10000)
t f v m a t r i x = t f v . f i t t r a n s f o r m ( data [ ” c o m b i n e d f e a t u r e s ” ] )
cosine sim = cosine similarity ( tfv matrix )

Dept. of ISE, CMRIT, Bengaluru-560037 47


7 Implementation music recommendation system

global song user likes


print (b)
song user likes = b
s o n g i n d e x = data [ data . Album == s o n g u s e r l i k e s ] . i n d e x [ 0 ]
s i m i l a r s o n g s = l i s t ( enumerate ( c o s i n e s i m [ s o n g i n d e x ] ) )
similar song sorted = sorted (
s i m i l a r s o n g s , key=lambda x : x [ 1 ] , r e v e r s e=True )
global h
h = []
f o r song i n s i m i l a r s o n g s o r t e d [ 1 : 1 1 ] :
s i m i l a r s o n g s = data [ data . i n d e x == song [ 0 ] ] [ ” Album ” ] . v a l u e s [
h . append ( s i m i l a r s o n g s )
c = tuple (h)

# def recommended songs ( s o n g u s e r l i k e s ) :


# s o n g i n d e x = data [ data . Album == s o n g u s e r l i k e s ] . i n d e x [ 0 ]
# s i m i l a r s o n g s = l i s t ( enumerate ( c o s i n e s i m [ s o n g i n d e x ] ) )
# similar song sorted = sorted (
# s i m i l a r s o n g s , key=lambda x : x [ 1 ] , r e v e r s e=True )

# f o r song i n s i m i l a r s o n g s o r t e d [ 1 : 1 1 ] :
# s i m i l a r s o n g s = data [ data . i n d e x == song [ 0 ] ] [ ” Album ” ] . v
# print ( similar songs )
r e t u r n r e n d e r ( r e q u e s t , ’ r e s u l t . html ’ , { ’ r e s ’ : c })
r e t u r n r e n d e r ( r e q u e s t , ’ r e s u l t . html ’ )

# album page

d e f album ( r e q u e s t ) :
i f r e q u e s t . method == ”POST” :
global b
b = r e q u e s t .POST[ ’ t e x t ’ ]
r e t u r n r e n d e r ( r e q u e s t , ’ album . html ’ , { ’ a ’ : ”View th e Recomendend
r e t u r n r e n d e r ( r e q u e s t , ’ album . html ’ )

7.6 URL Configuration of APIs


GNewsAPI

Dept. of ISE, CMRIT, Bengaluru-560037 48


7 Implementation music recommendation system

from django . c o n t r i b import admin


from django . u r l s import path

from . import v i e w s

urlpatterns = [
path ( ” ” , v i e w s . index , name=’ index ’ ) ,
path ( ” about / ” , v i e w s . about , name=’ about ’ ) ,
path ( ” r e g i s t e r / ” , v i e w s . r e g i s t e r , name=’ r e g i s t e r ’ ) ,
path ( ” l o g i n / ” , v i e w s . l o g i n , name=’ l o g i n ’ ) ,
path ( ” userhome / ” , v i e w s . userhome , name=’ userhome ’ ) ,
path ( ” album / ” , v i e w s . album , name=’album ’ ) ,
path ( ” r e s u l t / ” , v i e w s . r e s u l t , name=’ r e s u l t ’ ) ,
path ( ” r e s u l t 2 / ” , v i e w s . r e s u l t 2 , name=’ r e s u l t 2 ’ ) ,
path ( ” r e s u l t 2 / m o o d r e s u l t . html ” , v i e w s . m o o d r e s u l t , name=’ r e s u l t 2 m
]

7.7 Registration configuration from backend

from django import forms


from django . c o n t r i b . auth . forms import UserCreationForm
from django . c o n t r i b . auth . models import User

# Cr eate your forms h e r e .

c l a s s NewUserForm ( UserCreationForm ) :
e m a i l = forms . E m a i l F i e l d ( r e q u i r e d=True )

c l a s s Meta :
model = User
f i e l d s = ( ” username ” , ” e m a i l ” , ” password1 ” , ” password2 ” )

d e f s a v e ( s e l f , commit=True ) :
u s e r = s u p e r ( NewUserForm , s e l f ) . s a v e ( commit=F a l s e )
u s e r . e m a i l = s e l f . c l e a n e d d a t a [ ’ email ’ ]
i f commit :
user . save ( )

Dept. of ISE, CMRIT, Bengaluru-560037 49


7 Implementation music recommendation system

return user

7.8 Server Configuration

#!/ u s r / bi n / env python


””” Django ’ s command−l i n e u t i l i t y f o r a d m i n i s t r a t i v e t a s k s . ” ” ”
import os
import s y s

d e f main ( ) :
”””Run a d m i n i s t r a t i v e t a s k s . ” ” ”
o s . e n v i r o n . s e t d e f a u l t ( ’DJANGO SETTINGS MODULE’ , ’ music . s e t t i n g s ’ )
try :
from django . c o r e . management import e x e c u t e f r o m c o m m a n d l i n e
e x c e p t ImportError as exc :
r a i s e ImportError (
” Couldn ’ t import Django . Are you s u r e i t ’ s i n s t a l l e d and ”
” a v a i l a b l e on your PYTHONPATH environment v a r i a b l e ? Did you
” f o r g e t t o a c t i v a t e a v i r t u a l environment ?”
) from exc
e x e c u t e f r o m c o m m a n d l i n e ( s y s . argv )

if name == ’ main ’:
main ( )

7.9 Javascript Configuration

/∗∗
∗ Template Name : Nova − v1 . 3 . 0
∗ Template URL: h t t p s : / / bootstrapmade . com/ nova−b o o t s t r a p −b u s i n e s s −t e m p l a
∗ Author : BootstrapMade . com
∗ L i c e n s e : h t t p s : / / bootstrapmade . com/ l i c e n s e /
∗/
document . a d d E v e n t L i s t e n e r ( ’ DOMContentLoaded ’ , ( ) => {
” us e s t r i c t ” ;

Dept. of ISE, CMRIT, Bengaluru-560037 50


7 Implementation music recommendation system

/∗∗
∗ Preloader
∗/
c o n s t p r e l o a d e r = document . q u e r y S e l e c t o r ( ’# p r e l o a d e r ’ ) ;
i f ( preloader ) {
window . a d d E v e n t L i s t e n e r ( ’ load ’ , ( ) => {
p r e l o a d e r . remove ( ) ;
});
}

/∗∗
∗ S t i c k y header on s c r o l l
∗/
c o n s t s e l e c t H e a d e r = document . q u e r y S e l e c t o r ( ’# header ’ ) ;
i f ( selectHeader ) {
document . a d d E v e n t L i s t e n e r ( ’ s c r o l l ’ , ( ) => {
window . s c r o l l Y > 100 ? s e l e c t H e a d e r . c l a s s L i s t . add ( ’ s t i c k e d ’ ) : s e l e
});
}

/∗∗
∗ Mobile nav t o g g l e
∗/
c o n s t mobileNavShow = document . q u e r y S e l e c t o r ( ’ . mobile−nav−show ’ ) ;
c o n s t mobileNavHide = document . q u e r y S e l e c t o r ( ’ . mobile−nav−hide ’ ) ;

document . q u e r y S e l e c t o r A l l ( ’ . mobile−nav−t o g g l e ’ ) . f o r E a c h ( e l => {


e l . addEventListener ( ’ c l i c k ’ , function ( event ) {
event . preventDefault ( ) ;
mobileNavToogle ( ) ;
})
});

f u n c t i o n mobileNavToogle ( ) {
document . q u e r y S e l e c t o r ( ’ body ’ ) . c l a s s L i s t . t o g g l e ( ’ mobile−nav−a c t i v e ’ )
mobileNavShow . c l a s s L i s t . t o g g l e ( ’ d−none ’ ) ;
mobileNavHide . c l a s s L i s t . t o g g l e ( ’ d−none ’ ) ;
}

Dept. of ISE, CMRIT, Bengaluru-560037 51


7 Implementation music recommendation system

/∗∗
∗ Toggle mobile nav dropdowns
∗/
c o n s t navDropdowns = document . q u e r y S e l e c t o r A l l ( ’ . navbar . dropdown > a ’

navDropdowns . f o r E a c h ( e l => {
e l . addEventListener ( ’ c l i c k ’ , function ( event ) {
i f ( document . q u e r y S e l e c t o r ( ’ . mobile−nav−a c t i v e ’ ) ) {
event . preventDefault ( ) ;
this . c l a s s L i s t . toggle ( ’ active ’ ) ;
t h i s . n e x t E l e m e n t S i b l i n g . c l a s s L i s t . t o g g l e ( ’ dropdown−a c t i v e ’ ) ;

l e t dropDownIndicator = t h i s . q u e r y S e l e c t o r ( ’ . dropdown−i n d i c a t o r ’
dropDownIndicator . c l a s s L i s t . t o g g l e ( ’ bi−chevron−up ’ ) ;
dropDownIndicator . c l a s s L i s t . t o g g l e ( ’ bi−chevron−down ’ ) ;
}
})
});

/∗∗
∗ S c r o l l top button
∗/
c o n s t s c r o l l T o p = document . q u e r y S e l e c t o r ( ’ . s c r o l l −top ’ ) ;
i f ( scrollTop ) {
const togglescrollTop = function () {
window . s c r o l l Y > 100 ? s c r o l l T o p . c l a s s L i s t . add ( ’ a c t i v e ’ ) : s c r o l l T o
}
window . a d d E v e n t L i s t e n e r ( ’ load ’ , t o g g l e s c r o l l T o p ) ;
document . a d d E v e n t L i s t e n e r ( ’ s c r o l l ’ , t o g g l e s c r o l l T o p ) ;
s c r o l l T o p . a d d E v e n t L i s t e n e r ( ’ c l i c k ’ , window . s c r o l l T o ({
top : 0 ,
b e h a v i o r : ’ smooth ’
}));
}

/∗∗
∗ I n i t i a t e glightbox
∗/
c o n s t g l i g h t b o x = GLightbox ({

Dept. of ISE, CMRIT, Bengaluru-560037 52


7 Implementation music recommendation system

selector : ’ . glightbox ’
});

/∗∗
∗ I n i t s w i p e r s l i d e r with 1 s l i d e a t once i n d e s k t o p view
∗/
new Swiper ( ’ . s l i d e s −1 ’ , {
speed : 6 0 0 ,
loop : true ,
autoplay : {
delay : 5000 ,
disableOnInteraction : f a l s e
},
s l i d e s P e r V i e w : ’ auto ’ ,
pagination : {
e l : ’ . swiper −p a g i n a t i o n ’ ,
type : ’ b u l l e t s ’ ,
c l i c k a b l e : true
},
navigation : {
n e x t E l : ’ . swiper −button−next ’ ,
p r e v E l : ’ . swiper −button−prev ’ ,
}
});

/∗∗
∗ I n i t s w i p e r s l i d e r with 3 s l i d e s a t once i n d e s k t o p view
∗/
new Swiper ( ’ . s l i d e s −3 ’ , {
speed : 6 0 0 ,
loop : true ,
autoplay : {
delay : 5000 ,
disableOnInteraction : f a l s e
},
s l i d e s P e r V i e w : ’ auto ’ ,
pagination : {
e l : ’ . swiper −p a g i n a t i o n ’ ,
type : ’ b u l l e t s ’ ,

Dept. of ISE, CMRIT, Bengaluru-560037 53


7 Implementation music recommendation system

c l i c k a b l e : true
},
navigation : {
n e x t E l : ’ . swiper −button−next ’ ,
p r e v E l : ’ . swiper −button−prev ’ ,
},
breakpoints : {
320: {
slidesPerView : 1 ,
spaceBetween : 40
},

1200: {
slidesPerView : 3 ,
}
}
});

/∗∗
∗ P o r f o l i o i s o t o p e and f i l t e r
∗/
l e t p o r t f o l i o n I s o t o p e = document . q u e r y S e l e c t o r ( ’ . p o r t f o l i o −i s o t o p e ’ ) ;

i f ( portfolionIsotope ) {

l e t p o r t f o l i o F i l t e r = p o r t f o l i o n I s o t o p e . g e t A t t r i b u t e ( ’ data−p o r t f o l i o −
l e t p o r t f o l i o L a y o u t = p o r t f o l i o n I s o t o p e . g e t A t t r i b u t e ( ’ data−p o r t f o l i o −
l e t p o r t f o l i o S o r t = p o r t f o l i o n I s o t o p e . g e t A t t r i b u t e ( ’ data−p o r t f o l i o −s

window . a d d E v e n t L i s t e n e r ( ’ load ’ , ( ) => {


l e t p o r t f o l i o I s o t o p e = new I s o t o p e ( document . q u e r y S e l e c t o r ( ’ . p o r t f o
i t e m S e l e c t o r : ’ . p o r t f o l i o −item ’ ,
layoutMode : p o r t f o l i o L a y o u t ,
filter : portfolioFilter ,
sortBy : p o r t f o l i o S o r t
});

l e t m e n u F i l t e r s = document . q u e r y S e l e c t o r A l l ( ’ . p o r t f o l i o −i s o t o p e . p
menuFilters . forEach ( f u n c t i o n ( e l ) {

Dept. of ISE, CMRIT, Bengaluru-560037 54


7 Implementation music recommendation system

e l . addEventListener ( ’ c l i c k ’ , function () {
document . q u e r y S e l e c t o r ( ’ . p o r t f o l i o −i s o t o p e . p o r t f o l i o − f l t e r s .
t h i s . c l a s s L i s t . add ( ’ f i l t e r −a c t i v e ’ ) ;
p o r t f o l i o I s o t o p e . a r r a n g e ({
f i l t e r : t h i s . g e t A t t r i b u t e ( ’ data−f i l t e r ’ )
});
i f ( t y p e o f a o s i n i t === ’ f u n c t i o n ’ ) {
aos init ();
}
}, false );
});

});

/∗∗
∗ Animation on s c r o l l f u n c t i o n and i n i t
∗/
function aos init () {
AOS. i n i t ({
duration : 800 ,
easing : ’ slide ’ ,
once : t r u e ,
mirror : f a l s e
});
}
window . a d d E v e n t L i s t e n e r ( ’ load ’ , ( ) => {
aos init ();
});

});

7.10 Views.py(API Calls and Page rendering

\ textbf { Preprocessing of dataset }


\ begin { l s t l i s t i n g }
import pandas as pd
import s e a b o r n as s n s

Dept. of ISE, CMRIT, Bengaluru-560037 55


7 Implementation music recommendation system

import m a t p l o t l i b . p y p l o t as p l t
from s k l e a r n . f e a t u r e e x t r a c t i o n . t e x t import C o u n t V e c t o r i z e r
from s k l e a r n . f e a t u r e e x t r a c t i o n . t e x t import T f i d f V e c t o r i z e r
from s k l e a r n . m e t r i c s . p a i r w i s e import c o s i n e s i m i l a r i t y
import r e
from n l t k . c o r p u s import stopwords

d e f r e a d d a t a s e t ( path ) :
data = pd . r e a d c s v ( path )
data . drop ( ’ ID ’ , a x i s =1, i n p l a c e=True )
data . drop ( ” Length (ms ) ” , a x i s =1, i n p l a c e=True )
data . drop ( ” A c c o u s t i c n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ” D a n c e a b i l i t y ” , a x i s =1, i n p l a c e=True )
data . drop ( ” Energy ” , a x i s =1, i n p l a c e=True )
data . drop ( ” I n s t r u m e n t a l n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ” Valence ” , a x i s =1, i n p l a c e=True )
data . drop ( ” L i v e l i n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ” Loudness ” , a x i s =1, i n p l a c e=True )
data . drop ( ” S p e e c h i n e s s ” , a x i s =1, i n p l a c e=True )
data . drop ( ”Tempo” , a x i s =1, i n p l a c e=True )
data . drop ( ” Time S i g n a t u r e ” , a x i s =1, i n p l a c e=True )
data [ ” c o m b i n e d f e a t u r e s ” ] = data [ ” Name ” ] + ” ” + \
data [ ” Album”]+” ”+data [ ” R e l e a s e Date ”]+” ”+data [ ’ L y r i c s ’ ]
r e t u r n data

def cleaning ( text ) :


t e x t = r e . sub ( ” [ ˆ a−zA−Z ] ” , ” ” , t e x t )
text = text . lower ()
text = text . s p l i t ()
s t o p s = s e t ( stopwords . words ( ” e n g l i s h ” ) )
t e x t = [w f o r w i n t e x t i f not w i n s t o p s ]
text = ” ”. join ( text )
return text

d e f p r e p r o c e s s ( data ) :
data [ ” c o m b i n e d f e a t u r e s ” ] = data [ ” c o m b i n e d f e a t u r e s ” ] . apply (

Dept. of ISE, CMRIT, Bengaluru-560037 56


7 Implementation music recommendation system

f u n c=c l e a n i n g )
t f v = T f i d f V e c t o r i z e r ( m a x f e a t u r e s =10000)
t f v m a t r i x = t f v . f i t t r a n s f o r m ( data [ ” c o m b i n e d f e a t u r e s ” ] )
cosine sim = cosine similarity ( tfv matrix )

global song user likes


song user likes = b
s o n g i n d e x = data [ data . Album == s o n g u s e r l i k e s ] . i n d e x [ 0 ]
s i m i l a r s o n g s = l i s t ( enumerate ( c o s i n e s i m [ s o n g i n d e x ] ) )
similar song sorted = sorted (
s i m i l a r s o n g s , key=lambda x : x [ 1 ] , r e v e r s e=True )
global h
h = []
f o r song i n s i m i l a r s o n g s o r t e d [ 1 : 1 1 ] :
s i m i l a r s o n g s = data [ data . i n d e x == song [ 0 ] ] [ ” Album ” ] . v a l u e s [ 0 ]
h . append ( s i m i l a r s o n g s )
return h

d e f recommended songs ( s o n g u s e r l i k e s ) :
s o n g i n d e x = data [ data . Album == s o n g u s e r l i k e s ] . i n d e x [ 0 ]
s i m i l a r s o n g s = l i s t ( enumerate ( c o s i n e s i m [ s o n g i n d e x ] ) )
similar song sorted = sorted (
s i m i l a r s o n g s , key=lambda x : x [ 1 ] , r e v e r s e=True )

f o r song i n s i m i l a r s o n g s o r t e d [ 1 : 1 1 ] :
s i m i l a r s o n g s = data [ data . i n d e x == song [ 0 ] ] [ ” Album ” ] . v a l u e s [ 0 ]
print ( similar songs )

data = r e a d d a t a s e t ( ’ . . / musicapp / l a t a m a n g e s h k a r s o n g s . csv ’ )


h = p r e p r o c e s s ( data )
print (h)

Dept. of ISE, CMRIT, Bengaluru-560037 57


8 Testing music recommendation system

8 Testing
8.1 Testing Methodologies
There are many different types of testing methods or techniques used as part of the
software testing methodology. Some of the important testing methodologies are:

8.1.1 White Box Testing

White box testing creates test cases based on internal structure by looking at the
system from the inside out. Programming knowledge is necessary to recognize every
route within the software. To workout paths through the code, the tester selects test
case inputs and ascertains the proper outputs.

Figure 8.7: white box testing

Advantages of White Box Testing

1. There is no need to wait for the user interface (UI) to be finished before
beginning white box testing of the intended application. It covers every conceivable
code route, guaranteeing exhaustive testing.
2. It facilitates coding standard verification.

Disadvantages of White Box Testing

1. If requirements change too frequently, the test script needs to be updated.

Dept. of ISE, CMRIT, Bengaluru-560037 58


8 Testing music recommendation system

2. Extensive testing is not feasible if the application to be evaluated is large in


size.
3. It is not feasible to test every scenario or path in a software program, which
could lead to the omission of coding errors.

8.1.2 Black box testing

Black box testing concentrates on the software’s functional needs. Another name for
it is functional testing. This is a method of software testing in which the tester is
blind to the internal operations of the object under test.

Figure 8.8: black box testing

Advantages of Black Box Testing

1. Because the tester and the designer are unrelated to one another, the test is
objective.
2. The tester is not required to be familiar with any particular programming lan-
guage.

Disadvantages of Black Box Testing

1. A wide sample space must be used for the test inputs. That is, it will take time
to process such a large amount of data.
2. It is also challenging to find every potential input in the constrained testing
period. Writing test cases is therefore challenging and slow.

Dept. of ISE, CMRIT, Bengaluru-560037 59


8 Testing music recommendation system

8.2 Unit Testing


The process of designing test cases for unit testing ensures that the core logic of the
program is operating correctly and that program inputs result in legitimate outputs.
Validation should be done on all internal code flows and decision branches. It is
the testing of the application’s separate software components.Unit tests evaluate a
particular application, system configuration, or business process at the component
level. Unit tests make assurance that every distinct path in a business process fol-
lows the stated specifications exactly and has inputs and outputs that are well defined.

8.3 System Testing


This data helps to clear up any confusion surrounding the system. For instance, while
determining whether to release a product, decision-makers would need to be aware
of the product’s current condition and consider factors including the product’s us-
ability, compliance with standards, and any known dangers, as well as any applicable
legislation. The process of software testing facilitates the objective evaluation of the
system’s compliance with specified requirements and specifications. System testing
verifies that all end-to-end scenarios function as a user would. By configuring the sys-
tem in a controlled setting, the functionality of the system must be verified. Testing
of both functional and nonfunctional criteria is part of system testing. It supports
the system’s validation and verification.

8.4 Quality Assurance


The management tasks of reporting and auditing make up quality assurance. The
purpose of quality assurance is to give management the information they need to
make educated decisions regarding the quality of the product, giving them insight
and confidence that the product is fulfilling its objectives. This ”umbrella activity”
is used in all phases of the engineering process. Software quality control includes the
following:-
1. Techniques and instruments for analysis, design, coding, and testing
2. the application of technical reviews in each software engineering
3. A multi-level testing approach
4. Command over the modifications made to the software documentation.

Accuracy of similar music patters: 82.3

Dept. of ISE, CMRIT, Bengaluru-560037 60


8 Testing music recommendation system

8.5 Quality Factor


Monitoring software quality and evaluating the effects of methodological and proce-
dural modifications on higher software quality are crucial goals of quality assurance.

Two major categories can be used to classify the elements influencing the quality:
Ones that are measurable directly.
2. Elements that are amenable to indirect measurement

These elements center on three crucial facets of a software product.


1. The features of its operation
2. Its capacity for modification
3. Its capacity to adjust to a new setting.

8.6 Functional Test


Functional tests offer methodical proof that the functions being tested are available
in accordance with the technical and business requirements, system documentation,
and user manuals. Focus of functional testing is on the following areas:
1. Valid Input : recognized categories of acceptable input need to be approved.
2. Invalid Input : Classes of invalid input that have been detected need to be
rejected.
3. Functions : The functions that have been identified must be used.
4. Output : It is necessary to exercise the identified kinds of application outputs.
5.Procedures/Systems: It is necessary to invoke interacting systems or proce-
dures.

Dept. of ISE, CMRIT, Bengaluru-560037 61


9 Results and Discussions music recommendation system

9 Results and Discussions


With a focus on user-centric design and advanced technological integration, Crop
Connect aims to empower farmers with the tools and resources they need to thrive in
today’s digital age.

9.1 Key Components and Features


1.Identification and Analysis of Patterns:The system uses natural language
processing (NLP) to efficiently identify and analyze similar musical patterns, allowing
for a greater understanding of musical material across genres and styles.

2. Particularized Suggestions: The method facilitates exploration and discov-


ery for users with psychiatric problems by generating personalized music recommen-
dations based on discovered patterns that are suited to individual preferences.

3. Improved Experience with Music Therapy: The technology improves


the quality of music therapy for patients with mental illnesses by identifying common
melodic patterns and matching therapeutic music choices to each patient’s specific
needs and feelings.

4. Mental Excitation: Through the investigation of comparable musical pat-


terns, the system provides cognitive stimulation, drawing users into meaningful audio
experiences that have the potential to improve mood, cognitive function, and general
well-being.

5. Controlling Emotions: The method helps people with mental illnesses reg-
ulate their emotions by finding similar music patterns that provide them with a tool
for self-expression, relaxation, and emotional release.

6. Enhancing the User ExperienceTechniques for improving the user interface


and recommendation systems so that people with mental illnesses can access and use
them more easily.Usability testing and user feedback are taken into account to make
sure the system successfully satisfies the particular requirements and preferences of
its target audience.

7. Combining Therapy Programs with Integration: Talk about how to


combine the system with currently offered therapies and interventions to enhance
conventional methods of treating mental illnesses.Investigating collaborations with
organizations and mental health specialists to encourage system adoption as an addi-

Dept. of ISE, CMRIT, Bengaluru-560037 62


9 Results and Discussions music recommendation system

tional therapeutic tool.

8. The ethical implications are: ethical issues pertaining to data security,


permission, and privacy should be taken into account when implementing the system
for people with mental illnesses.The application of security measures and guidelines
to guarantee the platform’s users’ privacy and their responsible use of personal infor-
mation.

9. Long-Term Effects and Results:Talk about the system’s long-term effects


on the mental health and wellbeing of people with psychiatric disorders, including
any potential gains in quality of life, mood, and cognitive function.

By combining these features into a cohesive and intuitive platform, Longitudinal


studies and user feedback methods are employed to evaluate the system’s performance
and durability over an extended period.

9.2 Advantages
- Enhanced communication and collaboration among farmers.
- Customized music therapy recommendations honor patient preferences and in-
crease the efficacy of treatment for mental health issues.
- Listeners can extend their musical horizons by finding new music that speaks to
their emotions.
- Stress and anxiety symptoms can be effectively managed by listening to music
that follows a similar rhythm.
- Regular involvement and favorable results are encouraged by the platform’s easy
access to therapeutic music material.

9.3 Limitations
-The system’s capacity to offer thorough recommendations may be hampered by
the lack of a wide variety of musical genres.
- NLP algorithms may have biases or errors that result in suggestions that are not
as good as they could be.
- Obstacles such a lack of technology literacy may prevent users from adopting the
system, which would reduce its impact and reach.
- In order to preserve user integrity and confidence, privacy and data security
issues need to be addressed.

Dept. of ISE, CMRIT, Bengaluru-560037 63


9 Results and Discussions music recommendation system

9.4 Application Screenshots


Welcome to our innovative application, where functionality meets seamless design.
Below are the screenshots showcasing the intuitive interface and powerful features
that make our app. With a focus on user experience and efficiency, we’ve crafted each
screen with precision to ensure a delightful experience for every user. Explore the
screenshots to discover how our application can transform the way you engage with
technology.

Figure 9.9: User Authentication


Authentication of users allowing to create accounts or login to respective accounts
using user email and password.

Figure 9.10: Home page after login

Dept. of ISE, CMRIT, Bengaluru-560037 64


9 Results and Discussions music recommendation system

Figure 9.11: A search space for user for recommendation on songs


User can enter name of album to get the recommendation

Figure 9.12: List Of songs Recommendation


Using advanced machine learning algorithms, the system recommends list of songs
based on album search

Dept. of ISE, CMRIT, Bengaluru-560037 65


9 Results and Discussions music recommendation system

Figure 9.13: Mood search for user


The user can select a list of moods from the dropdown for getting the
recommendation of songs

Figure 9.14: Recommendation for mood search


user gets the recommendation on the basis of mood selected by the user

Dept. of ISE, CMRIT, Bengaluru-560037 66


10 Future works and Contributions music recommendation system

10 Future works and Contributions


In this chapter, we outline potential avenues for future development and contributions
to the Crop Connect platform, with the aim of enhancing its functionality, usability,
and impact within the agricultural community.

A. Expansion of Features:

1. Integration of Advanced Technologies: o build on existing capabilities,


there’s a chance to incorporate cutting-edge technologies like neural networks and
machine learning to improve the platform’s capacity to identify and assess compara-
ble musical patterns. This might entail putting in place more complex algorithms for
recommendation and pattern detection, giving customers access to more precise and
customized music recommendations.

2.Extension of Music Database:A wider variety of genres, musicians, and


styles could be included in the music database to increase the platform’s coverage
and efficacy. The platform can offer more thorough and pertinent recommendations
to people with different musical tastes and interests by diversifying the dataset.

3.Enhanced User Interface: The overall user experience can be improved by


making the user interface more intuitive and user-friendly. This can entail creating
interactive tools for studying musical patterns, revamping the UI to make navigating
easier, and adding user-customizable settings so that users can customize their jour-
neys to find new music to suit their tastes.

B. Partnerships and Collaborations:

1. Collaboration with Music Industry Experts: Bringing in musicians, mu-


sicologists, and other industry professionals can help the platform’s algorithms and
recommendation systems becoming even more insightful and professional. Working
together with industry experts can assist guarantee that the platform stays current
with new innovations and trends in the music business.

2. Integration with Music Streaming Platforms: By integrating the plat-


form with well-known music streaming services, it will be possible to reach and make
it more accessible to a larger group of music lovers. Through the use of pre-existing
music libraries and user data from streaming platforms, the platform can improve its
capacity to offer users tailored and pertinent music suggestions.

Dept. of ISE, CMRIT, Bengaluru-560037 67


10 Future works and Contributions music recommendation system

C. User Engagement and Education:

1. Educational Tutorials: Creating instructional tutorials on analysis meth-


ods, musical pattern interpretation, and music theory can give users important new
perspectives on the fundamental ideas of music. Users with varying skill levels can
benefit from these tutorials, which are designed to accommodate both new and sea-
soned users.

2.Interactive Workshops: Providing users with the chance to connect directly


with specialists in the subject, interactive workshops or webinars given by music
experts can be held. These workshops can address a variety of subjects, such as the
detection and analysis of musical patterns in different genres as well as the composition
and arrangement of music.
3. Listening Guides: : Offering carefully selected playlists or listening guides
that draw attention to particular themes and patterns in music can help people dis-
cover and comprehend a variety of musical elements. To assist users in recognizing
and appreciating the subtleties of each item, these guides may contain notes and ex-
planations.

4. Discussion Forums: Creating community areas or discussion forums where


users may engage, exchange ideas, and exchange questions can help to build a feeling
of belonging and teamwork inside the platform. These discussion boards can be very
helpful tools for people to share ideas, look for guidance, and gain knowledge from
one another.

5. Collaborative Projects: Offering users the chance to work together on


projects like composition or music analysis can foster both artistic expression and
practical learning. Users can collaborate in real-time on these projects with the help
of the platform’s collaborative tools and capabilities.

By prioritizing these future works, Through the implementation of these tactics


for user engagement and education, the platform can enable users to enhance their
entire musical experience and gain a deeper grasp of music patterns.

Dept. of ISE, CMRIT, Bengaluru-560037 68


11 Conclusion music recommendation system

11 Conclusion
To sum up, the creation of a platform that uses natural language processing (NLP)
to identify recurring musical patterns has great potential to transform how people
listen to and experience music. We have investigated many aspects of the plat-
form during this project, such as its usefulness, functionality, and possible effects on
users—especially those with mental health issues. Several significant conclusions have
been drawn from a thorough examination of the system’s capabilities, constraints, and
prospects for the future.
First off, the platform shows a lot of promise for offering therapeutically appropri-
ate music selections based on personal tastes. The platform is able to provide users
with a wide range of music choices that connect with their emotions and experiences
by utilizing natural language processing (NLP) algorithms to evaluate and interpret
musical data.

In addition, the platform’s focus on teamwork and community involvement encour-


ages a feeling of support and community among users. The platform fosters chances
for knowledge sharing, peer support, and collaborative learning by enabling commu-
nication and engagement among users. In addition to improving the user experience,
this sense of community helps the platform remain successful and sustainable in the
long run.
Anticipating the future, the platform’s development presents promising avenues
for growth and innovation. The platform may further augment its capabilities and
influence within the agricultural sector by incorporating cutting-edge technologies,
broadening the functionality of the marketplace, and cultivating collaborations with
agricultural groups. Furthermore, programs designed to improve user education and
engagement—like social engagement tools and interactive learning materials—can en-
able users to go deeper into the analysis and comprehension of musical patterns.

In summary, the creation of a platform that facilitates the identification of com-


parable musical patterns is a noteworthy advancement in the use of technology to
improve music therapy and exploration. We can fully utilize the platform’s potential
to use the power of music to improve the lives of individuals and communities if we
keep innovating and working together.

Dept. of ISE, CMRIT, Bengaluru-560037 69


References music recommendation system

References
[1] Martin Mabeifam Ujakpa, Abner Kristof, Augusto Domingos, Valerianus
Hashiyana, Nalina Suresh, Jude O. Osakwe, and Gloria Iyawa. Personalized
music recommendations simulation based on improved collaborative algorithm.
In 2021 IST-Africa Conference (IST-Africa), pages 1–7, 2021.

[2] Sai Sree Laya Chukkapalli, Priyanka Ranade, Sudip Mittal, and Anupam Joshi. A
privacy preserving anomaly detection framework for music therapy. In 2021 Third
IEEE International Conference on Trust, Privacy and Security in Intelligent
Systems and Applications (TPS-ISA), pages 340–347, 2021.

[3] T. Sairam, Sudheer Kumar Terlapu, M. Venkata Subbarao, and Challaram


Grandhi. A comparative analysis of music similarity measures in music infor-
mation retrieval systems. In 2022 Second International Conference on Power,
Control and Computing Technologies (ICPC2T), pages 1–4, 2022.

[4] S. Viswanathan and K. Sathesh Kumar. Role of internet-of-things (iot) and


sensor devices in music patterns: A survey. In 2022 6th International Conference
on Intelligent Computing and Control Systems (ICICCS), pages 421–424, 2022.

[5] Sabyasachi Patra. A review on impact of mobile apps in agriculture. 15:85–91,


12 2023.

[6] Mohammad Prasanto Bimantio, Dian Pratama Putra, Teddy Suparyanto,


Amallia Ferhat, Nanda Satya Nugraha, Alam Ahmad Hidayat, and Bens Par-
damean. Music patterns’ land data collection systems in indonesia with the use
of tani millenial apps. In 2022 4th International Conference on Cybernetics and
Intelligent System (ICORIS), pages 1–5, 2022.

[7] Ahmad Ali AlZubi and Kalda Galyna. Artificial intelligence and internet of
things for similar music patterns. IEEE Access, 11:78686–78692, 2023.

[8] T. Hashni, T. Amudha, and Swamynathan Ramakrishnan. A music recommen-


dation system based on music and user grouping. In 2022 7th International Con-
ference on Communication and Electronics Systems (ICCES), pages 501–505,
2022.

[9] Neetu Mittal and Ankit Kumar. Music recommendation using content and con-
text information mining. In 2023 4th International Conference on Intelligent
Engineering and Management (ICIEM), pages 1–6, 2023.

Dept. of ISE, CMRIT, Bengaluru-560037 70


References music recommendation system

[10] Muhammad Shoaib Farooq, Shamyla Riaz, Adnan Abid, Kamran Abid, and
Muhammad Azhar Naeem. A survey on the role of iot in music therapy for
pshycatric disorder. IEEE Access, 7:156237–156271, 2019.

[11] Ramide Augusto Sales Dantas, Milton Vasconcelos da Gama Neto, Ivan Dim-
itry Zyrianoff, and Carlos Alberto Kamienski. Analysic frequency of similar mu-
sic patterns. In 2020 IEEE International Workshop on Raga patterns of similar
Music, pages 109–113, 2020.

[12] Hetal Patel and Dharmendra Patel. Reckoning of music rhythm density and
complexity through mathematical measures. International Journal of Informa-
tion Sciences and Techniques, 6:61–67, 03 2016.

[13] Ms Mane and Dr V. Content-based music information retrieval: Current direc-


tions and future challenges. International Journal of Trend in Scientific Research
and Development, Special Issue:179–182, 03 2019.

[14] Sandeep G P, Prashanth Pasunoori, M. Sreenivasulu, and A. Madhavilata. A


behavioral study of emotions in south indian classical music and its implications
in music recommendation systems,. International Journal of Applied Sciences,
9:2727–2736, 07 2020.

Dept. of ISE, CMRIT, Bengaluru-560037 71

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy