Polyphony project v0.3.0

Exactly! I think good instructions balance spontaneity and consistency. There’s room for creativity and the result can meet some standard we set. We try to allow for good outliers, because without surprises, even consistently good music can get boring.

1 Like

Hello and thank you for your interesting project.

Please would you mind to explain a little bit how possibly
I could generate some sound in sonic pi via your library?

there is no single play statement in your code

and somewhere it states that it does not generate sounds but just midi commands

so is your library somehow usable with the internal synths?

If so how?

Thanks

1 Like

Hi there! Thanks for taking a listen and reading what I wrote too!

As it currently exists, the project doesn’t use the internal synths. It shouldn’t be too much trouble for me to add the functionality. (Fingers crossed it’ll sound good too!) Please check back in a few days (I’ll mention you), for I should have something written, tested, and documented by then. Sorry to make you wait! :sweat_smile: (You can keep up with my progress on the latest branch if you’re curious to see the work in progress :wink: Currently on v0.3.1. The internal synth subsystem will be on v0.3.2.)

All the best!

Thanks for the fast reply …

I was just a little bit supprised with your repository
because you are writing above how it sounds
and gave the soundcloud example …

But within your repository there is not mentioned any
sound output (equippment). So what sythesizer are you using?

I do have also external midi capable synthesizers
( Akai SG01k and a Yamaha QY100) so it does not
need to be the SP-syths … but somehow a
little example/demo at least would be good.

BTW
I like your repository as a kind of good expansion / plugin
example using proposed ‘standard’ interfaces to build up
addon modules with multiple files.

The program only generates MIDI events, so I didn’t see any place to mention the specific endpoint I’m using. My setup consists of a couple loopMIDI virtual MIDI cables and my DAW (Ableton), on which I’ve loaded two port’s worth of channels onto tracks (so 16 channels x 2 ports = 32 tracks). Each track has a virtual instrument or a group of virtual instruments loaded. The virtual instruments I’m using are BBCSO Core by Spitfire Audio and Pianoteq Stage by Modartt.

I’ll prepare a demo video on YouTube for you and anyone else who’s interested. Sorry my readme isn’t helpful. I’ll try my best to help you, if you’ll be patient with me figuring out how things work in your setup. Helping you will help me to improve my readme and documentation, so thanks in advance! :slight_smile:

Thanks! I aim to make my code as modular as possible, but it’s a little difficult because Sonic Pi doesn’t support object-oriented programming.

Hi @Buce! Update: I’ve added Sonic Pi synths to the project. It’s all set up to work right out of the box. There are instructions in the readme if you want to change anything, but otherwise, all you need to do is change the directory string in main.rb and run the main file. If you’d like, you can try it out now!

I’ll be recording demos for setting up the project with Sonic Pi synths as well as MIDI. I’ll let you know when those are out. Please let me know if there are any issues. Thanks for your patience!

1 Like

V0.3.4 fuses the previously distinct MIDI and Sonic Pi ensembles, meaning that voices can now use a combination of the two. Instructions on how to set up this feature can be found in the readme section entitled “Ensemble Setup”. By default, the program uses Sonic Pi instruments, and no changes are necessary in the setup from V0.3.2.

(The demo/tutorial videos are waiting on an order I placed for an Elgato device.)

Thanks for your adaptions.

One thing I recognize are the relative huge pictures in the wiki.

I think their information is clear but quite a few of them could be shown
and easily recognized
at much smaller sizes(maybe half the size).

just for information …

Thank you for pointing out the over-sized diagrams! I am now fixing it. The wiki will be much more polished by v1.0.0. I’m not personally satisfied with the quality of the content I wrote.

In your wiki you write about chronomorphs as the basis of a composition
and motifs as the next stage.

But you do not recommend where to place and how to
write down chronomorphs and motifs.

Where is possibly the place where i would give your agents more directions
with more detailed patterns?

In main, settings or in ideation?

And how should a more directed pattern look like
say if I would like polyphony to sound a little bit
more ’ Alouette, gentille alouette’-like.

First, I apologise for making you and everyone remember a clunky word like “chronomorph”. I think I should simplify the language and use the word “note” instead, so that no special definition is required.

Even though I explained a bit of how the program works inside, I haven’t provided any easy ways to control the musical material. Someone has suggested it to me before, but I didn’t have an easy answer.

There is one way, but I would not recommend it because it’s too much work for you or anyone at the moment. The way: insert your own motifs on line 36 of main (set("motifs", …)). Here is what the first 4 bars look like as 2 motifs:

set("motifs", [
  makeMotif([
    makeChronomorph(0, 3),
    makeChronomorph(1, 1),
    makeChronomorph(2, 2),
    makeChronomorph(2, 2),
    
    makeChronomorph(1, 1),
    makeChronomorph(0, 1),
    makeChronomorph(1, 1),
    makeChronomorph(2, 1),
    makeChronomorph(0, 2),
    makeChronomorph(-3, 2),
    ]),
    
  makeMotif([
    makeChronomorph(0, 3),
    makeChronomorph(1, 1),
    makeChronomorph(2, 2),
    makeChronomorph(2, 2),
    
    makeChronomorph(1, 1),
    makeChronomorph(0, 1),
    makeChronomorph(1, 1),
    makeChronomorph(2, 1),
    makeChronomorph(0, 4),
    ]),
  ])

Two things to note when making your own motifs:

  1. Notes are specified in relative notation, e.g. in the key of F major, F4 = 0, G4 = 1, &c.
  2. The notes’ spans should add up to the number of units per measure exactly. Too little, and the program might crash when it reaches an index out of bounds. Too much, and you won’t hear the rest of the motif because the program won’t reach it.

I made a branch for this work for you to play around with. Among other changes, the key signature is (0, :ionian), and the units per minute is 280.

Here is what this ‘Alouette Fantaisie’ sounds like:

I’ll make an easier way to enter notes.

In v0.3.7, I’ve introduced a function to simplify motif-making, called makeMotifFromArrays. The ‘Alouette’ motifs would be entered like this on line 36 of main.rb:

set("motifs", [
  makeMotifFromArrays([
    [0, 3], [1, 1], [2, 2], [2, 2],
    [1, 1], [0, 1], [1, 1], [2, 1], [0, 2], [-3, 2],
  ]),
  makeMotifFromArrays([
    [0, 3], [1, 1], [2, 2], [2, 2],
    [1, 1], [0, 1], [1, 1], [2, 1], [0, 4],
  ]),
])

I might move this into the settings file, so that everything is in one place.

Thank you for your adaptions.
I downloaded the main branch which says v0.3.6 and the upper does not fail and
sounds to work.

One recommendation from my point of view:
Please add an additional motif constructor possibly called
“makeMotifFromClassicNotation” or and “makeMotifFromPattern”
in which current note name-symbols :c,:f,… and or/also standard note/pause timings
(wt ,wd, dw, w, dh, h = 2, dq, q = 1, de, e = 0.5, s = 0.25 )
like Robin Newman git-alias rbnpi and others are suggesting could be used.
This could probaly make polyphony a little bit more ‘intuitive’.

Thank you for your suggestion! I am currently working on v0.4.0, which is another complete rewrite, based on a suggestion I received to use modules in my work. This rewrite is going to change some things for users, so it’s my priority to finish it as soon as I can.

To make motif construction easier and more intuitive, I’m planning to create a motif editor. It will be a web app which I will host on GitHub Pages. The minimum product is a simple HTML form with a JS script to convert human-friendly music notation into a motif that can be copied and pasted into the settings in Polyphony. Future iterations of the web app may allow users to modify settings using a GUI and export the result directly to a settings file.

Thanks! You are doing awesome stuff. I might also do Ziffers adapter in the future to create motifs using integer notation in Sonic Pi … just as soon as i’m able to wrap my head around these new ideas :slight_smile:

1 Like

Excellent, you’re here! :grinning_face_with_smiling_eyes: Thanks again for your suggestions! Please let me know if you need any clarification on how the program works. I aim to make the code easy to understand, both for myself and for others. Towards that end, v0.4.0 is documented with YARD and is navigable with Solargraph. Learning modules and vanilla Ruby is making a marked improvement.