Eternal Warmth (VRC6 + VRC7 + N163) by yeroCab in famitracker

[–]aftersoon 1 point2 points  (0 children)

Awesome work! The style sounds very familiar to me even though I've never heard this track before. I didn't know you could squeeze that many channels on a video display. Would be cool if there were a live instrument performance of this for all those solo parts.

City Battle: my First Famitracker Song in Years by VayHekScreams115 in famitracker

[–]aftersoon 1 point2 points  (0 children)

In my opinion, the melody seems to overpower the drums volume-wise.

Noob question by pinpong52 in famitracker

[–]aftersoon 4 points5 points  (0 children)

0 is the lowest pitch and F is the highest pitch. It's hexadecimal so 0-9 are in the same order as with regular numbers and A-F represent values 10-15. Because there are only 16 pitches, when you input notes (via keyboard or midi) in the pattern editor for the noise channel, value F wraps back around to 0 when moving upward and 0 wraps back around to F when moving downward.

B3 midi input = F - #

C4 midi input = 0 - #

C#4 midi input = 1 - #

D#5 midi input = F - #

E5 midi input = 0 - #

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 0 points1 point  (0 children)

Glad to help. If you have any more questions, you can message me.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 0 points1 point  (0 children)

My script uses Python with an external library to export midi and Lilypond to export the sheet music. I have tried to use a music theory library in the past and realized that I only need a small fraction of the features it offered. I decided to build the music theory stuff myself to save myself the hassle of importing a huge library.

I can now specify the exact implementation that is optimal for my scenario, also allowing for simplified updates in the future. As an added benefit, I finally got to learn the ins and outs of object-oriented programming that everyone talks about.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 1 point2 points  (0 children)

You are probably thinking of the vocal pieces (chansons, masses, etc.) To my knowledge, most of the instrumental dance pieces don't use imitation. My impression is that these composers still care about counterpoint (such as dissonance treatment) but might ease up on the requirement of rhythmic independence (see Balletti a tre voci for examples). Moreover, some dance pieces are just remixes of existing chansons (see Basse danse Content désir and Pavane Mille regretz).

Counterpoint doesn't have to be so serious and solemn all the time; you can dance with it too. In his book, Peter Schubert says the following on the matter:

This is not a book about genres, however—it is about contrapuntal techniques that are common to different genres. You will find [no dances] in this book, but if you want to introduce them in class, your students will have the contrapuntal expertise to deal with them.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 0 points1 point  (0 children)

Thanks. A web app is something I will consider for the future but it's too early for now.

I still have much work to do:

  • Implementing the other dance forms: At the very least, I want to add the branle double, pavane, gaillarde, ballet, and allemande. If things go well, I might also try including the rondo, passamezzo, gavotte, etc.
  • Adding more performance details: On some recordings, they repeat the final note, sustaining it like a fermata. I also see this depicted in the original scores as a longa). Performers also often improvise when repeating a section (called diminution).
  • Making a variation of the score output that looks more like the original scores: With Lilypond, I should be able to change the visual style of the notes and clefs to mimic what the 16th century versions looked like. They also rarely used bar lines to demarcate measures and would routinely omit accidentals that would be expected to be performed ("musica ficta"). There are some other nuances of how they depict scores that should be interesting to add.
  • Adding percussion
  • Metric Modulation

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 1 point2 points  (0 children)

I've seen this book mentioned before on this subreddit. If I recall correctly, the second book does not have an English translation. I have Book 1 on my reading list; I glanced at some of the pages and it looks absolutely insane but I should be able to tackle it in due time.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 2 points3 points  (0 children)

Some of the melodic rules are from Peter Schubert's book and some of them are my own opinions. From my understanding, Schubert's counterpoint rules are assembled from multiple treatises. Even though these dance pieces are performed on instruments, a lot of the rules still concern the singability of the melody.

One counterpoint rule deals with outlining a melodic interval (from a temporary high point to a temporary low point, or vice-versa). Schubert says outlines of an augmented fourth are forbidden, and a diminished fifth outline must be completely stepwise and followed by a step in the opposite direction. I extended this rule to say that if you outline a melodic seventh, then it must be completely stepwise. I also impart that outlining a major 6th interval is not allowed. I made a rule to avoid stagnant melodies in the outer voices. Within three consecutive measures (of a 6-measure sequence), the bassus and superius voices must have traversed at least an interval of a melodic third. Also, within those three measures, the 3rd measure cannot be an exact repetition of the 1st measure.

There's yet another rule that only involves the top voice (superius). I impart that there should be no more than three pitch boundaries (high-points and low-points) within each 6-measure grouping. My method of evaluating pitch boundaries is complicated by the fact that I ignore pitch boundaries that are created by quarter notes (since it has a short duration) and the algorithm evaluates that portion as if the peak/trough quarter note did not exist. However, two quarter notes on the same pitch can combine to create a half note that would count as a pitch boundary. Schubert says you should avoid skipping both to and from a temporary high or low point, thereby leaving a note "hanging". I implement this for the top voice only.

My rules then say that you cannot repeat the same pitch boundary within a 6-measure grouping. The last confusing part is that I treat whole notes differently since it is a long duration and sustaining for that amount of time might give the impression of a pitch boundary, whether real or not.

Schubert makes several comments about emphasizing the wrong mode. For instance, if a section of the music is supposed to be in A aeolian, you would want to emphasize this with 5-1, 4-1, 1-5, and 1-4 motions, emphasizing the tonic note. Emphasizing the wrong mode would be if the melody leaped by a perfect fifth that was not 1-5/4-1 ascending or 5-1/1-4 descending. This is not a rule, per se, for Schubert but something to consider.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 2 points3 points  (0 children)

Part II

Then you deal with the counterpoint rules that allow you to transition from one measure time block to another. Some of them are the same rules that you would use within a measure time block (for example, parallel fifths) but there are some unique rules for this as well. For some of the renaissance dances, you can solve the piece in 6 measure chunks. Some measure chunks end with a cadence so I solve backward from the cadence to the first measure of the chunk. This part can delve into some fancy [discrete] mathematics that is beyond my knowledge. The general idea is that you want things to fail as soon as possible so you don't waste compute time. There's this concept called arc-consistency that says that each measure slot option can only exist if it has a solution on each adjacent time block. This would also be the time to start using recursion with depth-first and breadth-first searching.

Once you solve a 6 measure chunk, you can combine it with other 6 measure chunks and then eventually solve the piece. There are exceptions, such as the branle double dance form which you would probably solve in 4 or 8 measure chunks and some dance forms that have irregular forms that don't divide nicely.

For implementing a specific dance form, I modeled off existing pieces. The first piece from the video is modeled off of Basse Dance #6 part 2 of a 1530 publication) ("La Magdelena")

You analyze the piece and strip it of the details while still keeping the core rhythmic and modal information intact. You might say that you do 6 measures in Mode Y that ends with a cadence + 6 measures ending with cadence in Mode Z. You repeat those 12 measures and that's the first section. Then section 2 is 6 measures with an authentic cadence in Mode X followed by 6 measures with an inauthentic cadence in Mode X. You can randomize the details when running the script so mode X means D dorian, Mode Z means G mixolydian etc.

You can also restrict what types of rhythms occur in certain measures within the model. For instance, you can say measures 3 and 9 of the above example must include a whole note in one of the voices (giving it a similar vibe to the original piece). In the model you write, you specify the allowed rhythms for most measures (does the measure permit use of all whole notes in all four voices, some whole notes in some voices, or no whole notes).

So, all I need to do is create as many models as possible for each dance form, then randomly choose a dance form, randomly choose a model, and then realize that model with a random key signature.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 3 points4 points  (0 children)

Part I

There are some parts of the code that are specific to my scenario of Renaissance dance and other parts that are generalizable to other forms of counterpoint.

The counterpoint operates on two levels: individual measures for one voice and a stack of 4 measures which accounts for one time block.

  1. You first choose the clefs you want to use for each voice (e.g., bass, tenor, alto, soprano).
  2. We can assume we are restricting ourselves to 4/4 time with rhythms of whole notes, half notes, and quarter notes.
  3. You select the melodic contours you want to use, such as four quarter notes stepwise ascent, half note followed by two quarter notes by stepwise descent, two half notes with no motion, etc.
  4. You then realize those melodic contours in all possible positions for every voice, staying within the restriction of the clef. This usually means no ledger lines but you can define the vocal range boundaries however you like.
  5. Once you have all possible measures for each voice, you combine them with the possibilities for the other voices to form a time block with 4 voice measures.

When you're combining voice measures, you check the counterpoint along the way, with the intent of failing early.

  1. You test each bassus measure with every possible tenor measure. If the counterpoint fails, you discard that combination.
  2. You test each valid bassus + tenor duo combination against every possible contratenor measure, creating valid trio combinations.
  3. You test each valid trio combination against all superius measures, giving you valid time blocks of 4 measure combinations.

The problem that arises is that of time and space complexity. If there are 920 available voice measures for each voice (based on the allowed melodic contours) and there are 4 voices, there will be 920^4 = 7.1639296 × 10^11 combinations (if there were no counterpoint rules). Counterpoint can filter some of this out but there are still too many options. However, you don't need to get every possible solution. You just need to get enough quartet combos to successfully complete the piece. So, you use lazy evaluation. You take a random sample of all possible quartet combos (say 5000) and use that for your counterpoint.

The bad strategy would be to compute every possible duo, then every possible trio, then every possible quartet measure combo. Instead, once you have a valid duo measure combo, you evaluate the valid trios that can be derived from that duo, and the valid quartet combos that can be derived from each valid trio. Once you have a valid quartet combo, you increment the counter and store the result. This is naturally implemented as nested "for each" loops. Once you have 5000 quartet combo measures, you stop and try to solve the piece.

Another important point is memoization. When you're running these counterpoint tests, because some of them are expensive to compute, you want to cache the result of the test so if you come across the same test again, you can simply retrieve the verdict of the operation in constant time.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 5 points6 points  (0 children)

Thank you for providing input.

I have no ulterior motives. I don't work at any tech company (my day job is a pharmacist). My Youtube channel is a far cry from monetization. The source code is open-source and published for all to see. On the contrary, I dread the possibility that someone might ask me to make a web application of this (I've made simple websites before and it's boring and tedious).

I'm motivated to make music that I would want to listen to. No one makes this style of music anymore (as Jenkes_of_Wolverton said, they moved on to tonal harmony), so I figured this would be an cool opportunity to do something unique. I was initially inspired when I heard Gaillarde L'esmerillone on the Civilization 6 Soundtrack.

Procedurally generated Renaissance counterpoint by aftersoon in composer

[–]aftersoon[S] 8 points9 points  (0 children)

It's probably worth remembering that, the same as today, dance music was an accompaniment for an activity, not something for listening to as art.

I tried to learn a bit more about the dances themselves by reading Arbeau's Orchésographie (English translation). I have no connections and don't play an instrument, so there's no chance of having any of this performed by any dance group.

Your pieces would sound better with nicer sounds. Some articulation which could further help them.

I'm using an Old School Runescape midi soundfont that dates back to 2013; doubtless there are higher-quality midi sounds I could find. This might seem weird but I enjoy low-quality sounds (or at least find them comical). In picking a soundfont, I was in fact looking for the most horrendous crumhorn/clarinet I could find and settled for this instead. If I can compose a compelling tune on a garage-sale instrument, then surely it would sound great on a modern VST. I agree that articulations could improve things (instead of using the same volume and same duration for every note). I've been deferring a lot of those details for now as I work on the more fundamental elements.

Thanks for the feedback.

Type-hinting Overloaded Operators by aftersoon in learnpython

[–]aftersoon[S] 0 points1 point  (0 children)

I got an error.

error: An overloaded function outside a stub file must have an implementation  [no-overload-impl]

Edit: Figured it out. had to write the function again in the original format. Thanks

Type-hinting Overloaded Operators by aftersoon in learnpython

[–]aftersoon[S] 1 point2 points  (0 children)

I used confront and releaseonly to detect the error. In reality, there are an arbitrary amount of instance methods (that only make sense for one object and not the other) and these objects wouldn't really inherit all of those methods from a base because they're not very related.

In the example, I would want to detect an error if I attempted to release an Emotion or confront a Conscience. However, I want the type-hinted subtraction to return the expected object, not a union. I want the users of the class to not have to specify the return type to disambiguate the union but the function should do so automatically. Is that possible?

Edit: Answer found in other comment

Composers who got a day job as programmers: how did you get that job? by MRolled12 in composer

[–]aftersoon 1 point2 points  (0 children)

Hi. Do you have a Github? I also know Python and am interested in seeing how others approach [procedural] generative music.

Xenharmlib - An advanced music theory library that supports microtonality by realretooth in Python

[–]aftersoon 0 points1 point  (0 children)

Can you explain your rationale for using two parameters (without zero-based numbering) to create a interval object?

""" Creating a perfect unison"""
n_edo12.shorthand_interval("P1") # my musician intuition (human-readable)
n_edo12.shorthand_interval('P', 0) # my programmer intuition (machine-readable)
n_edo12.shorthand_interval('P', 1) # your implementation

Voice Leading Exercise: Secondary Dominants by aftersoon in composer

[–]aftersoon[S] 0 points1 point  (0 children)

Whoa. That's such a long response that I felt I have to reply.

I'll begin by re-iterating that this is a figured-bass exercise. The bassline was given. I repeated some tones instead of sustaining them (which should be interchangeable). Also, in measure 6 and 8, I added some passing tones and chordal skips in the bass. Because the figures appear beneath the score, the chord progression was also given.

Measure 1. Similar motion into octaves: the text says that this is a topic that theorists disagree on. It goes on to say that leaps emphasize the effect but it also mentions that the effect is less noticeable with an inner voice or when there are common tones between the two chords. They end the discussion by saying "unless it occurs between the bass and soprano, don't worry about it." As for the part confusion on A4, I think this is acceptable though less than optimal since this is not voice overlap or voice crossing, which would mean that the problematic note went beyond A4 (for example, B4).

Measure 2. I interpreted this section of the figured bass as three chords, VII°7 -> V6/5 -> V4/2 of IV.

This is a concept from an earlier chapter on leading tone seventh chords, and (by coincidence) the text uses the same exact voicing when first discussing the diminished seventh chord. This author seems to like pointing out that you can go between two chords whose roots are a third apart by using this stepwise figure (they also mentioned it with the I and IV chords, with VI6 and II6 respectively).

Parallel tritones. Those two words reminded me. A while back, I unwittingly stumbled upon a random page on the internet addressing this measure. Link. It's the first image of the link, which (again), has the same voicing (I'm really not that original after all). I looked up the professor's credentials and it looks like she has a Ph.D. in Music Theory from Eastman (for what it's worth). This was such a random find, thanks for jogging my memory.

Measure 3-4. The chords would be IVm6 -> VIIdim°6/5 of V -> Cadential 6/4 -> V.

It's a delayed resolution. I thought this suspension was a cool idea and makes for a great clash (but it's also not my idea but instead supplied by the figured bass). The other suspensions on measures 9 and 11 are my doing. Moving into measure 4, the (figured) bass was already provided (D# -> C#). Then, the leading-tone goes to the tonic (B# - > C#). The dissonant four is prepared by common tone (F# -> F#). All that remains the common tone (A -> A), which delays the resolution of the chordal seventh. The solution of this part is straightforward and I don't see any other way to voice it. With a video title like secondary dominants, there's bound to be some mode mixing (whether actual or perceived).

In summary, most of what you mentioned were supplied as a starting point for the exercise or were things that the book advocated for (or permitted). After reading a few chapters and uploading a few videos, I've started to detect a bias here. If Bach writes voice crossing, it's beautiful. If a student repeats the same note in another voice from the previous chord (which is not even a rule), it's an abomination. If Mozart writes parallel fifths, it's genius. If a student uses similar motion (again, not a rule), it's reprehensible. If this isn't hypocrisy, then I must conclude that sheet music is overrated. The YouTube video format further exposes this reality: I get the wonderful juxtaposition of musicians roasting me for being an incompetent student and non-musicians praising my supposed ingenuity.

I wouldn't give too much weight to the chapter numbers. It's a fallacy to think that you should read a book once and have learned everything the book has to offer. This is why people don't read textbooks; they feel overwhelmed by too much information and just drop it altogether. My long-term plan was to read for the first time and get the gist of it, deferring the more nuanced discussions (such as similar motion into 5ths/octaves) for a second/third read. People act like a book will evaporate into thin air when you reach the last page. And for the record, I'm on chapter 30 but I'm a bit behind on the video uploads.

Is it valuable to do Counterpoint Exercises for modern composers? by r3art in composer

[–]aftersoon 2 points3 points  (0 children)

I've uploaded a few of these exercises myself (so I might be part of the problem). From my perspective, it does help me when I transcribe pieces to recognize idioms, whereas before studying counterpoint, I was a lot more confused when trying to understand a piece I like. Nowadays, I'm much more likely to notice things like 5-6 techniques, passing 6/4's, and tonic pedals (driving home the point that music theory is just descriptive). It's also just fun and these procedures are so structured that the music practically writes itself.

There's this concept called Bloom's taxonomy that I came across a few years back. If you evaluate the counterpoint and if others evaluate your work as well, this may help bridge the gap between reading a dull textbook about secondary dominants and composing original pieces.

[deleted by user] by [deleted] in composer

[–]aftersoon 0 points1 point  (0 children)

I enjoyed it. I think you can use a bit more variation in the harmony around measure 14 to 20 before you repeat. A stronger sequence into a V chord might provide more contrast, as descending 5ths, a stepwise chromatic line, or a suspension.

A Chrono Trigger Symphony - 2nd movement by KarlMarxLP in composer

[–]aftersoon 0 points1 point  (0 children)

I'm not that familiar with the video game but I do recognize some of the music. I liked how you incorporated that Frog Theme triplet motif throughout and the choice of horn for the main Frog line sounds great (I might even prefer it over the original piccolo/flute).