Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are triplets supported? #176

Open
lukassteiner opened this issue Dec 24, 2022 · 3 comments
Open

Are triplets supported? #176

lukassteiner opened this issue Dec 24, 2022 · 3 comments

Comments

@lukassteiner
Copy link

Can I create a MIDI that uses triplets with scribbletune?

If yes, is there an example available?

@walmik
Copy link
Collaborator

walmik commented Dec 25, 2022

Yes this is possible. I ll respond back with an example soon.. however in the mean time could you try [xxx] as the pattern?

Each x is a quarter note by default. Putting 3 x's in square braces will try to fit in 3 equally spaced notes in the duration of a quarter note.

Needless to say you can change the default duration of a quarter note and nest the square braces based subdivision and even use hyphens in there to put gaps in the triplets.

@lukassteiner
Copy link
Author

Perfect, that worked. Thanks!

I am not sure if that is possible with scribbletune. But what want to do is a rhythm pattern like this:
Screenshot 2022-12-25 at 19 15 30

Where the x and the • represent a different sound of a Djembe drum.
For the sake of simplicity, x would be C4 and • would be B4.

So the pattern would be:
[x--][x••][x--][x••]

Or another, more complex example:
Screenshot 2022-12-25 at 19 20 55
Screenshot 2022-12-25 at 19 20 59

So that pattern would be:
[•--][xxx][x-x][x--][x--][---][x--][---]

Is it possible to do that with scribbletune?

And can I add multiple different rhythm patterns into a single midi file into different channels so that I can create polyrhythm?

For example these separate Djembe rhythms:
Screenshot 2022-12-25 at 19 24 34

Thank you!

@walmik
Copy link
Collaborator

walmik commented Dec 26, 2022

Hi @lukassteiner Yes the first part should be possible however it will be a bit cumbersome. Having said that, it s doable for a small set of samples. If my percussion instrument is made up of only a handful samples, then I would create a set of wav files that denote the percussion sound I want. Then I d create a Sampler instrument in my DAW (I use Ableton, but you can use anything that lets you set up a MIDI instrument that plays samples for each note). In the Sampler, I would set up the percussion samples for the notes I intend to use. For eg. On C4 I would setup one sound (for eg djembe1.wav) and then on another sound on B4 would be djembe2.wav)

Then I d create a clip like this


const scribble = require('scribbletune');

const djembeClip = scribble.clip({
	notes: 'C4 C4 B4 B4 C4 C4 B4 B4',
	pattern: '[x--][xxx][x--][xxx]' // note that the • have been converted to x as well
});

scribble.midi(djembeClip, 'djembe.mid');

Basically Scribbletune will sequentially use the notes you pass to it and then repeat over if the pattern is longer (and vice versa). This is a bit cumbersome as you may not necessarily know which x denotes whice notes intuitively.

In case you have only 2 wav file then there is the "R" character that maybe you can use . It lets you randomly select another note in its place. It also lets you set the notes you d like to use for this selection. In there you can specify just B4, and this if we take your original pattern

[x--][x••][x--][x••]

It will need to be like this

[x--][xRR][x--][xRR]

And then

const scribble = require('scribbletune');

const djembeClip = scribble.clip({
	notes: 'C4 C4 B4 B4 C4 C4 B4 B4',
	pattern: '[x--][xRR][x--][xRR]',
	randomNotes: 'B4' // this can be a string or array of notes
});

scribble.midi(djembeClip, 'djembe.mid'); 

Once you import this file, you ll have something that looks like
djembe

(please note, Ableton has a different notion of the middle C (it uses C3 as middle C) hence our C4 and B4 have turned to C3 and B3 respectively.

Hope this helps, lemme know how it goes. For the other question, creating polyrhythms is possible (because you can use the square braces to subdivide any duration) but to have multiple custom patterns in the same midi clip via channels is not yet available in Scribbletune. It is a much desired feature. You can read my comments on this issue on how this can be implemented.

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

No branches or pull requests

2 participants