Sieve of erastothenes
Hello, i would like to create a program that uses the sieve of erastothenes to spit out MIDI values for composition. I would like to implement it in max but all i have been able to find is java code for it.
fixed.
Can someone help me get started? I would like to compose music with primes obviously
thank you for any help
Perthaps if you start a max patch, people will help out when you get stuck
i just started one with reading a text file of the primes and unpacking them, but then i am unsure how to scale or mod the prime into a usable midi note.
So this is just how to get the prime out of a list, how does one convert a prime number into a usable midi note? I have been searching but i cannot seem to find anything yet
(remember to use Copy Compressed when pasting to the forum)
So yeah, you've stumbled upon the biggest thing in electronic music, basically. Mapping is Everything.
Do you press and mold your numbers so much, that it might sound like the epitome of modern music, but lacks any connection to the original primes?
Or do you try to preserve the primes as clean as possible, even though that might... sound awful?
I mean, you could do "series of primes -> modulo 3" and then use the 0s, 1s, and 2s to make up your piece. But then are there any discernible elements remaining of the primes? Can the audience get a sense of this? Do you want them to?
Roughly, you could do % 128, and then every prime ever will fit inside the midi note range. But I guarantee you it will sound really bad until you do more to it ;)
WETTERBERG, i have been composing with JUST intonation and Harmonic Series for about 20 years. Did a video on La Monte Young and Marian Zazeela in Dreamhouse in undergrad and co-directed the South East Just Intonation Society--a small group of folks interested in LY, Partch and other like minded composers. I studied Hindustani Classical for 20 years before playing with Ravi and Anoushka and i am pretty sure Shankars "SA" was the 17/16, so i kind of know what i want to do but i am struggling gettingthe primes into midi format, can you give me an example i may learn from?
Patrick
Here's a simple patch of 1000 primes mapped to MIDI using [% 128]
The thing with using modulo (and this holds for pretty much any modulo base you'd use for MIDI) is that once you get to higher primes, the result is going to essentially be a random number generator (with rather poor statistical characteristics). For one thing, every prime larger than 2 is odd, so a simple modulo mapping (assuming the modulo base is even) is going to limit you to pitch classes from [6-35] (aka as the whole-tone scale). If that's what you want, great. But you should be aware of it.
There are gazillions of ways to do mapping. The issue of Computer Music Journal from last fall (39:3) had several articles on new approaches to mapping, and anyone thinking about mapping may well find some helpful ideas there.
But the main problem is to decide how you want to map some sequence of numbers to music. Once that's settled, patching in Max should just be an exercise in implementation.
--
EDIT: In case anyone thinks it makes a difference, yes, I work for the editorial office of CMJ. I thought everyone knew that;-) No, I'm not trying to plug the Journal. But if anyone finds the issue a useful resource, great!
Patrick, I didn't mean to sound patronizing at all. I'm sorry if it came across that way, I get a little carried away by these things, since I dig these things so much.
I basically meant what Peter said: that straight modulo mapping wraps things up to be essentially bad RNGs. (also Peter, I think it's beyond awesome that you can extrapolate so much on the topic!)
I'd love to help out with the mapping, but the mapping will, essentially, write your piece. The way I see it that's the essence of it.
Hope this clarifies it.
WETTERBERG, it's okay, i just wanted to clarify that this is not my first time composing with primes, i spent several weeks with La Monte in the late 1990s and was transfixed with the DreamHouse pitches and started composing scales with 17th harmonic, one of which was documented by Joe Monzo and is actually included in Scala/Cakewalk Z3ta+ [Beardsley/Pagano] tuning.
Peter: I know you have contributed many objects in max, have you created any that organize MIDI into sets for composing with them, for example i would like to identify certain primes then construct a just scale built upon them like mode 17, say [17/17, 17/16, 17/15, 17/14, 17,13, 17/12, 17/10, 17/9]
could max be used to construct the scale built on the selected prime?
I am just fooling with some VERY basic ideas to get used to converting and stepping through the primes.
Are there any external sets that might be useful that anyone can recommend?
PETER, that issue you mention seems to be offline?
can you check it?
http://www.mitpressjournals.org/toc/comj/38/2
here's a practical example of making a list of ratios (can be applied to primes or not):
Thank you floating point that is really cool. After we are able to make the list of primes as you have given i want to map it to a Fundamental frequency (64)(128)(256) to build the the scale and then return that scale to midi to play it. Should i pack that list or is there an easier way?
I'd put the list in a coll and reference it that way.
why do you want to 'return it to MIDI'? MIDI and just intonation are a bit like oil and water-- do you want to use a midi synth? if so you'll need to separate out the fractional part of the midi pitch and apply that to pitch bend parameter, which means it will have to be monophonic, otherwise just synthesize in msp
i want try mapping it back to a keyboard so that each note will get the specific frequency relationship. i guess i do not need to go "back"to midi but tell me if this is just shooting myself in the foot. I am just testing with a 128hz base. Also is there a way to constrict it to 12 pitches so it give us intervals based on whatever primes and a 1/1 and a 2/1 and the prime stuff fills in the rest?
Then i would like say C3 to be 256, then C4 273 etc.. I know i could just map them one by one with MSP but i want to change them so we can have a 17th-ness scale or a 31th-ness etc..
and not a MIDI synth but a MIDI controller is what i want to use. An Arturia beatstep or an Akai LPK25
because with the Beatstep i could use it's random features and perhaps map Gamelan sounds with the proper frequencies or bagpipes, or hurdy Gurdy
but i think you are probably correct, to get the controller or the synth to be flexible the notes would have to be bent as you say. there has got to be some examples of doing that in MSP i can find i hope
i found this
https://cycling74.com/tools/the-consonant-keyboard/
which is really nice but it does not have a way to construct the JI scale from the prime as we are trying to do.
I don't really understand what you're trying to say. But I'll guess. You want a MIDI controller to control sample playback?
if so, use a coll to reference the ratios, then simply pitch-shift your samples in msp:
If your interested in 3rd party objects I believe you'll find the bach library very useful. www.bachproject.net
PETER, that issue you mention seems to be offline? can you check it?
The Fall issue: http://www.mitpressjournals.org/toc/comj/38/3
Regarding objects: I haven't written anything that would actually calculate scales along the lines you're working (as I understand it). Sorry.
i wonder how this project ever ended.
from an artistic (or philosophical) viewpoint it is a bit odd to start out with primes and then convert or map them to something else to produce audio.
it should be far more fun to use them as is, be it on a linear scale or on a scale in Hz.
so the fornmula i would suggest would be *n.
btw, the first thing which comes to mind would be durations/beats/rests/number of repetitions ... rather than a list of frequencies.
-110
This project never really ended, i just made the patch i wanted from what the people here kindly posted. I prefer building scales with primes 3,7,11,17,19,29,31 because they reveal new ratios that have not been used and over-use din western music. Now i know 7 has been explored very well and Partch used 11 extensively. When i spoke with Ravi Shankar and asked him about the SA/17/6 in his music he just confirmed for me that his SA was in fact a C# in western notation which in my mind and upon listening to many of his recordings i can confirm that its a 17/16 over a 256 base.