Kara-Moon Forum
April 08, 2020, 10:31:36 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Musings for sounding instruments  (Read 122 times)
sciurius
Full Member
***
Posts: 231



« on: March 23, 2020, 12:46:48 PM »

I've been thinking about the Plectrum tracks and how to use them from the perspective of a guitar player.

Since a number of characteristics are not related to guitar per se I introduce the concept of sounding instruments. These are instruments that produce a sound that sustains until actively terminated. Examples are harp, xylophone and tubular bells. In this group I include plucked string instruments like guitar, ukulele and mandolin, since they have similar sounding behaviour, even though they have the additional property that sounds are terminated implicitly by plucking a different finger position on the same string.

Thinking the way MMA works, patterns can be used to define when sounds must be made. Patterns map the plucking of a string in time. For the actual sound, the pattern is applied to an enumeration of strings/positions, a chord. Positions play a role guitar-like instruments; real sounding instruments only have open strings (or bells, etc.) and hence no chords. (Yes,a harp can change tuning but that's no problem.)

Here we encounter a problem when trying to realize this with MMA. Patterns are defined in grooves, and to switch patterns we must switch grooves. In the current implementation, switching grooves mutes all sounds, something we do not want.

As stated above, patterns map the plucking of a string in time. On beat 1 pluck string 5, on beat 2 pluck string 3, on 3 pluck string 1, etc. This can be easily realized, MMA provides everything already.

Code:
Begin Plectrum
    Voice       NylonGuitar
    Sequence {
            1.0    0   5:80;
            2.0    0   3:80;
            3.0    0   1:80;
    }
End

Suggested enhancement: Allow strings to be specified by (extended) ranges, e.g. '1-3', '1,2,3', '1,3-5' and so on.

A special form of pattern is the strum, where plucking starts at the indicated time and the plucks are evenly distributed.

Code:
    Sequence {
        1.0   30   80 70 60 40 30 20 ; // decrease volumes on strings this way
    }

Suggested enhancement: Allow strings to be specified by (extended) ranges, but order matters. E.g. '1,3,2' will sound strings 1, 3 and 2 in that order, '1,5-3' will sound strings 1, 5, 4, 3 in that order, and so on.

Suggested enhancement: Use fractions for strum values. For example, in a 3/4 signature, the sequence '1 3/6 6:90 1-5:80' would mean that the 6 plucks are distributed over the 3 beats. Effectively, the number evaluates to a beat offset. Also, since we can control the order of the plucks there is no need for negative strum values. The example sequence '1 3/6 6:90 1-5:80' is equivalent to:

Code:
    Sequence {
            1.0    0   6:90;
            1.5    0   1:80;
            2.0    0   2:80;
            2.5    0   3:80;
            3.0    0   4:80;
            3.5    0   5:80;
    }

But the most powerful and intuitive way of describing plucked strings, especially on guitar-like intruments, is the tablature (see https://en.wikipedia.org/wiki/Tablature#Guitar_tablature). This is completely alien to MMA, since it combines strings, positions and timestamps in one, MMA separates positions and timestamps (patterns) from strings (chords) by design. I'm currently not sure how to bring tablature to MMA...

I developed a prototype (in perl) that supports the pluck, strum and tablature as described above. From experimenting I must say that I do like the tablature approach but I'd never let go of the pluck and strums.

Just some musings... Ideas?
Logged
bvdp
Kara-Moon Master
****
Posts: 1111


WWW
« Reply #1 on: March 23, 2020, 04:54:03 PM »

Quick question on all this: Is the real problem (and one reason the plectrum code was written) is that CHORD, etc. sounds do not continue to ring, as opposed to PLECTRUM which has no duration specified?

I find that I use BASS tracks a lot and maybe having a special duration which essentially would let the tone ring "forever" might solve some problems?

So, here's a quick idea (and I have not thought this though or looked at any code!) what about using a very long duration? I think one could try right now by defining the duration as 1+1+1+1+1+1+1+1

So, testing this with the following code:

Code:
Begin Bass
 Sequence {1 1+1+1+1+1+1+1 1 90; 2 1+1+1+1+1+1+1 1 90;1 1+1+1+1+1+1+1 1 90;4 1+1+1+1+1+1+1 1 90;}
 Voice Piano1
End
C / D
D / E

Tells me that my theory is not the best ... or is it?

Of course, we would need to have a special note duration for "forever". And I think a "dampen" command as well.
Logged

My online life: http://www.mellowood.ca
sciurius
Full Member
***
Posts: 231



« Reply #2 on: March 23, 2020, 06:37:11 PM »

No, this has nothing to do with.

For plucked and strummed guitar it is necessary that a) strings keep sounding until re-played or muted, and b) completely control what strings are plucked, and when. Plectrum, in particular with Plectrum Shape, does a great job but changing grooves stops sounding strings.

Quote
So, testing this with the following code:...

Even if it would work, sounding notes do not stop when the same string is played at another position. In your example, is the D is played on the open D string, then the note must stop when E is played on position 2 on the D string. Plectrum handles that.
Logged
bvdp
Kara-Moon Master
****
Posts: 1111


WWW
« Reply #3 on: March 23, 2020, 08:54:30 PM »

Yes, right you are. I keep looking at a keyboard to see notes and forget that on a guitar notes are laid out on a string, hence a new note can stop an existing, different, note.

Am I confused by your comments, then, about bells, etc? I assume that we'd look at them like a keyboard?
Logged

My online life: http://www.mellowood.ca
sciurius
Full Member
***
Posts: 231



« Reply #4 on: March 23, 2020, 09:28:36 PM »

Quote
... and forget that on a guitar notes are laid out on a string, hence a new note can stop an existing, different, note.

This is what Plectrum is all about.

Quote
... bells, etc? I assume that we'd look at them like a keyboard?

Yes, you can regard these like a keyboard with keys that only start notes. The sound only stops when the key is pressed to resound the same note. (Or when manually muted, this is where the keyboard analogy ends.)
Logged
bvdp
Kara-Moon Master
****
Posts: 1111


WWW
« Reply #5 on: March 24, 2020, 12:24:40 AM »

The entire business of different instruments is interesting. I think we can classify most into polyphonic and monophonic. So, we have things like sax, trumpet, etc. on which the sounding of a new note stops the previous ... mind you, there are other ways to stop it at all. Then, piano, chimes, vibraphone, etc are clearly polyphonic. Mind you, the struck note doesn't sound "forever" ... eventually the ringing stops.

So, where does a guitar fit? Can we call it 6 monophonic instruments tied together? Probably not. So, do we need to broaden our simple classification system? Oh, well ... just silliness ... too much time locked in the house Smiley

I will give some detailed comments on your original suggestion after I have time to review and digest it. But, just off the top of my head a concern is that the syntax is getting to be quite obtuse. Is there a way we can make it more readable? Perhaps using Keyword=setting pairs or something?

Anyway, I'll print this later and post more tomorrow.

Best,
Logged

My online life: http://www.mellowood.ca
sciurius
Full Member
***
Posts: 231



« Reply #6 on: March 24, 2020, 07:41:09 AM »

Interesting ideas. I do think that a guitar comes, indeed, close to 6 monophone instruments...

But we can skip the musings and move straight on to the 'enhancements' section.

The major enhancement is to keep strings ringing while changing grooves. This should be default behaviour for Plectrum tracks.

The range enhancements do not add real complexity. However, with order significant, this will potentially break existing patters. A strum '1-6:80' is reverse '6-1:80'.

Using fractions for strums is new, distinct syntax that doesn't get in the way of anything already existing.
Logged
bvdp
Kara-Moon Master
****
Posts: 1111


WWW
« Reply #7 on: March 25, 2020, 09:17:36 PM »

I know I looked into not stopping sounds when switching grooves awhile ago. As a start, let me look at this again and see if I can help there. It really should not be all that hard Smiley
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1111


WWW
« Reply #8 on: March 26, 2020, 09:57:58 PM »


Okay, this is just step one. The code (or lack thereof) doesn't test or anything, but at my end it does seem to work with the most trivial example I have.

First off, in pat.py simply comment out the call to self.doMidiClear() in line 1303.

Next, run this test file:

Code:
Begin Plectrum
    Sequence { 1.0 +5 80 90 100 105 107 110 }
End
DefGroove P1

Begin Plectrum
    Sequence { 1.0 +5 88 0 99 0 77 0 }
End
DefGroove P2

Groove P1
D
Groove P2
D

At all close?
Logged

My online life: http://www.mellowood.ca
sciurius
Full Member
***
Posts: 231



« Reply #9 on: March 27, 2020, 07:34:04 AM »

Looks and sounds okay!
Logged
bvdp
Kara-Moon Master
****
Posts: 1111


WWW
« Reply #10 on: March 27, 2020, 04:36:19 PM »

Looks and sounds okay!

Good. For the next step, then, I suggest we have some other tweaks:

  1. This will only apply to Plectrum tracks. And, I see no reason to have it apply to
       individual tracks?
  2. It should be a switch on/off behavior.
  3. QUESTION: How to set on/off???

I have thought of 2 ways, and tested neither. But:

   1. Have a flag setter: Plectrum GrooveReset on/off
         Advantage is that we could isolate to specific tracks....
             Plectrum GrooveReset on
             Plectrum-Foo GrooveReset off
         Disadvantage is that it's getting pretty complex and have more flags to transport.

   2. Enhance the GROOVE command with a NORESET option:
           Groove FooBar NoReset=On
       Simple to parse a Groove command for a Cmd=Option pair. Hopefully there are no grooves in
       the wild with "=" signs. And, this would apply to all tracks. Non-plectrum tracks would be ignored.

My preference is 2.

Comments?
Logged

My online life: http://www.mellowood.ca
sciurius
Full Member
***
Posts: 231



« Reply #11 on: March 27, 2020, 05:55:32 PM »

Personally I think this should be the default behaviour for Plectrum tracks.

Whether it would be useful for other tracks? Noone has ever brought up the issue so apparently for other tracks the current behaviour is fine. Probably it is better not to break things then.

This would also eliminate the need for more settings/parameters.
Logged
bvdp
Kara-Moon Master
****
Posts: 1111


WWW
« Reply #12 on: March 28, 2020, 11:42:51 PM »

I've attached a patch file which runs against mma-2002:

  - fixes the buy in plugins so it works with python 3
  - sets up the don't stop plectrum on groove change
  - sets a tweak to change it (Tweak PlectrumReset=True/False)

If you guys could run it against some of your plectrum code it'd be appreciated. I'll write some docs, etc. this weekend and try to get a devel version up in the next few days.

* mma.2020.txt (2.48 KB - downloaded 3 times.)
Logged

My online life: http://www.mellowood.ca
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.073 seconds with 20 queries.