Discussion:
Custom Scales/Tunings with Patterns
Cole Ingraham
2014-09-28 03:01:24 UTC
Permalink
Hi list,

Just sharing some little write-ups I've done recently on using some
non-standard scales inside Patterns for anyone with an interest in
different tunings:

Arbitrary Just Intonation Scales
<http://coleingraham.com/2014/09/26/an-approach-to-custom-scales-in-supercollider/>
Recreating Stockhausen's Studie II Scale for use with Patterns
<http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/>

Feedback and other approaches people have on this topic is more than
welcome. I'm just trying to share my ways of working with different tunings
and am always interested in how other people work as well =).

Cheers,

-Cole
--
DMA Music Composition - University of Colorado at Boulder
MFA Electronic Music and Recording Media - Mills College
BM Music Composition - University of the Pacific

http://www.coleingraham.com
http://www.glitchlich.com
https://soundcloud.com/coledingraham
http://www.facebook.com/coleingrahammusic
James Harkins
2014-09-28 08:19:57 UTC
Permalink
On Sun, 28 Sep 2014 11:01:24 +0800
Post by Cole Ingraham
Recreating Stockhausen's Studie II Scale for use with Patterns
<http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/>
If the Studie II scale (octave = 5:1, "semitone" = 25th root of 5) can't
be handled easily with Scale and Tuning (and I think you're right, it
can't -- I tried), then it points to a weakness in these classes. They
seem to assume that the octave ratio will always be 2:1. I think the
classes should be changed to be more general (but I don't have time to
look at it now...).

(I suppose you could do it with Tuning, but you'd have to convert the
ratios into semitones, which is rather the long way around. Why
shouldn't Tuning be able to calculate the ET ratios for different
octave ratios?)

hjh


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Edward Nixon
2014-09-28 13:17:59 UTC
Permalink
Here’s a thread where this topic was discussed:

http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Custom-pitch-sequences-a-la-Stockhausen-Studie-II-td7606976.html

In some recent work, I’ve used Tim Waters’s formulation, probably because he explicitly acknowledges the limitations of existing classes and because his solution is, as he says, so ‘ugly.’ :)

…edN
Post by James Harkins
On Sun, 28 Sep 2014 11:01:24 +0800
Post by Cole Ingraham
Recreating Stockhausen's Studie II Scale for use with Patterns
<http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/>
If the Studie II scale (octave = 5:1, "semitone" = 25th root of 5) can't
be handled easily with Scale and Tuning (and I think you're right, it
can't -- I tried), then it points to a weakness in these classes. They
seem to assume that the octave ratio will always be 2:1. I think the
classes should be changed to be more general (but I don't have time to
look at it now...).
(I suppose you could do it with Tuning, but you'd have to convert the
ratios into semitones, which is rather the long way around. Why
shouldn't Tuning be able to calculate the ET ratios for different
octave ratios?)
hjh
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Fabrice Mogini
2014-09-28 14:38:43 UTC
Permalink
may not be the solution but as far as I can remember, even though the Event
system is based on octaves,
you can use a decimal with \stepsPerOctave:
\stepsPerOctave, 18.809

Also, I remember you can use .linlin to map an array to a new range larger
than the octave:
x.linlin(1,2,1,2.25);
Post by Edward Nixon
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Custom-pitch-sequences-a-la-Stockhausen-Studie-II-td7606976.html
In some recent work, I’ve used Tim Waters’s formulation, probably because
he explicitly acknowledges the limitations of existing classes and because
his solution is, as he says, so ‘ugly.’ :)

edN
Post by James Harkins
On Sun, 28 Sep 2014 11:01:24 +0800
Post by Cole Ingraham
Recreating Stockhausen's Studie II Scale for use with Patterns
<
http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/
Post by James Harkins
If the Studie II scale (octave = 5:1, "semitone" = 25th root of 5) can't
be handled easily with Scale and Tuning (and I think you're right, it
can't -- I tried), then it points to a weakness in these classes. They
seem to assume that the octave ratio will always be 2:1. I think the
classes should be changed to be more general (but I don't have time to
look at it now...).
(I suppose you could do it with Tuning, but you'd have to convert the
ratios into semitones, which is rather the long way around. Why
shouldn't Tuning be able to calculate the ET ratios for different
octave ratios?)
hjh
_______________________________________________
sc-users mailing list
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
Post by James Harkins
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
James McCartney
2014-09-28 16:56:23 UTC
Permalink
octaveRatio: 5
stepsPerOctave: 25
Post by Fabrice Mogini
may not be the solution but as far as I can remember, even though the
Event system is based on octaves,
\stepsPerOctave, 18.809
Also, I remember you can use .linlin to map an array to a new range larger
x.linlin(1,2,1,2.25);
Post by Edward Nixon
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Custom-pitch-sequences-a-la-Stockhausen-Studie-II-td7606976.html
In some recent work, I’ve used Tim Waters’s formulation, probably because
he explicitly acknowledges the limitations of existing classes and because
his solution is, as he says, so ‘ugly.’ :)

edN
Post by James Harkins
On Sun, 28 Sep 2014 11:01:24 +0800
Post by Cole Ingraham
Recreating Stockhausen's Studie II Scale for use with Patterns
<
http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/
Post by James Harkins
If the Studie II scale (octave = 5:1, "semitone" = 25th root of 5) can't
be handled easily with Scale and Tuning (and I think you're right, it
can't -- I tried), then it points to a weakness in these classes. They
seem to assume that the octave ratio will always be 2:1. I think the
classes should be changed to be more general (but I don't have time to
look at it now...).
(I suppose you could do it with Tuning, but you'd have to convert the
ratios into semitones, which is rather the long way around. Why
shouldn't Tuning be able to calculate the ET ratios for different
octave ratios?)
hjh
_______________________________________________
sc-users mailing list
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
Post by James Harkins
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
--
--- james mccartney
Edward Nixon
2014-09-28 19:11:42 UTC
Permalink
We’re still left with the need to specify the tuning parameter in Tuning.new. If we don’t, e.g.,

t = Tuning.new(octaveRatio: 5.0, name: “StudieII Tuning”);

the default behaviour of a nil tuning parameter messes things up. I.e., "tuning can be the name of a library tuning (in which case that tuning is returned); an array of floats representing the semitone values of the tuning (in which case pitchesPerOctave will be set to the size of the array regardless of the second parameter); or nil (in which case the default tuning for pitchesPerOctave will be returned).”

I haven’t checked the suggestions so far, but I’m guessing that they all rely on ratiomidi to concoct the tuning array. Tim’s approach seems to me the most robust

tuning: (0..24)/25 * 5.0.ratiomidi

but that may just be because I’m used to using it. (I ignore the implication that the StudieII steps are “semitones” apart; it's a situation where “semitone" is only relevant in defining the smallest interval between two scale degrees. Not really relevant but, meh.)

If Tuning gets done properly, then Scale will follow along pretty quietly.

u = Scale.new((0..24), t.size, t);

Am I missing something?

…edN
Post by James McCartney
octaveRatio: 5
stepsPerOctave: 25
may not be the solution but as far as I can remember, even though the Event system is based on octaves,
\stepsPerOctave, 18.809
x.linlin(1,2,1,2.25);
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Custom-pitch-sequences-a-la-Stockhausen-Studie-II-td7606976.html
In some recent work, I’ve used Tim Waters’s formulation, probably because he explicitly acknowledges the limitations of existing classes and because his solution is, as he says, so ‘ugly.’ :)
…edN
Post by James Harkins
On Sun, 28 Sep 2014 11:01:24 +0800
Post by Cole Ingraham
Recreating Stockhausen's Studie II Scale for use with Patterns
<http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/>
If the Studie II scale (octave = 5:1, "semitone" = 25th root of 5) can't
be handled easily with Scale and Tuning (and I think you're right, it
can't -- I tried), then it points to a weakness in these classes. They
seem to assume that the octave ratio will always be 2:1. I think the
classes should be changed to be more general (but I don't have time to
look at it now...).
(I suppose you could do it with Tuning, but you'd have to convert the
ratios into semitones, which is rather the long way around. Why
shouldn't Tuning be able to calculate the ET ratios for different
octave ratios?)
hjh
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
--
--- james mccartney
James McCartney
2014-09-28 19:49:28 UTC
Permalink
Well Tuning and Scale are after my time and are/were not necessary to use
Events and Patterns to play in this tuning.
We’re still left with the need to specify the tuning parameter in
Tuning.new. If we don’t, e.g.,
t = Tuning.new(octaveRatio: 5.0, name: “StudieII Tuning”);
the default behaviour of a nil tuning parameter messes things up. I.e.,
"tuning can be the name of a library tuning (in which case that tuning is
returned); an array of floats representing the semitone values of the
tuning (in which case pitchesPerOctave will be set to the size of the array
regardless of the second parameter); or nil (in which case the default
tuning for pitchesPerOctave will be returned).”
I haven’t checked the suggestions so far, but I’m guessing that they all
rely on ratiomidi to concoct the tuning array. Tim’s approach seems to me
the most robust
tuning: (0..24)/25 * 5.0.ratiomidi
but that may just be because I’m used to using it. (I ignore the
implication that the StudieII steps are “semitones” apart; it's a situation
where “semitone" is only relevant in defining the smallest interval between
two scale degrees. Not really relevant but, meh.)
If Tuning gets done properly, then Scale will follow along pretty quietly.
u = Scale.new((0..24), t.size, t);
Am I missing something?

edN
Post by James McCartney
octaveRatio: 5
stepsPerOctave: 25
may not be the solution but as far as I can remember, even though the
Event system is based on octaves,
Post by James McCartney
\stepsPerOctave, 18.809
Also, I remember you can use .linlin to map an array to a new range
x.linlin(1,2,1,2.25);
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Custom-pitch-sequences-a-la-Stockhausen-Studie-II-td7606976.html
Post by James McCartney
In some recent work, I’ve used Tim Waters’s formulation, probably
because he explicitly acknowledges the limitations of existing classes and
because his solution is, as he says, so ‘ugly.’ :)
Post by James McCartney

edN
Post by James Harkins
On Sun, 28 Sep 2014 11:01:24 +0800
Post by Cole Ingraham
Recreating Stockhausen's Studie II Scale for use with Patterns
<
http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/
Post by James McCartney
Post by James Harkins
If the Studie II scale (octave = 5:1, "semitone" = 25th root of 5)
can't
Post by James McCartney
Post by James Harkins
be handled easily with Scale and Tuning (and I think you're right, it
can't -- I tried), then it points to a weakness in these classes. They
seem to assume that the octave ratio will always be 2:1. I think the
classes should be changed to be more general (but I don't have time to
look at it now...).
(I suppose you could do it with Tuning, but you'd have to convert the
ratios into semitones, which is rather the long way around. Why
shouldn't Tuning be able to calculate the ET ratios for different
octave ratios?)
hjh
_______________________________________________
sc-users mailing list
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
Post by James McCartney
Post by James Harkins
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
--
--- james mccartney
--
--- james mccartney
Edward Nixon
2014-09-28 20:16:55 UTC
Permalink
To your point and, in retrospect, it also begs the question as to why I would feel the need to use a Tuning or a Scale for this rather particular case. Something using a base frequency and arrays of ratios might be more to the point.

Thanks, James.

…edN
Well Tuning and Scale are after my time and are/were not necessary to use Events and Patterns to play in this tuning.
We’re still left with the need to specify the tuning parameter in Tuning.new. If we don’t, e.g.,
t = Tuning.new(octaveRatio: 5.0, name: “StudieII Tuning”);
the default behaviour of a nil tuning parameter messes things up. I.e., "tuning can be the name of a library tuning (in which case that tuning is returned); an array of floats representing the semitone values of the tuning (in which case pitchesPerOctave will be set to the size of the array regardless of the second parameter); or nil (in which case the default tuning for pitchesPerOctave will be returned).”
I haven’t checked the suggestions so far, but I’m guessing that they all rely on ratiomidi to concoct the tuning array. Tim’s approach seems to me the most robust
tuning: (0..24)/25 * 5.0.ratiomidi
but that may just be because I’m used to using it. (I ignore the implication that the StudieII steps are “semitones” apart; it's a situation where “semitone" is only relevant in defining the smallest interval between two scale degrees. Not really relevant but, meh.)
If Tuning gets done properly, then Scale will follow along pretty quietly.
u = Scale.new((0..24), t.size, t);
Am I missing something?
…edN
Post by James McCartney
octaveRatio: 5
stepsPerOctave: 25
may not be the solution but as far as I can remember, even though the Event system is based on octaves,
\stepsPerOctave, 18.809
x.linlin(1,2,1,2.25);
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Custom-pitch-sequences-a-la-Stockhausen-Studie-II-td7606976.html
In some recent work, I’ve used Tim Waters’s formulation, probably because he explicitly acknowledges the limitations of existing classes and because his solution is, as he says, so ‘ugly.’ :)
…edN
Post by James Harkins
On Sun, 28 Sep 2014 11:01:24 +0800
Post by Cole Ingraham
Recreating Stockhausen's Studie II Scale for use with Patterns
<http://coleingraham.com/2014/09/28/exercise-stockhausen-studie-ii-non-octave-scale-in-supercollider/>
If the Studie II scale (octave = 5:1, "semitone" = 25th root of 5) can't
be handled easily with Scale and Tuning (and I think you're right, it
can't -- I tried), then it points to a weakness in these classes. They
seem to assume that the octave ratio will always be 2:1. I think the
classes should be changed to be more general (but I don't have time to
look at it now...).
(I suppose you could do it with Tuning, but you'd have to convert the
ratios into semitones, which is rather the long way around. Why
shouldn't Tuning be able to calculate the ET ratios for different
octave ratios?)
hjh
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
--
--- james mccartney
--
--- james mccartney
Daniel Mayer
2014-09-28 21:53:44 UTC
Permalink
Post by Edward Nixon
To your point and, in retrospect, it also begs the question as to why I would feel the need to use a Tuning or a Scale for this rather particular case. Something using a base frequency and arrays of ratios might be more to the point.
IMO an array pays if you have a collection of irregular distances/ratios.
This is not the case here, so my vote for a simple conversion Function
from division-dependant 'notes' to midinumbers.
Unless you're doing something very special (e.g. spectral stretching or such) acting
in the space of ratios is less convenient than acting in the linear space of
midinumbers.

Regards

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------




_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Daniel Mayer
2014-09-29 00:00:26 UTC
Permalink
Post by Daniel Mayer
Post by Edward Nixon
To your point and, in retrospect, it also begs the question as to why I would feel the need to use a Tuning or a Scale for this rather particular case. Something using a base frequency and arrays of ratios might be more to the point.
IMO an array pays if you have a collection of irregular distances/ratios.
This is not the case here, so my vote for a simple conversion Function
from division-dependant 'notes' to midinumbers.
Maybe I'm also a bit biased – I like to be aware of the midinumbers.
But suggested built-in options \stepsPerOctave and \octaveRatio are also perfectly usable.


// added line to show midinums
// per default this starts from middle C (60) which is interpreted as octave #5

(
Pbind(
\note, Pseq((0..9), 3),
\octaveRatio, 5,
\stepsPerOctave, 25,
\dur, 1/8,
\do, Pfunc { |e| e.use { ~midinote.().postln } }
).play
)

In my example I took an adhoc convention for root (thought as midinum) and octave
which starts from the low register.
If you pass root = 1 here (default root = 0) this is one step of the new 'octave',
and all pitches are shifted upwards accordingly.


(
Pbind(
\note, Pseq((0..9), 3),
\octaveRatio, 5,
\stepsPerOctave, 25,
\root, 1,
\dur, 1/8,
\do, Pfunc { |e| e.use { ~midinote.().postln } }
).play
)



Greetings

Daniel


-----------------------------
www.daniel-mayer.at
-----------------------------

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Cole Ingraham
2014-09-29 00:46:13 UTC
Permalink
Interesting, I wasn't aware that \stepsPerOctave and \octaveRatio worked
like that inside Events directly. Honestly I almost never deal with these
sorts of things so for me this was just a quick and dirty blind stab. Very
nice to see everyone's input on other (cleaner?) approaches to the topic.
SC of course is very capable of handling non-12EDO turnings in various ways
that are not always obvious so it's great to demystify the subject.

-Cole
Post by Edward Nixon
Post by Daniel Mayer
Post by Edward Nixon
To your point and, in retrospect, it also begs the question as to why I
would feel the need to use a Tuning or a Scale for this rather particular
case. Something using a base frequency and arrays of ratios might be more
to the point.
Post by Daniel Mayer
IMO an array pays if you have a collection of irregular distances/ratios.
This is not the case here, so my vote for a simple conversion Function
from division-dependant 'notes' to midinumbers.
Maybe I'm also a bit biased – I like to be aware of the midinumbers.
But suggested built-in options \stepsPerOctave and \octaveRatio are also perfectly usable.
// added line to show midinums
// per default this starts from middle C (60) which is interpreted as octave #5
(
Pbind(
\note, Pseq((0..9), 3),
\octaveRatio, 5,
\stepsPerOctave, 25,
\dur, 1/8,
\do, Pfunc { |e| e.use { ~midinote.().postln } }
).play
)
In my example I took an adhoc convention for root (thought as midinum) and octave
which starts from the low register.
If you pass root = 1 here (default root = 0) this is one step of the new 'octave',
and all pitches are shifted upwards accordingly.
(
Pbind(
\note, Pseq((0..9), 3),
\octaveRatio, 5,
\stepsPerOctave, 25,
\root, 1,
\dur, 1/8,
\do, Pfunc { |e| e.use { ~midinote.().postln } }
).play
)
Greetings
Daniel
-----------------------------
www.daniel-mayer.at
-----------------------------
_______________________________________________
sc-users mailing list
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
--
DMA Music Composition - University of Colorado at Boulder
MFA Electronic Music and Recording Media - Mills College
BM Music Composition - University of the Pacific

http://www.coleingraham.com
http://www.glitchlich.com
https://soundcloud.com/coledingraham
http://www.facebook.com/coleingrahammusic
Daniel Mayer
2014-09-28 14:41:09 UTC
Permalink
If Scale and Tuning aren't sufficient
I'd use midinotes in the Pbind via
a conversion Function from note number to midi.

(
// "octave" and "halftone step" as midi
o = 5.ratiomidi;
h = (5**(1/25)).ratiomidi;

// conversion function from note number to midi, root is a midiroot
m = { |note = 0, octave = 2, root = 0| octave * o + (h * note) + root }
)


(
// play random notes within "octave" #2
Pbind(
\midinote, Pwhite(0, 24, 30).collect(n.(_)),
\dur, 1/8
).play
)

(
// play "halftone steps" up, randomly switch between "octaves" 2, 3
Pbind(
\midinote, Pseq((0..9), 3).collect(n.(_, [2, 3].choose)),
\dur, 1/8
).play
)


Greetings

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Daniel Mayer
2014-09-28 14:46:46 UTC
Permalink
Post by Daniel Mayer
(
// play random notes within "octave" #2
Pbind(
\midinote, Pwhite(0, 24, 30).collect(n.(_)),
... ah, I changed the naming, then of course it must be 'collect(m.' in both Pbinds

Greetings

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------






_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Edward Nixon
2014-09-28 16:31:48 UTC
Permalink
I guess, as a semiliterate in these things, I’m always caught up short in some things I want to do, with anything where ‘midi’ comes into the equation. I suppose it’s a conceptual limitation on my part but MIDI is only and still a 128 integer concept locked in with the eighties, equal temperament and black&white keyboards. Yes, you can do real midi values but that, in my mind, doesn’t get us too far or far enough outside the 2:1 octave, ET box. I’m just not that interested in either notion.

I’m much more comfortable with an ideas like “note", to a lesser extent with “degree" and then in the event hierarchy _there_ is “midinote": “a 12ET conversion of \note, transposed into the right \octave and applying gamut transposition (\gtranspose, given in stepsPerOctave units). If \stepsPerOctave is anything other than 12, the non-12ET units are scaled into 12 \midinote units per octave.” This last, midinote, just seems to be carrying too much traditional baggage when it comes to more open ended tuning notions like the Stockhausen example we’re looking at.

Don’t know the answer. Sorry about that. But it seems all the elements are around. Maybe in the best case it’s just a matter of revising the docs or enhancing the examples. Maybe not.

…edN
Post by Daniel Mayer
Post by Daniel Mayer
(
// play random notes within "octave" #2
Pbind(
\midinote, Pwhite(0, 24, 30).collect(n.(_)),
... ah, I changed the naming, then of course it must be 'collect(m.' in both Pbinds
Greetings
Daniel
-----------------------------
www.daniel-mayer.at
-----------------------------
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Daniel Mayer
2014-09-28 21:23:11 UTC
Permalink
I guess, as a semiliterate in these things, I’m always caught up short in some things I want to do, with anything where ‘midi’ comes into the equation. I suppose it’s a conceptual limitation on my part but MIDI is only and still a 128 integer concept locked in with the eighties, equal temperament and black&white keyboards. Yes, you can do real midi values but that, in my mind, doesn’t get us too far or far enough outside the 2:1 octave, ET box.
As you can see in my example there is no restriction in using \midinote for
any octave size and division number of steps.

'midinote' is a scaling concept for pitches.
It transforms the space of frequencies (where ratios are relevant) by application of
a logarithm to a linear space of numbers.
Linear means that equal distances in the linear space
represent equal frequency ratios, thus same intervals (thanks to log).

If we want to write out the transformation done by cpsmidi
it looks like that:

b = 2**(1/12);
k = 69 - (440.log/b.log);

m = { |f| f.log/b.log + k };

I just derived it by hand to verify, you can start with variable b and k
and get the values by two restrictions:

1.) we want a ratio of 2:1 to be transformed to 12
2.) we want 440 Hertz to be mapped to 69 (a')

Values can be derived from two equations
where b log means logarithm to the base b:

b log (440) + k = 69
b log (220) + k = 57


So the choice of ET-12 and 440 Hz at a' are
determining that *special form* of logarithmic mapping
BUT: you can represent
any frequencies of any octave size and division
also with this special mapping, and as we are in a linear space
we already have the convenience of being able
to simply add intervals.


Related, and a bit hidden in tutorials IMO:
if you pass \midinote in an Event/Pbind the parameters
'octave' and 'stepsPerOctave' are completely ignored (try out) !

It can be seen in Event.sc:

note: #{
(~degree + ~mtranspose).degreeToKey(
~scale,
~scale.respondsTo(\stepsPerOctave).if(
{ ~scale.stepsPerOctave },
~stepsPerOctave
)
);
},
midinote: #{
(((~note.value + ~gtranspose + ~root) /
~scale.respondsTo(\stepsPerOctave).if(
{ ~scale.stepsPerOctave },
~stepsPerOctave) + ~octave - 5.0) *
(12.0 * ~scale.respondsTo(\octaveRatio).if
({ ~scale.octaveRatio }, ~octaveRatio).log2) + 60.0);
},
detunedFreq: #{
~freq.value + ~detune
},
freq: #{
(~midinote.value + ~ctranspose).midicps * ~harmonic;
},


'note' depends on 'degree', 'midinote' on 'note' and 'freq' on 'midinote'.
A value passed 'higher' in the hierarchy makes passed values 'lower' in the hierarchy being simply ignored.

So to summarize I find midinote the most convenient form of input.
In the example case it needs 3 lines of extra code and the use of 'collect'.

It doesn't make any restrcition about tuning, octave division, root etc., this all
is included in the collected Function applied to 'notes'.


Greetings

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------





_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Loading...