Mitola - MIcroTOnal LAnguage

Mitola is a new quark I made to experiment with microtonal music. It is close in spirit to Panola, a quark for more traditional music composition.

Pretty much like in Panola, you write a score (but using integer scale degrees instead of notenames) and you can attach all kinds of properties to the notes (a pitch modifier (think: accidental), an equave (think: octave), a duration, and basically any property you can think of like “amp” or “legato” or whatever you fancy - all these properties end up in the Pbind pattern that is derived from the score.

When it’s time to realize the score as a pattern, you need to pass in a tuning (i.e. the contents of a scala file, or a filename pointing to a valid .scl file) and a root frequency (since that is not part of the scala definition). Mitola comes with a RootFrequencyCalculator utility which calculates the root frequency to pin a given mitola note in a given equave (possibly with pitch modifier) to any desired frequency.

Mitola code can be found on GitHub - shimpe/mitola: supercollider quark for microtonal music composition; microtonal counterpart to panola

Mitola depends on another quark for specifying parsers: GitHub - shimpe/scparco: Quark providing parser combinators for supercollider
It’s the first real-life project made with scparco and as such was very useful to see where scparco still had gaps.

Here’s a wacky chip tune I quickly gobbled together using Mitola and some tuning dividing the octave in 10 steps I took from the scl tuning archive (code in the mitola examples): Vocaroo | Online voice recorder

The Mitola quark has documentation and some examples for you to play with.

5 Likes

Hello, I have tried to install youe mitola as follows:

Quarks.install("https://github.com/shimpe/Mitola")
"https://github.com/shimpe/mitola".include

but sclang returns the following error (I sucssesfully installed Panola and Scparco):

Installing mitola
ERROR: Message 'version' not understood.
RECEIVER:
Instance of String {    (0x12aa76248, gc=2C, fmt=07, flg=10, set=02)
  indexed slots [32]
      0 : M
      1 : i
      2 : c
      3 : r
      4 : o
      5 : t
      6 : o
      7 : n
      8 : a
      9 : l
     10 :  
     11 : c
     12 : o
     13 : u
     14 : n
     15 : t
     16 : e
     17 : r
     18 : p
     19 : a
     20 : r
     21 : t
     22 :  
     23 : t
     24 : o
     25 :  
     26 : P
     27 : a
     28 : n
     29 : o
     30 : l
     31 : a
}
ARGS:
Instance of String {    (0x12aa76ca8, gc=2C, fmt=07, flg=10, set=02)
  indexed slots [5]
      0 : 0
      1 : .
      2 : 0
      3 : .
      4 : 1
}
CALL STACK:
	DoesNotUnderstandError:reportError
		arg this = <instance of DoesNotUnderstandError>
	Nil:handleError
		arg this = nil
		arg error = <instance of DoesNotUnderstandError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of DoesNotUnderstandError>
	Object:throw
		arg this = <instance of DoesNotUnderstandError>
	Object:doesNotUnderstand
		arg this = "Microtonal counterpart to Pa..."
		arg selector = 'version'
		arg args = [*1]
	< closed FunctionDef >  (no arguments or variables)
	Quark:parseQuarkFile
		arg this = <instance of Quark>
		var qfp = "/Users/prko/Library/Applicat..."
		var result = nil
	Quark:data
		arg this = <instance of Quark>
	Quark:isCompatible
		arg this = <instance of Quark>
		var isCompatible = true
	Meta_Quarks:installQuark
		arg this = <instance of Meta_Quarks>
		arg quark = <instance of Quark>
		var deps = nil
		var incompatible = <instance of Function>
		var prev = nil
	Meta_Quarks:install
		arg this = <instance of Meta_Quarks>
		arg name = "https://github.com/shimpe/mi..."
		arg refspec = nil
		var path = nil
		var quark = <instance of Quark>
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "Quarks.install("https://gith..."
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ ERROR: Message 'version' not understood.
RECEIVER: Microtonal counterpart to Panola

You are right, there was a missing comma in the .quark file. I fixed it now (and tried it out :slight_smile: ). I’m sorry for the inconvencience (oh, and you don’t need Panola for Mitola to work - both look and feel very similar but as it stands they don’t share any code.)

enjoyed the tune! And I think scparco is oh so useful thx.

1 Like

Hi, I got the following error when installing your Quark by evaluating the code above:

Installing Mitola
Installing scparco
ERROR: syntax error, unexpected ':', expecting '}'
  in interpreted text
  line 2 char 8:

    name : "Scparco",
         ^
    summary: "Quark to simplify parsing text",
-----------------------------------
ERROR: Command line parse failed
WARNING: Failed to parse /Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/scparco/scparco.quark
WARNING: Tag not found: Quark: scparco[tags0.0.3] tags0.0.3 
 Possible tags: [ 0.0.1, 0.0.2, 0.0.3 ]
ERROR: syntax error, unexpected ':', expecting '}'
  in interpreted text
  line 2 char 8:

    name : "Scparco",
         ^
    summary: "Quark to simplify parsing text",
-----------------------------------
ERROR: Command line parse failed
WARNING: Failed to parse /Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/scparco/scparco.quark
Adding path: /Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/scparco
scparco installed
Adding path: /Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Mitola
Mitola installed
-> Quark: Mitola[0.0.6]

Aaarrgh I changed something last night without testing because I fell asleep :slight_smile:
Please remove the downloaded quarks and try again. It should work now.

Note that upgrading will not work because of a bug in the quarks system where the “master” branch name is hardcoded, whereas github nowadays uses “main” as default branch name. (It’s logged as bug #6071 already).

1 Like

Thanks!
I removed two folders which are installed by previous installation and reinstalled. Now, I get the following error:

Installing Mitola
Installing scparco
ERROR: syntax error, unexpected ':', expecting '}'
  in interpreted text
  line 2 char 8:

    name : "Scparco",
         ^
    summary: "Quark to simplify parsing text",
-----------------------------------
ERROR: Command line parse failed
WARNING: Failed to parse /Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/scparco/scparco.quark
scparco installed
Mitola installed
-> Quark: Mitola[0.0.6]

I’m sorry but I cannot reproduce this error. I just now retried here, and for me it just works:

Installing Mitola
Installing scparco
scparco installed
Mitola installed
-> Quark: Mitola[0.0.6]
1 Like

Could there still be a trace of an old version on your system?
I had to delete the Mitola and scparco folders from

~/.local/share/SuperCollider/downloaded-quarks 
1 Like

I changed the brace pair { and } in the following file to round parenthesis pair ( and ).

~/Library/Application Support/SuperCollider/downloaded-quarks/scparco/scparco.quark

Now it works.
thanks!

Hi, you were right, the brackets were wrong.
I just cannot understand why I didn’t get any errors…
Anyway, it should be really fixed now.
Thanks for the bug report!

1 Like

Hello,
Is it necessary to be version 0.0.4 of scparco as dependency?
Scparco.quark of 0.0.4 has parse error because of a blank character.
You fixed it in 0.0.5 but Mitola installs 0.0.4.

Sorry you can use the latest version of everything scparco. I will fix the mistake on github.

Edit: should be fixed now.

Perfect! Thank you!
I’d like to ask you one more thing.

Is there a quick way to convert Panola to Mitola (i.e. note name to scale degree).
I found very useful to bring music in to SuperCollider from MuseScore with Panola, so I’d like
to use quarter or 1/3 freely just like accidentals.
No way to handle micro-tuning directly with Panola?

There’s no direct way. Panola is built with the assumption of using note names, having 12 steps per octave, having repetition at the octave.

However, you can probably get a long way using some search and replace operations in a text editor. I can image e.g. that replacing " c4" with " 1[4]" (or whatever mapping you want to use) would get you somewhere.

As an alternative, to handle microtonal accidentals in Panola would probably be possible using some creative use of its custom property system, e.g. when you have a Panola string “a4_4” you can attach to it properties like “a4_4@tunedown[0.25]”. Panola can be converted to a Pbind (a pattern) with the .asPbind method. This pattern contains the custom tunedown property, and using Pbindf you can post-process the pattern to interpret the tunedown property and make it influence the frequency.

Depending on your experience with supercollider, I realize this explanation may sound complex but it’s really not that difficult :). An example of using custom properties in combination with Pbindf to do something different (adding piano pedal) can be seen at Panola - pattern notation language tutorial (at the bottom of the code).

Thank you for explanation, you gave me inspiration.
I was forgetting that it’s just text data, simply “search and replace”, voila! I could write shell script for replace all at once.

I also will look into Pbind stuff. So thank you again.