---
# System prepended metadata

title: 'Milestone II, the project''s structure'

---

# Milestone II, the project's structure

Other inspirations:
- https://drive.google.com/file/d/17rI52ubf-zqB0Lq7QCkFg03612mwB1Ix/view?usp=sharing
- https://www.youtube.com/watch?v=6DVu9vF5J3Y
- https://www.youtube.com/watch?v=6LASz6HAL7E&ab_channel=RaminDjawadi-Topic
- https://www.youtube.com/watch?v=usNsCeOV4GM 
(all the song + 1:36, the transitions, the explicit dream-like structure/feel)
- https://www.youtube.com/watch?v=y6plvINudi8&ab_channel=cubebossanova
- https://youtu.be/8N768T-5Ujs?t=393
(as for reverse effects)
- https://www.youtube.com/watch?v=HtUH9z_Oey8 (intro/outro)

Distribution:
- Intro: **Bastien / Oscar**;
- Delirium: **Oscar**;
- Melancholy: **Alex**;
- Stagnation **Bastien**;
- Outro: **Alex**.

Useful links:
- https://stackoverflow.com/questions/10983462/how-can-i-produce-real-time-audio-output-from-music-made-with-music21 (PyGame, see marked :check: comment, stereo)
- again, for stereo: https://stackoverflow.com/questions/48631247/how-would-i-be-able-to-pan-a-sound-in-pygame
- https://www.kaggle.com/wfaria/midi-music-data-extraction-using-music21, common manipulations, good plots
- Gabriele's most recent notebook on generating sound waves (sine wave) with attack, etc. (thus we can make a reverse sounding thing by taking a sine wave with high attack and low everything else)

Ideas:
- reverse effects
- enum of emotions, where each emotion has coordinates to encode a notion of distance (coherence) with other emotions => map of feelings (visual, easy)

TODO:
- function that, from two objects that represent one part of the music, assembles them into one of those blocks (so we can combine measures, and recombine again, etc. everything to obtain, in the end, the final song); determine what such object would be (!!!)

Structure:
- Choose a tempo within range [60, 140]
- Split the song in 3 parts (intro, middle section, conclusion)
- Split the middle section in *n* sections, where *n* is a random integer from [4, 8]
- Choose the first section with a simple random choice
- Then, sequentially, choose the next section from a transition table (Markov Chains); the table will be encoded by the distances of the emotion it represents (**one emotion has one section**)
- Each section will have its own independent methods to generate as it pleases 16 measures, knowing which section preceeded it (this will allow potentially decisions for transitions)

Which emotions we will represent:
- delirium;
- melancholy;
- fear;
- stagnation (maybe the 0 vector of emotions, c.f. Satie's Gymnopédies).

## Introduction
Materials:
- Riser sound effect (sample), for the end;
- Keyboard/bell sound (*e.g.* glockenspiel, piano);
- reverse sounds

## Middle section
Materials:
- Sample(s) of guitar bend
- Custom sound fonts/virtual instruments/samples for each section

### Delirium
Probably the most famous attempts on translating dreams into music of the past century were part of the psychedelic genre, highly represented by British and American musicians such as The Beatles (starting from *Revolver*), Pink Floyd or The Doors. We believe that their music could fall into this category, because they express a manic happinness or some kind of inconsciousness, both of those being highly related to dreams. (Disclaimer: there was no drug use to create this part.) Their songs will have a high influence on the representation of this emotion.
To be more precise, these are the ingredients of this part:
- longer notes (in terms of rhythm), although the rhythm will *not* necessarily be "just" slow; this is important, because it will allow a higher contrast with respect to the "stagnation" part, and it is not a necessary characteristic of this emotion (and psychedelic songs such as *Tomorrow Never Knows* are not necessarily slow);
- pitch bends (*e.g.* guitar pitch bends);
- use of the mixolydian mode, which has a typical psychedelic sound (especially the I major - v minor chord progression);
- minor seventh chords, dominant seventh chords, minor seventh sus4 (*e.g.* A7sus4), major seventh chords;
- use of the lydian mode, which has a more ethereal sound;
- potentially augmented chords for a more bizarre sound;
- sounds (instruments and samples) with softer timbres;
- sounds processed with reverb/delay;
- instruments (with processing): piano, guitar, soft (sine wave?) synths, choir (+ own voice samples?)
What the listener should feel is plenitude, as if he were reaching the nirvana.

To generate: take one root note (probably as a function of the previous section), then choose for all 16 bars either (randomly) a I - v chord progression (mixolydian), or a I - V (lydian). Then, take some of the bars randomly, and replace the chord progression by another chosen at random, such as IV - iv - I.

Why not: alternate between 4/4 and other (maybe 5/4, 3/4) to create off effects

Inspi:
- Claude Debussy in general https://www.youtube.com/watch?v=A_g433nawnk

### Fear
Here, generate music hierarchically (c.f. second notebook, rhythm); make more frequent splits (kind of rule) from the left-hand side to make it gradually diminish, but let it lurk and become anxiety.

Alternate between random time signatures, to create an unsettling effect. Choose from [3/4, 12/8, 7/4, 15/16].

## Outroduction
Same as for intro, basically, but more filled, less empty. (So more sounds.) Abrupt ending with riser.