HOTKEYS CAN LOCK TO INSTRUMENTS: a new feature for the open-source project The Amanuensis: Automated Songwriting and Recording

in #utopian-io5 years ago

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?

There are two sets of hotkeys whose effects pertain to local instruments rather than a global setting. These are the hotkeys to change the track an instrument is on and those that change its sound. Traditionally these hotkeys have always simply affected the most recent instrument to send MIDI. Complications arise, however, when multiple players are using the system simultaneously. In such cases, it was very easy for a player to accidentally change another player's settings rather than their own.

Playtesting has made it very apparent that a solution was needed to resolve this issue. Now these instrument-specific hotkeys can be locked to one instrument in particular. Pressing Backtick (`) and then an instrument-specific hotkey will lock hotkeys from that source to the most recently played instrument. Using Tilde (~ or shift+`) in the same manner will remove the lock.

  • 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 present the work that was completed using images instead. Read the comments in those to get an idea of how the code works. I'll keep my description here about the process of writing that code.

These are the primary commits involved:

It was first necessary to investigate the methods by which the two sets of hotkeys in question were given information about which track/instrument to act upon. For track selection, this was through r controller and for sound selection, the ordinary updating of midiChannel with every MIDI note was being utilized.

controller was easier to manipulate as this was its only function. append_channel.maxpat was its source, so editing there was required. midiChannel is used many places, so rather than risk interference with other code a new send/receive pair was created, recall_sound_for_channel, which then administered to the same place in addition to the former midiChannel.

A dict was used to store the locks, as it is easily saved with the user's settings presets via the pattr system.

the new subpatcher hotkey_instruments in the append_channel.maxpat abstraction

The append_channel abastraction is used everywhere MIDI enters the system, so it catches any hotkey pitches, but this still leaves the actual hotkeys on the computer keyboard. A separate patcher was needed to handle these where they are detected in midiPorts.maxpat.

It quickly became apparent in testing that, although one could switch a lock to another instrument, there was no way to remove a lock completely. It was obvious that this was necessary and the second part of this commit handles that issue.


midiPorts.maxpat's new subpatcher, keyboard_hotkey_lock

Cleanup and commenting

GitHub Account

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

Sort:  

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

In such cases, it was very easy for a player to accidentally change another player's settings rather than their own.

I can imagine that being very frustrating, glad to see you managed to think of a solution and implement it. Have you done a lot of playtesting with multiple players?


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]

Not so much, but I'm trying to more and more. Jamming is really meant to be done with other people, so collaboration is really at the heart of what the system is supposed to be about. I've actually been dealing with health issues that have prevented me from using it to the fullest, but that's getting slowly better.

Thank you for your review, @amosbastian! Keep up the good work!

Hi @to-the-sun!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @to-the-sun!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

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

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64093.86
ETH 3123.80
USDT 1.00
SBD 3.94