Skip to content

Conversation

@taconi
Copy link
Contributor

@taconi taconi commented Nov 29, 2024

Shabda is a tool to fetch random samples from https://freesound.org/ based on given words or to generate Text-to-Speech samples for use in impro sessions on instruments such as Tidal Cycles, Estuary or Strudel.

samples(definition: str)

Fetch random samples from freesound

Any word can be a pack definition.
If you want more than one sample, separate words by a comma: "blue,red"

You can define how many variations of a sample to assemble by adding a colon and a number.
e.g. "blue,red:3,yellow:2" will produce one 'blue' sample, three 'red' samples
and two 'yellow' sample.

# will print in the terminal when finished downloading
samples('bass:4,hihat:4,rimshot:2')

s1 >> loop('bass', dur=PDur(3,8), sample=2)
s2 >> loop('hihat', dur=10, sus=2)
s3 >> loop('rimshot', dur=PDur(7,9)*8, sample=2)

speech(words: str, language: str = 'en-GB', gender: str = 'f')

Generate Text-to-Speech samples.

If you want more than one sample, separate words by a comma: "hello,bye"
If you want a sentence, separate it with _: "eita_carai"

By default the language is en-GB but you can change this.

The gender of the voice unfortunately can be f and m.

# will print in the terminal when finished downloading
speech('what')
speech('baby', gender='m')  # If you only want to change the gender, use the following syntax
speech('voa,ai','pt-BR')
speech('eita_carai,continua','pt-BR','m')

v1 >> loop('eita_carai', dur=4, pan=[-5,0,1,0])
v2 >> loop('voa', dur=PDur(3,8), pan=[0,1,0,-5])
v3 >> loop('ai', dur=4, pan=[1,0,-5,0])
v4 >> loop('continua', dur=var([PDur(3,8), 6], [7,1]), pan=[0,1,0,-5])
v5 >> loop('what', dur=8, sus=2, pan=[0,1,0,-5])

@e-lie
Copy link
Owner

e-lie commented Dec 26, 2024

Nice work @taconi <3 ! I merge that soon in january

@e-lie e-lie force-pushed the master branch 2 times, most recently from 4894951 to bd33e86 Compare November 8, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants