本稿は9月にODSC Asiaで登壇した際のプレゼンテーション"MLOps for Musicians"にもとづいています
今年も残すところわずかとなりましたが、皆さんはいかがお過ごしでしょうか。私にとっては思いの外実りの多い一年となりました。その割にブログが更新できていないことを心残りに思い書き始めるという、例年通りのパターンです。
「機械学習の民主化をどこまで推し進めることができるのか」をテーマに、私もこれまで様々な業界におけるAI技術の導入を行ってきましたが、AI技術の事業・社会実装はますます進んで来ていて、MLOpsという言葉を聞くことも多くなってきました。精度の高い機械学習モデルを単発で作るのではなく、実世界において継続的にAIを利用していくための仕組みや技術もだいぶ成熟してきた感があります。2年前にConnpass上で立ち上げたMLOpsコミュニティーも3500人以上のメンバーまで成長し、関心の高さが伺えます。
モデルを使うユーザーのリテラシーが低ければ低いほどMLOpsの役割は大きくなりますし、AIを使っているということを意識せずとも高い価値を提供してくれるAIシステムを構築することこそ目指す姿と言えますが、9月にこのブログでも取り上げた画像生成AIにおいては、リテラシーレベルの全く無いユーザーでも、AIを使って極めて面白いアウトプットを得ることができる例を示しました。これによって生成AIは幅広いユーザーにものすごい勢いで使い倒され、プロンプトエンジニアリングというAIとの新しいインターフェースを生み出しました。
生成型AIを使った音楽パフォーマンス
Qosmoでは、特に音楽・サウンド分野での生成型AI技術に取り組んできました。音楽の生成型AIはテキストや画像分野における生成モデルほど決定的な結果がまだ出ていないのが現状とも言えますが、テキストや画像と比べ、表現におけるパフォーマンスの重要性が非常に大きく、リアルタイムなMLOpsの役割は他のモダリティーよりも高いと言えます。この分野の先駆者的存在であるQosmoの徳井さんは、AI DJというプロジェクトを発展させ、生成型AIを使ったリアルタイムパフォーマンスに取り組んできました。AIがMIDIで生成したドラムパターンとベースラインにその場で音をアサインし、それぞれをミックスする中で音楽的展開をつい繰り出していく。ここではAI DJのバージョン2として発表されたUbiquitous Rhythmのシステムを解説したビデオを貼ります(その後このプロジェクトは更に進化し、今年のMUTEKでその集大成を演じました。)
これまでAIによる音楽の生成の多くは特にデータや処理速度の問題からMIDIという符号ベースの学習・推論が行われてきましたが、ここ数年でそれも変わりつつあります。例えば、昨年IRCAMから発表されたRAVEやGoogleのMagentaチームから発表されたDDSPはCPUを使って48kHzという高品質でリアルタイムのオーディオ生成に成功しています。具体的にはこれらのモデルは、入力音を別の音に変換する音色変換(”Timbre Transfer”)を行うモデルで、入力音がどのような音でも、ターゲットとする音に変換するという面白い特徴を持っています。例えばこのようなバイオリンの入力音を:
RAVEモデルを使って人間の声に変えるとこのようなアウトプットを得ることができます
また、同じくバイオリンのこのような入力音を:
尺八を使って学習させたDDSPモデルを使うことで、このような出力音に変換できます
このようなスタイル変換技術は、音楽パフォーマンスにおける表現力を大きく広げる可能性を持っている一方で、AIモデルを生身のミュージシャンが使うためにはまだ高い障壁が存在し、リアルタイムのパフォーマンスで使えるインターフェースは存在していませんでした。

ミュージシャンがAIモデル操るためのMLOps
そこで私のチームでは、音楽制作・パフォーマンスを行うクリエーターが使う音楽制作プラットフォーム(DAWと呼ばれる)でリアルタイムにPyTorchのAIモデルを呼び出すためのプラグイン型アプリケーションのNeutoneを今年の頭から開発し、リリースしました:
このプラグインはオーディオのインプットに対してオーディオのアウトプットを行うあらゆるPyTorchモデルをDAWの中でリアルタイムに使うことができるという点において革新的ですが、「ミュージシャンのためのMLOps」を実現するために、難易度の高い開発も求められました。特に、深層学習モデルは学習時に前提としているバッファーサイズとサンプリングレートで推論を行うことしかできないという制約があるのですが、DAWやユーザー側の設定は必ずしもその設定で行われるとは限らないため、プラグイン側でそのギャップを埋めるだめのDSP処理を行う必要がありました。この辺はテーブルデータの機械学習モデルでも、推論時に特徴量の定義が変わってしまったというようなMLOps上の問題と同等です。
Neutoneは、プラグインの内部からクラウド上のモデルレポジトリーにある様々なモデルを切り替えて使える設計になっており、Qosmoからも音色変換モデルを中心に様々なモデルを作り公開してきました。特に喋り声、コーラス、お経など、様々な声に変換できるモデルなどはユニークな結果を得られることで定評を得ることができました。また、GPU環境でモデルを回すことのできる一部のハイエンドユーザーにモデルづくりの手法を手ほどきするためのワークショップなども今年のAIMC2022カンファレンスなどで複数回開催してきました。現時点では既出のRAVE及びDDSPのアーキテクチャーに基づくモデルがほとんどとなっていますが、これらのモデルの短所も見えてきました。これらのモデルはどんな入力音でも対象アウトプットに音色を変換してくれることを目的としていますが、出力音とあまりにもかけ離れた入力音だとあまり良い結果が得られないことなどです。この問題はMLOps的に言うと「データドリフト」に相当する問題ですが、入力音にピッチシフトやEQなどの前処理をかませることで、いくらかは改善できるということもわかってきました。
嬉しいことにこの取組は世界的にも注目され、オーディオ開発者の集う世界最大級のカンファレンスであるADCにおいて発表枠をもらうことができました。ロンドンで開催された今年のADC2022には、イギリスにいる開発メンバーのAndrew FyfeとChris Mitcheltreeがオンサイトで発表してくれました。また、日本で最大級のオーディオ・ビジュアル系の展示会であるInterBEEにおいては、Innovative Technologies 2022 という賞も受賞することができました。

プロフェッショナルミュージシャンとNeutoneの共演
このように、音楽という分野においてMLOpsを実現し、グローバルにも評価を得ることができたわけですが、最終的にはミュージシャンやクリエーターがNeutoneを使ってどのような表現をすることができるようになるのかこそが重要な結果です。Neutoneの表現における可能性を探るために、私達はニューヨーク在住のキーボードプレーヤーのBIGYUKIさんと一緒に制作を行ってきました。ヒップホップ・レジェンドのQティップなどとも共演したことのあるBIGYUKIさんは、初めて触ったときからその類まれなフィーリングでNeutoneを使いこなしてくれました。その時の様子がこちらです:
そして、12月にはついにこれまでのコラボレーションの集大成として、代官山UNITでのコンサートにてNeutoneを大きくフィーチャーしたパフォーマンスを実現してくれました。超満員の会場で多くの観客がBIGYUKIさんの演奏するNeutoneの音を聞き感動している姿は、MLOpsが実現する人間とAIの新たな可能性を示していました。

<English translation with help from DeepL>
This article is based on the presentation "MLOps for Musicians" I gave at ODSC Asia in September.
How are you in the last days of the year? For me, it’s been a surprisingly fruitful year.
I have been introducing AI technologies in various industries with my own objective of “How far can we push the democratization of machine learning?” The MLOps community that we launched on Connpass two years ago has grown to over 3,500 members, showing high level of interest in MLOps.
The lower the literacy level of the users of the models, the greater the role of MLOps, and the goal is to build an AI system that provides high value even if the users are not aware that they are using AI. The image generation AI discussed in this blog in September showed an example where even users with zero technical skills can use AI to obtain extremely interesting output. This has led to a tremendous uptake of generative AI by a wide range of users and has created a new interface to AI called prompt engineering as many have come to know already.
Musical Performance with Generated AI
At Qosmo, we have been working on generative AI technology, especially in the field of music and sound. It can be said that the advance of generative AI in music are not yet as conclusive as those of generative models in the text and image fields, but compared to text and images, the importance of performance in this form of expression is much greater, and the role of real-time MLOps is higher than in other modalities. Tokui-san at Qosmo, a pioneer in this field, has been working on real-time performance using generative AI, developing a project called AI DJ, in which he assigns sounds on the fly to AI-generated MIDI drum patterns and bass lines, and mixes them together to produce a musical development. Here is a video explaining the Ubiquitous Rhythm system, version 2 of AI DJ (the project has since evolved further and culminated in a performance at this year’s MUTEK ). It is interesting to hear him explain how demanding it is to play with this system as a co-creator.
Until now, most music generation by AI has been based on MIDI, a sign-based learning and inference method, especially due to data and processing speed issues, but this has been changing in the past few years. For example, RAVE announced by IRCAM last year and DDSP announced by Google’s Magenta team have succeeded in real-time audio generation at a high quality of 48kHz using CPUs. Specifically, these models perform timbre transfer, which is the conversion of one input sound into another, and have the interesting feature of converting any input sound into the target sound. For example, the input sound of a violin like this:
gets turned it into a human voice, using a RAVE model:
In another example, here’s another violin clip as an input:
which gets converted into the Shakuhachi, using a DDSP model:
While these style transformation technologies have the exciting potential to expand the expressiveness of musical performance, there are still high barriers to the use of AI models by live musicians, and interfaces that can be used in real-time performance have not existed.

MLOps for Musicians to Manipulate AI Models
Therefore, my team developed and released Neutone, a VST/AU plug-in application, at the beginning of this year to run PyTorch’s AI models in real-time on music production platforms (called DAWs) widely used by creators who make and perform music.
The plugin is innovative in that it allows any PyTorch model with audio-in/audio-out to be used in real-time within a DAW. However, to achieve “MLOps for Musicians,” we were also required to solve challenging problems. In particular, DL models are limited in that they can only make inferences for the buffer size and sampling rate specified during training, but the DAW and user settings are not always set to use these parameters, so the plug-in needed to perform DSP magic to fill the gap. This is equivalent to the common MLOps problem that also exists for table data, where the feature definitions changes during operation after the model’s been built.
Neutone is designed to load various models in the model repository in the cloud from within the plug-in, and Qosmo has created and released a variety of models, mostly timbre transfer models. In particular, models that can be converted to various voices, such as speech, chorus, and sutra, have gained a reputation for their unique results. We have also held several workshops including this year’s AIMC2022 conference to teach modeling techniques to some high-end users who can run models in a GPU environment. At the moment, most of the models are based on the RAVE and DDSP architectures, but we are starting to see the shortcomings of these models. These models aim to convert any input sound to the target output sound, but if the input sound is too far away from the output sound, they do not give good results. This problem is equivalent to the “data drift” issue in the MLOps sense, but we have found that we can improve it somewhat by applying pre-processing such as pitch shifting and EQ to the input sound.
We are happy to say that our efforts have attracted international attention and we have received a slot at ADC, one of the world’s largest conferences for audio developers. Andrew Fyfe and Chris Mitcheltree, two of our engineering members in the UK, presented on-site at this year’s ADC2022 in London. We were also able to win the Innovative Technologies 2022 award at InterBEE, one of the largest audio/visual trade shows in Japan.

Professional musicians using Neutone
We have achieved MLOps in the field of music and gained global recognition, but ultimately it is what musicians and creators can express themselves with Neutone that matters. To explore the possibilities of Neutone, we worked with New York-based keyboard player, Bigyuki. Bigyuki, who has worked with hip-hop legend Q-Tip and many others, showed us that he has a rare feel for Neutone from the first time he touched it. Here’s what he had to show:
Finally, in December, as the fruit of our long-running collaboration, he gave an extraordinary performance featuring Neutone at Daikanyama UNIT. The sight of the excited audience who packed the hall showed the creative potential for humans and AI that MLOps can realize.
