This repository contains code that converts plant electrophysiology into musical structures. By capturing and analyzing the electrical signals of plants, we can translate these bio-signals into unique and dynamic soundscapes. This project aims to bridge the gap between nature and technology, creating a new way to experience the hidden rhythms of plant life.
This project involves the sonification of various plant species. The electrophysiological data of the plants are recorded over different periods and then converted into musical structures. Each plant's unique bio-signals are captured, processed, and transformed into sound, allowing us to hear the "music" created by these living organisms.
🌿 Plants studied during Spring 2024 🌿
-
Acer rubrum
-
Rhododendron groenlandicum
-
Dryopteris mas
-
Polystichum acrostichoides
-
Alnus
-
Geum rivale
-
Myrica gale
-
Acer pensylvanicum
To get started with this project, clone this repository and navigate to the project directory. The code is written in Python and requires several libraries, which can be installed using the provided requirements.txt
file.
git clone https://github.com/yourusername/plant-sonification.git
cd plant-sonification
pip install -r requirements.txt
🎈🎈🎈🎇TRY THE COLAB🎇🎈🎈🎈
- Identify Temporal Patterns: Use clustering to find patterns in the data over time.
- Analyze Spectral Properties: Examine the spectral centroid and main spectral peaks.
- Generate Musical Structures: Create melodies and chord progressions in MIDI format.
We use temporal clustering to identify patterns in the electrophysiological data over time, utilizing the spectral centroid as the main feature.
We analyze the spectral properties of the data:
- Spectromorphology: Examining the spectral centroid.
- Extraction of Spectral Peaks: Identifying the main spectral peaks using two different methods (EMD, cepstrum).
We translate the analyzed data into musical structures:
- Melody Generation: Mapping the spectral centroid across segments.
- Chord Progression: Using the main spectral peaks in each segment to create chord progressions.
acer_rubrum_27-02.1.mp4
cepstrum_alnus_chords.mp4
- Extract Spectral Features: Analyze key spectral features from plant signals.
- Generate Curves: Create curves showing how these features change over time.
- Control Parameters for DAWs: Use the curves to control music software.
Import and normalize plant signal data to ensure consistency.
Calculate spectral centroid, bandwidth, and flux across time to understand the spectral characteristics of the plant signals.
Generate and smooth curves from these features to highlight significant trends and patterns.
Save the generated curves as files for use in Digital Audio Workstations (DAWs), enabling them to be used as control parameters for music production.
- Measure Connectivity: Analyze the connectivity between plants over time using time-series data.
- Visualize Connectivity: Create visual and animated representations of connectivity patterns.
- One-to-One and One-to-Many Connectivity: Examine individual and averaged connectivity among plants.
Initialize the environment, import necessary libraries, and load raw data files for the plants.
- Libraries: numpy, matplotlib, custom scripts.
- Data Path: Define the folder path for plant data files.
- File Handling: Load .raw files, filter out NaNs, and normalize the data.
Measure the connectivity between plants over time using predefined methods.
- Harmonic Connectivity: Apply harmonic connectivity methods and remove artifacts using filters.
- Data Segmentation: Chunk the data into segments and calculate connectivity matrices for each segment.
Create visual and animated representations of connectivity patterns.
- Time-Series Visualization: Plot connectivity matrices over time.
- Animation: Use Matplotlib's animation functions to animate the connectivity data and save it as a GIF.
Examine individual and averaged connectivity among plants.
- One-to-One Connectivity: Extract and plot connectivity matrices for a specific plant, smoothing the data for clarity.
- One-to-Many Connectivity: Calculate and visualize the average connectivity for each plant, smoothing the data to highlight trends.