SPECIFIC NOTE SELECTION AND DELETION: a new feature for the open-source project The Amanuensis: Automated Songwriting and Recording

in #utopian-io6 years ago (edited)

Repository

https://github.com/to-the-sun/amanuensis

The Amanuensis is an automated songwriting and recording system aimed at ridding the process of anything left-brained, so one need never leave a creative, spontaneous and improvisational state of mind, from the inception of the song until its final master. The program will construct a cohesive song structure, using the best of what you give it, looping around you and growing in real-time as you play. All you have to do is jam and fully written songs will flow out behind you wherever you go.

If you're interested in trying it out, please get a hold of me! Playtesters wanted!

New Features

  • What feature(s) did you add?

This update implements a new method of deleting individual notes. They can now be selected visibly on the UI by navigating to them explicitly using the arrow keys. The selected note can then be deleted by using the delete key. This allows for much more deliberate editing than the existing removal method (using the backspace hotkey to remove the most recently played note on a given track). This exact precision allows the user to engage in a truer editing session in between writing sessions, a routine which leads to greater and greater refinement of the song.

These keyboard commands as well as all other keyboard hotkeys now perpetuate the song same as MIDI notes do, meaning that you can keep editing the song as it loops without worry of it ending on you for lack of user input.

  • How did you implement it/them?

If you're not familiar, Max is a visual language and textual representations like those shown for each commit on Github aren't particularly comprehensible to humans. You won't find any of the commenting there either. Therefore, I will do my best to present the work done in images instead. Read the comments there to get an idea of how the code works. I'll try to keep my description here about the process of writing that code.

These are the primary commits involved:

This feature update got strung out over a longer period of time and a larger number of commits due to certain issues I ran into which ultimately resulted in an entirely different approach being implemented in the latter half. In commit #3 I realized that the already established cue removal process required the entire cue in question to be passed to it, whereas my work thus far was only referring to them by scripting name. My solution was to hyphenate the cues (which are lists) into singular symbols to store, sort and manipulate them before they were selected for removal, at which point they were de-hyphenated and turned back into lists.

The problem with this method was that certain numbers were being truncated when represented symbolically rather than rounded and the cue in question was often no longer being identified. I explored multiple solutions but I won't go into them here as they all resulted in false starts. I finally settled on reworking the entire process into something cleaner and more informational: a master reference of cues that all parts of the program could use, thereby ensuring that the cues existed in only one central place and would be identical for any code requesting them.


the heart of this update is the newly created select_beat subpatcher and the coll ---cuesit references

Commit #9 and Commit #11

An essential breakthrough idea I came to in executing this new strategy was that I could avoid needing to constantly prune and check my list of cues to make sure it was still accurate if I simply checked each cue as required, ad hoc. This meant I could avoid dumping anything, which is always nice. The filtering of cues was something that was already being done (before they're played) so it was simply a matter of turning that subpatcher into a new abstraction and making some modifications to it so that it was more generalized (its output comes in multiple forms now, etc.) so it could be used in multiple places.


the revamped filter_cues, found in the above p select_beat

Commit #8 and Commit #15

The cues are added to the master reference by co-opting the addmessages just before they reached the seq~. It was also necessary to take into account the compiling of this reference upon import of a project.


p store_cues was created in p midipaletteof organism.maxpat

Commit #4, Commit #7, Commit #12 and Commit #13

An essential upgrade of this new feature is the UI element, which allows the user to know much more intuitively which notes they are dealing with before they delete them. These commits pertain to the appearance of the cursor that was implemented to select them. It was also animated to blink so that it catches the user's eye and is easily identifiable wherever it may lie.


these subpatechers were created and scripting is again used to alter and move the new live.lineobject, cursor

As mentioned, it's the arrow keys plus the delete key that operate this new feature. The up and down arrow keys rotate through tracks that have recordings in them while the left and right keys rotate through the individual notes in the selected track. The subpatcher in the screenshot below was created to handle this functionality.

Outside of this subpatcher a new send/receivepair, ---perpetuatewas created that takes input from any keyboard hotkey and gives it to the appropriate place in the code to mimic incoming MIDI. This "perpetuates" the song so it continues to loop rather than ending.


the select_beatsubpatcher in midiports.maxpat was created to handle user input from the keyboard

Cleanup and commenting

GitHub Account

https://github.com/to-the-sun

Sort:  

Thanks for the contribution, @to-the-sun!

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey @to-the-sun
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Get More Upvote - FREE

mooore.png

Coin Marketplace

STEEM 0.32
TRX 0.11
JST 0.034
BTC 66384.36
ETH 3272.25
USDT 1.00
SBD 4.27