Skip to content

Commit

Permalink
Add all BST categories
Browse files Browse the repository at this point in the history
  • Loading branch information
allholy committed Dec 23, 2024
1 parent d4326aa commit 85e94c0
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 7 deletions.
39 changes: 39 additions & 0 deletions freesound/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,45 @@

ANNOUNCEMENT_CACHE_KEY = 'announcement_cache'

# -------------------------------------------------------------------------------
# Broad Sound Taxonomy definition

BROAD_SOUND_TAXONOMY = [
{'category_code': 'm', 'level': 1, 'name': 'Music', 'description': 'Music excerpts, melodies, loops, fillers, drones and short musical snippets.'},
{'category_code': 'm-sp', 'level': 2, 'name': 'Solo percussion', 'description': 'Music excerpts with solo percussive instruments.'},
{'category_code': 'm-si', 'level': 2, 'name': 'Solo instrument', 'description': 'Music excerpts with only one instrument, excluding percussion.'},
{'category_code': 'm-m', 'level': 2, 'name': 'Multiple instruments', 'description': 'Music excerpts with more than one instrument.'},
{'category_code': 'm-other', 'level': 2, 'name': 'Other (music)', 'description': 'Music that doesn\'t belong to any of the above categories.'},
{'category_code': 'is', 'level': 1, 'name': 'Instrument samples', 'description': 'Single notes from musical instruments, various versions of the same note, and scales.'},
{'category_code': 'is-p', 'level': 2, 'name': 'Percussion', 'description': 'Instrument samples that are percussive (idiophones or membraphones).'},
{'category_code': 'is-s', 'level': 2, 'name': 'String', 'description': 'Instrument samples that belong to the string instrument family.'},
{'category_code': 'is-w', 'level': 2, 'name': 'Wind', 'description': 'Instrument samples that belong to the wind instrument family (aerophones).'},
{'category_code': 'is-k', 'level': 2, 'name': 'Piano / Keyboard instruments', 'description': 'Instrument samples of piano or other keyboard instruments, not synthesized.'},
{'category_code': 'is-e', 'level': 2, 'name': 'Synths / Electronic', 'description': 'Instrument samples synthesized or produced by electronic means.'},
{'category_code': 'is-other', 'level': 2, 'name': 'Instrument samples (other)', 'description': 'Instrument samples that don\'t belong to any of the above categories.'},
{'category_code': 'sp', 'level': 1, 'name': 'Speech', 'description': 'Sounds where human voice is prominent.'},
{'category_code': 'sp-s', 'level': 2, 'name': 'Solo speech', 'description': 'Recording of a single voice speaking, excluding singing.'},
{'category_code': 'sp-c', 'level': 2, 'name': 'Conversation / Crowd', 'description': 'Several people talking, having a conversation or dialogue.'},
{'category_code': 'sp-p', 'level': 2, 'name': 'Processed / Synthetic', 'description': 'Voice(s) from an indirect source (e.g. radio), processed or synthesized.'},
{'category_code': 'sp-other', 'level': 2, 'name': 'Other (speech)', 'description': 'Voice-predominant recordings that don\'t belong to any of the above categories.'},
{'category_code': 'fx', 'level': 1, 'name': 'Sound effects', 'description': 'Isolated sound effects or sound events, each happening one at a time.'},
{'category_code': 'fx-o', 'level': 2, 'name': 'Objects / House appliances', 'description': 'Everyday objects, inside the home or smaller in size.'},
{'category_code': 'fx-v', 'level': 2, 'name': 'Vehicles', 'description': 'Sounds produced from a vehicle.'},
{'category_code': 'fx-m', 'level': 2, 'name': 'Other mechanisms, engines, machines', 'description': 'Machine-like sounds, except vehicles and small house electric devices.'},
{'category_code': 'fx-h', 'level': 2, 'name': 'Human sounds and actions', 'description': 'Sounds from the human body, excluding speech.'},
{'category_code': 'fx-a', 'level': 2, 'name': 'Animals', 'description': 'Animal vocalizations or sounds.'},
{'category_code': 'fx-n', 'level': 2, 'name': 'Natural elements and explosions', 'description': 'Sound events occuring by natural processes.'},
{'category_code': 'fx-ex', 'level': 2, 'name': 'Experimental', 'description': 'Experimental sounds or heavily processed audio recordings.'},
{'category_code': 'fx-el', 'level': 2, 'name': 'Electronic / Design', 'description': 'Sound effects that are computer-made or designed for user interfaces or animations.'},
{'category_code': 'fx-other', 'level': 2, 'name': 'Other (sound effects)', 'description': 'Sound effects that don\'t belong to any of the above categories.'},
{'category_code': 'ss', 'level': 1, 'name': 'Soundscapes', 'description': 'Ambiances, field-recordings with multiple events and sound environments.'},
{'category_code': 'ss-n', 'level': 2, 'name': 'Nature', 'description': 'Soundscapes from natural habitats.'},
{'category_code': 'ss-i', 'level': 2, 'name': 'Indoors', 'description': 'Soundscapes from closed or indoor spaces.'},
{'category_code': 'ss-u', 'level': 2, 'name': 'Urban', 'description': 'Soundscapes from cityscapes or outdoor places with human intervention.'},
{'category_code': 'ss-s', 'level': 2, 'name': 'Synthetic / Artificial', 'description': 'Soundscapes that are synthesized or computer-made ambiences.'},
{'category_code': 'ss-other', 'level': 2, 'name': 'Other (soundscapes)', 'description': 'Soundscapes that don\'t belong to any of the above categories.'},
]

# -------------------------------------------------------------------------------
# Freesound data paths and urls

Expand Down
18 changes: 18 additions & 0 deletions sounds/migrations/0054_alter_sound_bst_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.23 on 2024-12-23 17:10

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('sounds', '0053_sound_bst_category'),
]

operations = [
migrations.AlterField(
model_name='sound',
name='bst_category',
field=models.CharField(blank=True, choices=[('m', 'Music'), ('m-sp', 'Solo percussion'), ('m-si', 'Solo instrument'), ('m-m', 'Multiple instruments'), ('m-other', 'Other (music)'), ('is', 'Instrument samples'), ('is-p', 'Percussion'), ('is-s', 'String'), ('is-w', 'Wind'), ('is-k', 'Piano / Keyboard instruments'), ('is-e', 'Synths / Electronic'), ('is-other', 'Instrument samples (other)'), ('sp', 'Speech'), ('sp-s', 'Solo speech'), ('sp-c', 'Conversation / Crowd'), ('sp-p', 'Processed / Synthetic'), ('sp-other', 'Other (speech)'), ('fx', 'Sound effects'), ('fx-o', 'Objects / House appliances'), ('fx-v', 'Vehicles'), ('fx-m', 'Other mechanisms, engines, machines'), ('fx-h', 'Human sounds and actions'), ('fx-a', 'Animals'), ('fx-n', 'Natural elements and explosions'), ('fx-ex', 'Experimental'), ('fx-el', 'Electronic / Design'), ('fx-other', 'Other (sound effects)'), ('ss', 'Soundscapes'), ('ss-n', 'Nature'), ('ss-i', 'Indoors'), ('ss-u', 'Urban'), ('ss-s', 'Synthetic / Artificial'), ('ss-other', 'Other (soundscapes)')], default=None, max_length=8, null=True),
),
]
8 changes: 1 addition & 7 deletions sounds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,7 @@ class Sound(models.Model):
date_recorded = models.DateField(null=True, blank=True, default=None)

# Broad Sound Taxonomy (BST) category
BST_CATEGORY_CHOICES = [
('m', 'Music'),
('is', 'Instrument samples'),
('sp', 'Speech'),
('fx', 'Sound Effects'),
('ss', 'Soundscapes'),
]
BST_CATEGORY_CHOICES = [(item['category_code'], item['name']) for item in settings.BROAD_SOUND_TAXONOMY]
bst_category = models.CharField(max_length=8, null=True, blank=True, default=None, choices=BST_CATEGORY_CHOICES)

# The history of licenses for a sound is stored on SoundLicenseHistory 'license' references the last one
Expand Down

0 comments on commit 85e94c0

Please sign in to comment.