paulrosen / abcjs

javascript for rendering abc music notation
Other
1.95k stars 287 forks source link

Voices, Chords and Drum Volume #936

Open brLuther opened 1 year ago

brLuther commented 1 year ago

First, I've to thank you Paul for your Excellent Job doing this library, helping people to learn music. Congratulations for your work.

I'm doing a website with musics of brazilian popular culture. We've so many rythms and plural expressions.

I read all the documentation, saw examples, but I've some questions:

  1. about Volume of Voices, is it possible to setting diferents volume for each Voice?
  2. about Chords: I don't understand how can I change the instrument of Chords..
    • I tried %%MIDI bassprog, %%MIDI bassvol, %%MIDI chordprog, %%MIDI chordvol and not work. Can you explain me how Can I change the isntrument e change volume of chords.
    • Can I change the rythm of Chords? create more? Or only 'chick boom' pattern?
  3. About Drums.. Can we create a bank of Metronome Drums (or hidden Drum Voice) to use togheter ABCJS?

I don't know if my questions are relevant, but I'm thanks your attention!

paulrosen commented 1 year ago

Thanks!

First of all - the synth part of this is cool, but it is definitely an add on. It isn't designed to sound completely lifelike. There is a lot of interest in the synth, though, and it continues to improve.

The rhythm of the chords is possible in the ABC standard but I haven't implemented it yet. I would love to, but I don't have time at the moment.

For the drums - they are defined with a string. See https://paulrosen.github.io/abcjs/audio/synthesized-sound.html#drum-parameter. I might not understand what you mean by "bank of drums", but you could create an array of strings and pass them in as needed.

There is also %%MIDI bassvol and %%MIDI chordvol.

For voice volume, you can use the standard music symbols of !pp! , mf, etc. You can also use %%MIDI vol and %%MIDI volinc.

I'm not sure why your use of midi commands didn't work. If you post an ABC string then I'll look at it. It could be a bug in abcjs or it might just be picky about where it is defined.

I'd also love to see what you're doing. I'm fascinated by Brazilian rhythms.

brLuther commented 1 year ago

Hi Paul, i'm so glad for your reply in my questions..

I'm trying all possible to change the volume of chords and instruments, because this (i belive) can make a more realistic sound.

%%MIDI bassvol %%MIDI chordvol %%MIDI chordprog %%MIDI vol %%MIDI volinc

Don't make any effect or change the volume of MIDI.

My code to test:

X:1
T:Not change volume or chordprog
L:1/8
M:2/4
Q:130
K:Dm
V:1
%%MIDI program 25
%%MIDI bassvol 10
%%MIDI chordvol 10
%%MIDI chordprog 25
%%MIDI vol 10
%%MIDI volinc 10
"Dm" DDFA |"A7" ddfc| "Dm"e4 | d4| "Dm"DDFA |"D7"ddAF|DDEF|"Gm"(G4|G2) EF |
G3 G|GGBF | "A"(A4 | A)GFG | "A7"A3 A|  AAfc |"Dm" e4 |  d4 |]
"Dm" DDFA |"A7" ddfc| "Dm"e4 | d4| "Dm"DDFA |"D7"ddAF|DDEF|"Gm"(G4|G2) EF |
G3 G|GGBF | "A"(A4 | A)GFG | "A7"A3 A|  AAfc |"Dm" e4 |  d4 |]

About the Rhythm of Chords: Ok, I understand, it's a big job, thanks to explain me.

About the Drums: I'll study your references and then I can be more assertive in my questions or ideas.

About my Job: I'm working on a catalogue of Hymns reiceved as spiritual messages in a religion called Santo Daime based in indigenous drink Ayahuasca. It's a culture from Amazon Florest from North of Brazil and has much influence by others popular cultures in Brazil. When I've some result will be happy to share with you.

Thanks to your attention, you are a fantastic person.. inspired me a lot in this days.

paulrosen commented 1 year ago

Cool tune!

I'm not sure what's going on but a workaround is to put the accompaniment midi commands above the V line. That is:

%%MIDI bassvol 10
%%MIDI chordvol 10
%%MIDI chordprog 25
V:1
%%MIDI program 25
%%MIDI vol 10
%%MIDI volinc 10

That is a bug in abcjs, I think, but if you aren't dynamically changing that it might help.