Placeholder Image

字幕表 動画を再生する

AI 自動生成字幕
  • Hey what's up everybody, I'd like to welcome you to another audio programmer tutorial.

    皆さん、こんにちは!オーディオ・プログラマーのチュートリアルへようこそ。

  • And in this tutorial we're going to talk to you about the Juice audio processor class.

    このチュートリアルでは、Juiceオーディオプロセッサーのクラスについて説明します。

  • The audio processor class is the way that you can write your plug-in code once but be able to turn your plug-in code into all the different formats that you're able to deploy for plugins such as VST3, AU, and AEX, and also be able to do those plug-ins on separate operating systems such as Windows and Mac OS.

    オーディオ・プロセッサー・クラスは、プラグイン・コードを一度書くだけで、VST3、AU、AEXといったプラグイン用にデプロイできるすべての異なるフォーマットにプラグイン・コードを変換でき、WindowsやMac OSといった別々のオペレーティング・システムでプラグインを実行できるようにする方法です。

  • So we have two objectives for this tutorial.

    このチュートリアルには2つの目的がある。

  • The first objective is that we're going to dissect the Juice audio processor class.

    最初の目的は、Juiceオーディオプロセッサーのクラスを分解することだ。

  • I've been doing Juice tutorials since 2017 and I'm embarrassed to say that I never really took the time until recently to dig into the audio processor class and really truly look at what it does and what each function is doing.

    私は2017年からJuiceのチュートリアルをやっていますが、恥ずかしながら、最近までオーディオプロセッサーのクラスを掘り下げて、それが何をしているのか、それぞれの機能が何をしているのか、本当に時間をかけて見たことがありませんでした。

  • So I'm going to do that with you today and show you some of the insights that I've gained along the way.

    そこで今日は、私がその過程で得た洞察のいくつかをお見せしようと思う。

  • The second objective is that I'm going to show you the Juice audio processor class alongside the CMake file that we did in the last tutorial and show you how those two things relate to each other and how the configuration of your CMake file relates to the code that is actually generated for the Juice audio processor class.

    つ目の目的は、前回のチュートリアルで行ったCMakeファイルと一緒にJuiceオーディオ・プロセッサ・クラスをお見せし、この2つがどのように関係し合っているのか、CMakeファイルの設定がJuiceオーディオ・プロセッサ・クラス用に実際に生成されるコードとどのように関係しているのかをお見せすることです。

  • When one of my mentors showed me how these two files relate, it really helped me expand my mind map on how build systems and generated code actually relate to each other and helped me level up my skill set in a major way and I hope it levels up your skill set as well.

    私のメンターのひとりが、この2つのファイルがどのように関連しているかを教えてくれたとき、ビルド・システムと生成されたコードが実際にどのように関連しているのか、私のマインドマップを広げてくれた。

  • If you're ready to take that next step into audio plug-in development, I invite you to check out our latest book, The Complete Beginner's Guide to Audio Plug-in Development.

    オーディオ・プラグイン開発への次のステップを踏み出す準備ができたら、ぜひ最新刊『オーディオ・プラグイン開発完全入門』をご覧ください。

  • This has everything that you need to know to build your first audio plug-in, over 450 pages, and you can get it both on physical copy via Amazon and via ebook on our website theaudioprogrammer.com.

    この本には、初めてのオーディオ・プラグインを作るために必要な知識がすべて載っており、450ページ以上あります。アマゾンで物理的に購入することも、私たちのウェブサイトtheaudioprogrammer.comで電子書籍として購入することもできます。

  • This video is also brought to you today by our sponsor, JetBrains.

    また、このビデオはスポンサーのジェットブレインズから提供されたものです。

  • So I've been using their Sealion IDE for quite a while now and along with their great cross-platform experience of being able to switch back and forth between Windows and Mac and being able to find everything easily because the experience is largely the same.

    WindowsとMacの間を行ったり来たりできる素晴らしいクロスプラットフォーム体験とともに、体験はほとんど同じなので、すべてを簡単に見つけることができる。

  • I've also been enjoying their integrated CMake support.

    統合されたCMakeのサポートも気に入っている。

  • It's been a lifesaver for me because I'm not an expert on build systems and being able to just double click on the CMake file and have it open up my project is a lifesaver.

    私はビルドシステムの専門家ではないので、CMakeファイルをダブルクリックするだけでプロジェクトを開くことができるのは助かります。

  • It also has the ability to be able to debug CMake files, which is really awesome.

    また、CMakeファイルをデバッグできる機能もあり、これは本当に素晴らしい。

  • I really love that feature.

    あの機能は本当に気に入っている。

  • Be sure to check out JetBrains and Sealion on the link below.

    以下のリンクからJetBrainsとSealionをぜひチェックしてほしい。

  • And without further delay, let's get started.

    さっそく始めよう。

  • Okay, so here we are in our project and one thing that you'll notice is that I'm in my CMake file rather than having the ProJuicer.

    ProJuicerを使うのではなく、CMakeファイルを使うということです。

  • And with that, I'm going to make a very small announcement, which is that moving forward, we're going to be doing our tutorials using CMake rather than the ProJuicer.

    ということで、これからProJuicerではなくCMakeを使ってチュートリアルを行うことになりました。

  • Now, I think that the ProJuicer is great if you know barely anything about C++ and about Guice and you're just starting to get off the ground and write some code and write your first plugin.

    ProJuicerは、C++やGuiceのことをほとんど知らなくて、これからコードを書いたり、最初のプラグインを書いたりしようと思っている人には最適だと思う。

  • But I think once you start really getting serious about C++ development that you're probably going to want to start switching towards using a build system like CMake.

    しかし、C++開発に本格的に取り組み始めたら、おそらくCMakeのようなビルド・システムを使う方向に切り替えたくなると思う。

  • This is a challenging step and it's been challenging for me.

    これは挑戦的なステップであり、私にとっても挑戦的だった。

  • However, one thing that I will say is having been around a couple major music tech companies that all of them use something like CMake or another build system for generating their projects.

    ただ、ひとつだけ言えるのは、いくつかの主要な音楽技術会社にいたことがあるが、どの会社もCMakeやその他のビルド・システムを使ってプロジェクトを生成していた。

  • None of them use the ProJuicer.

    誰もプロジューサーを使っていない。

  • Okay, so if you want to get into this and start doing this for a living, I would highly advise or recommend that you start learning build systems and learning at least the basics about them.

    もし、あなたがこの仕事に就き、生活のためにこの仕事を始めたいのであれば、ビルド・システムを学び、少なくともその基本を学ぶことを強く勧める。

  • And that's what I'm trying to do as well.

    そして、それは私がやろうとしていることでもある。

  • So that's why we're working with CMake right now.

    だから今、CMakeを使っているんだ。

  • So I know that this transition from the ProJuicer to CMake will feel a little bit intimidating for some.

    だから、ProJuicerからCMakeへの移行は、ある人たちにとっては少し気後れするものだと思う。

  • But don't worry, we're going to take it slow and I'm going to try to show you every step of the way how everything is happening.

    でも心配しないで、ゆっくりやっていくつもりだし、すべての段階をお見せしようと思っている。

  • So first thing I would say is watch the last tutorial because that's how we actually created the CMake file that we're seeing here right now.

    というのも、このチュートリアルで実際にCMakeファイルを作成したからです。

  • So the second thing I'm going to show you is something that I learned when I first started working with CMake that really helped me switch on the light in terms of what build systems do and what their intention is.

    そこで2つ目に紹介するのは、私がCMakeを使い始めた頃に学んだことで、ビルド・システムが何をするのか、そしてその意図は何なのかという点で、私に光を与えてくれたものだ。

  • So if we scroll down here a little bit, what I'm going to show you is that in this juice add plugin function that we have a couple configuration options.

    ここで少し下にスクロールすると、このjuice add plugin関数にいくつかの設定オプションがあることがわかります。

  • Okay, so the reason for this is let's just take the code and put it aside for a second.

    さて、この理由は、コードをちょっと脇に置いておこう。

  • And let's just say that we were just having a conversation about creating a plugin.

    そして、ちょうどプラグインを作ろうという会話をしていたとしよう。

  • So one of the first questions that we would probably ask is, well, what kind of plugin do we want it to be?

    そこで私たちが最初にする質問のひとつは、どんなプラグインにしたいのか、ということだろう。

  • Do we want it to be an audio effect?

    オーディオ効果にするのか?

  • Do we want it to be a synthesizer?

    シンセサイザーにするのか?

  • Do we want it to be some type of midi effect?

    ある種のミディ・エフェクトにしたいのだろうか?

  • These are some of the first questions that we would ask ourselves, right?

    これらは、私たちが自問自答する最初の質問のいくつかだろう?

  • And so this is what I would call or what would technically be called global configuration.

    そして、これがグローバル・コンフィギュレーションと呼ばれるものだ。

  • Okay, what do we want this project to be?

    では、このプロジェクトをどうしたいのか?

  • So you can see that here with the CMake file that these global configurations are here on the front, meaning on the CMake file itself, that we can change these to true or false.

    CMakeファイルでは、これらのグローバル設定が前面、つまりCMakeファイル自体にあり、これらをtrueまたはfalseに変更できることがわかります。

  • So think of these as options or buttons that we could switch as developers.

    つまり、これらは開発者として切り替えられるオプションやボタンのようなものだと考えてほしい。

  • Now, what happens is that these actually affect what happens on the code in the project that's actually generated.

    さて、何が起こるかというと、これらは実際に生成されるプロジェクトのコード上で起こることに影響する。

  • So if we go to skipping ahead a little bit into some of the functions into the plugin processor.cpp, we have this function here that says accepts midi, right?

    プラグイン・プロセッサー.cppのいくつかの関数を少し先に読み飛ばすと、ここにaccepts midiという関数がありますね?

  • And we can see that this is currently set to return false, okay?

    そして、これは現在falseを返すように設定されていることがわかる。

  • Because we see that this return true is kind of shaded and that it's currently returning false.

    というのも、このtrueを返す部分が陰になっており、現在はfalseを返していることがわかるからだ。

  • So it's saying that we do not want midi input.

    つまり、MIDI入力はいらないということだ。

  • That correlates directly with what we have here.

    それは、ここにあるものと直接的に関連している。

  • This option needs midi input.

    このオプションにはMIDI入力が必要です。

  • Now, if I set this to true, and then if I regenerate the CMake file, rerun the CMake file, for people who are not using CLion, you would need to use the CMake command, which I believe is CMake-B, builds-G, and then whatever IDE that you're using.

    CLionを使っていない人は、CMakeコマンド(CMake-B、builds-G、そして使っているIDE)を使う必要がある。

  • Okay, so now we come in here into access midi, and we see that that has now returned true.

    さて、ここでアクセス・ミディに入り、trueが返されたことを確認しよう。

  • So we've just kind of hit a button or hit a switch there, and that has actually switched things.

    だから、あるボタンを押したり、あるスイッチを押したりして、実際に状況を切り替えたんだ。

  • So this is a great way for us to be able to create a convenient interface for the developer to be able to change their configuration of their plugin or of their project in a way that before they actually even generate the project.

    だからこれは、開発者が実際にプロジェクトを生成する前に、プラグインやプロジェクトの設定を変更できる便利なインターフェイスを作ることができる素晴らしい方法なんだ。

  • So that is what the intention of using CMake really is, okay?

    これがCMakeを使う本当の意図なんだ。

  • So if I take this and I turn this back to false, and then if I come here over back over here into this, and then I hit this refresh my CMake file, you'll see that this will change back to false.

    そこで、この部分をfalseに戻し、この部分に戻ってCMakeファイルを更新すると、falseに戻ることがわかります。

  • Okay, and see how that switched?

    それで、どう切り替わったかわかる?

  • Okay, so that was something that was very simple, but also a very big revelation for me.

    なるほど、それはとてもシンプルなことだったが、僕にとってはとても大きな発見でもあった。

  • Now, I know what some of you are thinking.

    さて、皆さんの中には何を考えている人もいるだろう。

  • Josh, why can't you just put this option directly in the header file or in the CPP file?

    ジョシュ、なぜこのオプションをヘッダーファイルかCPPファイルに直接書けないんだ?

  • Why can't you just have some sort of option or some sort of bull that you put in here?

    なぜ、ここに何らかのオプションや強気で入れることができないんだ?

  • And the reason is going back to that architectural question of, okay, these are what we would call global configurations, configurations of the project just as a whole, okay?

    そして、その理由はアーキテクチャー的な質問に戻るのだが、これらはグローバル・コンフィギュレーションと呼ばれるもので、プロジェクト全体のコンフィギュレーションなのだ。

  • And that from an architectural standpoint, it would make more sense to have these options within the CMake file, which is kind of the front interface for the entry point for the developer of what they want this project to be, rather than having it hidden in an individual header file or CPP file, okay?

    アーキテクチャー的な観点からは、これらのオプションを個々のヘッダーファイルやCPPファイルに隠すよりも、開発者がこのプロジェクトをどうしたいかというエントリーポイントのフロントインターフェースのようなものであるCMakeファイル内に持つ方が理にかなっていると思うのですが、いかがでしょうか?

  • So that's the reason that it's done that way and why developers choose to do it.

    だから、そのようなやり方をしているのであり、開発者がそれを選択する理由なのだ。

  • So that, I hope, helps reveal some of the light or shed a little bit of light on why we use build systems like CMake and why we use these global configurations rather than putting them into the code themselves.

    なぜCMakeのようなビルドシステムを使うのか、なぜコードそのものに設定を入れるのではなく、このようなグローバルな設定を使うのか、その理由の一端が明らかになったり、少しは光が差したりすることを願っている。

  • So I hope that was helpful for you.

    というわけで、お役に立てたなら幸いです。

  • Okay, moving along, here we are in our header file, which is the audio plugin audio processor, and this is inheriting from a juice audio processor.

    オーディオ・プラグイン・オーディオ・プロセッサのヘッダーファイルで、juiceオーディオ・プロセッサを継承しています。

  • Now, we have a few pure virtual functions that we've been implementing here, and we can tell that they're pure virtual functions because they have this override keyword, okay?

    さて、ここで実装してきた純粋仮想関数がいくつかあるが、純粋仮想関数であることがわかるのは、このoverrideキーワードがあるからだ。

  • That's how you know that it's pure virtual function.

    それが純粋な仮想機能であることを知る方法だ。

  • If we go over to the juice documentation, the way that you know that it's a virtual function is if the function has this equals zero after the function name, okay?

    ジュースのドキュメントを見ると、その関数が仮想関数であることを知るには、関数名の後にイコール・ゼロがあればいい。

  • So that's how you know that this is a function that if you're inheriting from an audio processor class, you need to provide implementations of each one of those functions, okay?

    だから、オーディオ・プロセッサー・クラスを継承する場合は、これらの関数の実装を提供する必要があるんだ。

  • I know that that's a general C++ thing, but I want to try to make this digestible for people who are just getting started, okay?

    それはC++の一般的なことだとわかっているが、これから始めようとしている人たちのために消化しやすいようにしたいんだ。

  • So be sure to check out pure virtual functions if you're not familiar with that concept.

    そのため、その概念に馴染みがない場合は、純粋仮想関数を必ずチェックしてほしい。

  • Okay, so what we're going to do is give you a whistle stop tour of what the juice audio processor is and what each function does.

    さて、ではこれから、ジュース・オーディオ・プロセッサーがどんなもので、それぞれの機能がどんな働きをするのか、順を追って説明しましょう。

  • This is not going to be really comprehensive.

    これは本当に包括的なものではない。

  • This is going to be very general, but hopefully this should give you some insight into some things that you may not have known about before.

    非常に一般的な話になってしまうが、これまで知らなかったことを知るきっかけになれば幸いだ。

  • I know that I've learned a lot in creating this tutorial, so hopefully it's helpful for you.

    このチュートリアルを作るにあたって、私は多くのことを学んだ。

  • Okay, so let's get started.

    よし、では始めよう。

  • So the first thing that we have here is the constructor.

    まずコンストラクターだ。

  • So this is what's called when the plugin is first created.

    つまり、これはプラグインが最初に作成されたときに呼び出されるものだ。

  • And what happens is that it creates this juice audio processor.

    そして何が起こるかというと、このジュース・オーディオ・プロセッサーができるのだ。

  • And then in here is this piece of code with some macros that look intimidating at first, but if you break it down, you can see that it's not very intimidating at all, okay?

    そして、このコードにはいくつかのマクロがあり、最初は威圧的に見えるが、分解してみると、まったく威圧的でないことがわかるだろう?

  • So here we have these variables that we created with the CMakeLists.

    CMakeListsで作成した変数がここにある。

  • Let me go back to CMakeLists here very quickly.

    ここでCMakeListsの話に戻ろう。

  • So remember, we have these global configurations like needsMIDI input, needsMIDI output, and so on.

    needsMIDIインプット、needsMIDIアウトプットといったグローバルなコンフィギュレーションがあることを思い出してほしい。

  • So that's all these are here, okay?

    ここにあるのはこれだけだよ。

  • So it's just using those configurations to see if it's a MIDI effect or if it's a synth.

    つまり、MIDIエフェクトかシンセかを確認するために、これらの設定を使用しているだけなんだ。

  • And depending on what these choices are, then it's going to create some inputs and outputs and give those to our audio processor to create our audio output and input, right?

    そして、これらの選択肢に応じて、いくつかの入力と出力を作り、それらをオーディオ・プロセッサーに渡して、オーディオ出力と入力を作るんだ。

  • So if it's not a MIDI effect, right?

    つまり、MIDIエフェクトでなければいいんだね?

  • So MIDI effect would take MIDI input and do something with it.

    つまり、MIDIエフェクトはMIDI入力を受けて何かをする。

  • So if it's not a MIDI effect, and if it's not a synth, then it's saying that we want an audio input that would create stereo input, okay?

    つまり、MIDIエフェクトでもなければ、シンセでもないのなら、ステレオ入力を作るオーディオ入力が欲しいということなんだ。

  • And that if we wanted a stereo output, that that's what would happen.

    ステレオ出力が欲しければ、そうなるだろうと。

  • So if it's a MIDI effect, obviously you would want it to have a MIDI output.

    MIDIエフェクトなら、当然MIDI出力が欲しいですよね。

  • But if it's not a MIDI effect, then you would want it to have an audio output.

    しかし、MIDIエフェクトでないなら、オーディオ出力が欲しいだろう。

  • So that's what's happening there is just creating your inputs and outputs for your plugin.

    そこで起こっているのは、プラグインの入力と出力の作成だ。

  • And then of course, here in this function, this constructor function, you would have any type of initialization code that you would need to start up other classes, to start up other things that need to be initialized with some variables.

    そしてもちろん、この関数(コンストラクタ関数)には、他のクラスを立ち上げたり、変数を初期化する必要のある他のものを立ち上げたりするために必要な、あらゆる種類の初期化コードがある。

  • Next, we have our destructor.

    次はデストラクタだ。

  • So this is typically what we would use that on destruction of this audio processor, which would typically be when somebody deletes your plugin, then this destructor would clear out any, you would use that to clear out any memory, any resources, any processes that need to be done before your plugin can be destroyed.

    誰かがプラグインを削除したときが典型的な例だが、このデストラクタは、プラグインを破棄する前に必要なメモリやリソース、処理をすべて消去するために使う。

  • Things like that would typically happen here.

    そういうことは普通、ここで起こることだ。

  • These next ones, get name, accepts MIDI, produces MIDI, is MIDI effect.

    次のものは、名前を取得し、MIDIを受け入れ、MIDIを生成し、MIDIエフェクトです。

  • All of those are direct correlations to those global configurations that we created here in the CMake file.

    これらはすべて、CMakeファイルで作成したグローバル・コンフィギュレーションに直接関係している。

  • Needs MIDI input, needs MIDI output, and is MIDI effect and so on.

    MIDI入力が必要、MIDI出力が必要、MIDIエフェクトが必要、などなど。

  • Okay, so going down a little bit further, we have this get tail length seconds.

    では、もう少し下に降りて、尾の長さを秒単位で測ってみよう。

  • So sometimes when you're using a plugin in a DAW, when you stop processing audio through the plugin, when you stop the DAW, then typically sometimes if it's like a reverb or it's the delay, maybe you want that delay or that reverb to continue ringing out until it's finished, until it reaches silence.

    DAWでプラグインを使っているとき、プラグインを通したオーディオ処理を止めたとき、DAWを止めたとき、通常、リバーブやディレイのようなものであれば、ディレイやリバーブが終わるまで、あるいは無音になるまで鳴り続けさせたいことがあります。

  • Sometimes you want the audio to stop right away when your plugin is stopped.

    プラグインを停止したときに、オーディオをすぐに停止させたいことがあります。

  • Okay, so if you want it to stop right away, then you would just leave that at 0.0 seconds.

    すぐに停止させたいのであれば、0.0秒のままでいい。

  • That means that even if it's a delay plugin or a reverb plugin, that when you hit stop, that the delay or the reverb stops.

    つまり、ディレイ・プラグインやリバーブ・プラグインであっても、stopを押すとディレイやリバーブが止まるということです。

  • If you want it to continue playing after audio is done processing through the effect, after you've stopped the DAW, then you would change this to a different number.

    DAWを停止した後、オーディオがエフェクトで処理された後も再生を続けたい場合は、この数値を別の数値に変更します。

  • These next few functions like get num programs, get current program, set current program, get current program name, change program name, all of these are referring to presets.

    次のいくつかの関数、例えば、ナンバー・プログラムの取得、カレント・プログラムの取得、カレント・プログラムの設定、カレント・プログラム名の取得、プログラム名の変更、これらはすべてプリセットを参照している。

  • So this is referring to a preset if it's loaded or if you want to get what the preset name is.

    つまり、これはプリセットがロードされている場合、またはプリセット名を知りたい場合に参照する。

  • So typically your presets will be stored in some type of a vector with what you want each parameter to be set at, and that's how that would be stored.

    だから通常、プリセットは、各パラメーターを設定したい値をある種のベクターに保存しておく。

  • And so all of these are just referring to loading them, getting them, changing the name of your plugin, of your preset rather, and so on.

    これらはすべて、プラグインをロードしたり、取得したり、プラグインの名前を変更したり、プリセットの名前を変更したりすることを指している。

  • Going down a little bit further, we have this function called prepare to play.

    もう少し下ると、プレーの準備という機能がある。

  • So this is one of the more important functions that you have here in the audio processor.

    これはオーディオプロセッサーでより重要な機能のひとつです。

  • It's probably one of the top two or three most important functions.

    最も重要な機能のトップ2、3には入るだろう。

  • So anytime that you're processing a, you're doing some type of digital signal processing, so let's say that you have a reverb or you have a delay and you've created an algorithm or you're sourcing an algorithm from somewhere, typically you'll have some type of function that's called either prepare or reset or prepare to play.

    例えば、リバーブやディレイを使ってアルゴリズムを作成したり、どこかからアルゴリズムを調達したりする場合、通常、prepare(準備)、reset(リセット)、prepare to play(再生準備)と呼ばれる関数があります。

  • And what this does is it allows you to take the sample rate and the buffer size of where the DA, of what the DAW is processing and pass it into these individual algorithms.

    DAWが処理しているサンプルレートとバッファサイズを、それぞれのアルゴリズムに渡すことができる。

  • Okay, so for example, let's say that we have a one second delay algorithm, right?

    では、例えば、1秒遅れのアルゴリズムがあるとしますよね?

  • So your delay algorithm needs to know whether the sample rate is 44,100 samples per second or 48,000 samples per second, because that will determine whether that delay algorithm needs to process 44,100 samples or 48,000 samples to create that delay accurately.

    つまり、遅延アルゴリズムは、サンプルレートが44,100サンプル/秒なのか48,000サンプル/秒なのかを知る必要がある。

  • Okay, so that's why any DSP algorithm, typically you'll need some sort of prepare or reset or prepare to play algorithm that is implemented here in prepare to play.

    DSPのアルゴリズムには、通常、何らかの準備やリセット、あるいは再生準備のアルゴリズムが必要になる。

  • Now, another thing is to think about or to know about is when this function is actually called within the plugin.

    さて、もうひとつ考えておくべきこと、あるいは知っておくべきことは、この関数がプラグイン内で実際に呼び出されるタイミングだ。

  • So depending on the DAW, sometimes these are called at different times, but typically what'll happen is that when you create a plugin in your DAW, it will, I think most of them, all of them perhaps call prepare to play when the the plugin is getting ready to start processing audio again.

    DAWによって、これらの呼び出されるタイミングが異なることもありますが、一般的に起こることは、DAWでプラグインを作成すると、プラグインがオーディオ処理を再開する準備をするときに、ほとんどのプラグイン、おそらくすべてのプラグインがprepare to playを呼び出します。

  • So for example, when the user hits the space bar to start playing audio through the plugin.

    例えば、ユーザーがスペースバーを押すと、プラグインを通してオーディオの再生が始まります。

  • So let's say, and the reason for this is, let's say that the user has been playing audio through the plugin and the sample rate is 44,100 and they've been playing audio through the plugin and then they stop it.

    例えば、ユーザーがプラグインを通してオーディオを再生していて、サンプルレートが44,100で、プラグインを通してオーディオを再生していて、それを止めたとします。

  • Let's say for whatever reason, they decide to change the sample rate to 48,000 samples per second.

    何らかの理由でサンプルレートを48,000サンプル/秒に変更することになったとしよう。

  • Then what needs to happen is that that information needs to be passed into all of your DSP algorithms.

    そして、その情報をすべてのDSPアルゴリズムに渡す必要がある。

  • So it knows that it needs to recompute those calculations.

    そのため、これらの計算を再計算する必要があることがわかる。

  • Okay, so that's why this prepare to play method is so important.

    なるほど、だからこのプレーの準備方法が重要なのだ。

  • The next method release resources is actually one that I haven't used in my travels, but I imagine I should probably use it a little bit more.

    次のリソース公開方法は、実は私が旅先で使ったことがないものだが、もう少し使うべきだろうと想像している。

  • So release resources is that sometimes you have a situation where maybe you, you aren't processing audio through your plugin, or you're not doing anything with the plugin, but you want to be able to, but let's say it's a memory hog and you want to be able to take that memory and free it up.

    リソースを解放するというのは、プラグインでオーディオを処理していない、あるいはプラグインで何もしていない、でもできるようにしたい、でもメモリを大量に消費するのでそのメモリを解放したい、というような状況を想定することです。

  • You can do that here and release resources.

    ここでリソースを解放することができる。

  • Once again, one that I haven't really used, but I imagine that it could be useful in certain situations.

    繰り返しになるが、私は実際に使ったことはないが、ある状況下では役に立つだろうと想像している。

  • This Boolean function is buses layout supported is one that the DAW calls to make sure that when you're trying to put a plugin on a track, that the configuration of your DAW matches the configuration of your plugin.

    このブール関数はバスレイアウトに対応しており、トラックにプラグインを入れようとするときに、DAWのコンフィギュレーションがプラグインのコンフィギュレーションと一致していることを確認するためにDAWが呼び出すものです。

  • So if you're, let's say in Pro Tools and you're doing some sort of 5.1 or 7.1 speaker surround system processing, and then you try to load a stereo processing plugin, then what would happen is that this is buses layout supported would return false because it would say, Hey, I'm a stereo plugin.

    例えば、Pro Toolsで5.1または7.1スピーカーのサラウンド・システム処理をしているときに、ステレオ処理プラグインをロードしようとすると、このバス・レイアウトがサポートされていると、「私はステレオ・プラグインです。

  • I can't, I can't work on this 5.1 or 7.1 system.

    この5.1や7.1システムでは仕事ができない。

  • Okay.

    オーケー。

  • So that's what the purpose of this function is going down further to our next method.

    つまり、この関数の目的は次のメソッドに進むことだ。

  • This is probably the most important method in the audio processor class, which is called process block.

    これはおそらく、プロセス・ブロックと呼ばれるオーディオ・プロセッサー・クラスで最も重要なメソッドだ。

  • So process block is where your audio processing actually happens.

    つまり、プロセスブロックは、オーディオ処理が実際に行われる場所です。

  • So what it does is it gives you this buffer, which is your actual audio buffer.

    このバッファは実際のオーディオバッファです。

  • So think of this as almost like a, an empty boat that comes into your, or maybe it's a boat of audio that comes into your, into your plugin, think of your plugin as your dock.

    プラグインをドックだと考えてください。

  • And then let's say that you're doing an audio effect.

    そして、オーディオ・エフェクトをかけるとしよう。

  • Then what would happen is that audio comes into the plugin.

    そうすると、オーディオがプラグインに入ってくる。

  • There's some sort of processing or some sort of change that happens.

    何らかの処理、何らかの変化が起こる。

  • And then the boat leaves with your changed audio and comes out into the DAW.

    そして、ボートは変更されたオーディオと一緒に出て行き、DAWに出てくる。

  • Okay.

    オーケー。

  • So that's what the buffer is.

    だから、それがバッファなんだ。

  • It's actually a, a vector, a stereo vector, typically that, uh, that holds the audio.

    これは実際にはベクターで、ステレオベクターで、通常はオーディオを保持する。

  • You want to do some sort of changes to the audio, and then you want to process, you want to have those come out, uh, out of your plugin.

    オーディオに何らかの変更を加え、それを加工してプラグインから出力したい。

  • Also, you have your mini messages or so if you have, uh, a mini keyboard that's hooked up, this is where your mini messages would be coming in.

    また、ミニ・メッセージ、つまりミニ・キーボードが接続されている場合は、ここにミニ・メッセージが入ります。

  • And this is where you can define, okay, this is what I want the mini messages to do.

    ここで、ミニ・メッセージに何をさせたいかを定義することができる。

  • When I press this key, I want it to play this sample at this particular speed and so on.

    このキーを押したら、このサンプルをこのスピードで演奏する、といった具合に。

  • So that's what happens there.

    そこで何が起こるかだ。

  • Now I'll go into a little bit of detail of some of these things within the audio process block itself.

    では、オーディオ・プロセス・ブロック自体の中にあるこれらの事柄について、少し詳しく説明しよう。

  • So this scoped node to normals is for, is a optimization.

    つまり、この法線にスコープされたノードは、最適化のためのものなのだ。

  • So, uh, the normals is this thing that happens where, uh, when you're processing audio or when you're processing, let's say floating point numbers, let's say that the floating point numbers get very, very small.

    つまり、法線は、オーディオを処理するときや、浮動小数点数を処理するときに、浮動小数点数が非常に小さくなるときに起こるものなんだ。

  • So I'm talking about a number like 0.0004.

    つまり、0.0004のような数字のことだ。

  • Um, what happens is that after a certain stage, uh, what happens is that processing those very small floating point numbers actually gets very expensive for the processor.

    つまり、ある段階を過ぎると、非常に小さな浮動小数点数の処理は、プロセッサにとって非常に高価になるということだ。

  • And you'll see the processor actually spike when this happens.

    そうすれば、プロセッサーがスパイクするのがわかるだろう。

  • So node to normals allows the, uh, allows us to be able to zero out, uh, those very small numbers once they get past a certain point.

    つまり、法線をノードにすることで、あるポイントを超えると、非常に小さな数字をゼロにすることができる。

  • Um, so it's an optimization.

    つまり、最適化なんだ。

  • Then we have these local variables that are just forgetting the number of input and output channels.

    そして、入出力チャンネル数を忘れているだけのローカル変数がある。

  • Um, below this, you have a very function that allows us to clear out any garbage audio that may be in our buffer when we're first starting to, um, to play audio, uh, out of our plugin.

    この下には、プラグインからオーディオを再生し始めるときに、バッファにあるゴミのようなオーディオを消去する機能があります。

  • So it just clears that out and make sure that there's no garbage.

    だから、それをクリアにして、ゴミがないようにするんだ。

  • Cause that could produce very loud artifacting.

    アーチファクトが非常に大きくなる可能性があるからだ。

  • Um, then below this is some, uh, some code code skeleton for, um, your actual audio processing.

    この下に、実際のオーディオ処理のためのコード・スケルトンがあります。

  • When you want to implement your DSP algorithms and do other things, that's where that would typically happen.

    DSPアルゴリズムを実装したり、他のことをしたい場合、通常はそこで行われる。

  • But I will show you how to do that, uh, in further and further tutorials.

    でも、その方法は、もっともっと先のチュートリアルでお見せしますよ。

  • One thing that I will tell you about with this process block is that a lot of people, including myself, when I first started getting into audio programming, I used to think of audio programming as something that happens sample by sample.

    このプロセス・ブロックについて一つお話ししておくと、私も含めて多くの人が、オーディオ・プログラミングを始めたばかりの頃は、オーディオ・プログラミングはサンプルごとに行われるものだと考えていました。

  • Um, so most, I think all DAWs, uh, actually do block size processing, which means that they don't, they don't process audio sample by sample.

    ほとんどのDAWは、ブロック・サイズ・プロセッシングをしていると思うんだけど、それはつまり、サンプルごとにオーディオを処理しないってことなんだ。

  • They process it by buffer number of samples at a time.

    一度にバッファーのサンプル数で処理するのだ。

  • So if your buffer size is set to 128 samples, then it will process 128 samples at one time, then bring in the next 128 samples and so on.

    つまり、バッファ・サイズが128サンプルに設定されている場合、一度に128サンプルを処理し、次の128サンプルを取り込む、という具合だ。

  • Okay.

    オーケー。

  • If it's 512, then it would be 512 samples that it would process at a time.

    もし512なら、一度に処理するサンプル数は512ということになる。

  • Okay.

    オーケー。

  • So this is why, uh, you get where, um, if you're using a MIDI controller and the, it, let's say that the block size, the buffer size is larger.

    だから、MIDIコントローラーを使っていて、ブロック・サイズやバッファ・サイズが大きいとする。

  • Let's say it's like 512 samples per block.

    例えば、1ブロックあたり512サンプルだとしよう。

  • That's why when you, uh, when you press a key or when you do something on the MIDI controller, that the responsiveness is slow, because what happens is that when you're moving your MIDI controller, it has to wait until the next process block to actually receive that MIDI message and something with it, um, before so, so that, um, it'll actually process what you've done.

    MIDIコントローラーでキーを押したり、何かをしたりすると、反応が遅くなるのは、MIDIコントローラーを動かしているときに、次のプロセスブロックがMIDIメッセージを受信するまで待たなければならないからです。

  • So that's why what happens is that typically people that are using MIDI controller, they set their buffer sizes to be as small as possible, because even though that makes the, um, the, it makes the CPU, the, the, the computer need to work harder.

    だから、MIDIコントローラーを使う人は、バッファサイズをできるだけ小さく設定するんだ。

  • Uh, what happens is that you can get tighter responsiveness if you're using a DJ controller, if you're using a MIDI controller.

    DJコントローラーやMIDIコントローラーを使えば、よりタイトなレスポンスが得られる。

  • Um, so just to give you a little bit of an example of how that would typically happen, right?

    では、一般的にどのようなことが起こるのか、少し例を挙げてみましょうか?

  • So let's pull up a calculator and let's say that our sample, uh, our sample rate is 44,100 samples per second.

    では電卓を出して、サンプル・レートが1秒間に44,100サンプルだとしよう。

  • Okay.

    オーケー。

  • So what that means is that our plugin needs to be able, our plugin, our DAW, uh, our computer needs to be able to process 44,100 samples per second.

    つまり、プラグインは、DAWは、コンピューターは、1秒間に44,100サンプルを処理できる必要があるということです。

  • If it doesn't process that, then you'll typically get some type of, um, you'll get some type of unpleasant noise, like a, like a break, or, um, maybe the audio might even stop some type of stuttering effect.

    もしそれが処理されないと、通常、何らかの不快なノイズが発生することになる。

  • So, uh, if your sample rate is set for 44,100, that means it needs to process that amount of samples within one second.

    つまり、サンプルレートが44,100に設定されている場合、1秒間にその量のサンプルを処理する必要があるということだ。

  • So if our process block, um, so let's say that our sample rate is 44,100.

    だから、もし私たちのプロセス・ブロックが、サンプル・レートが44,100だとしよう。

  • Let's say that our buffer size, the one that we set in our DAW, let's say that it's 256, right?

    DAWで設定したバッファーサイズが256だとするよね?

  • So 44,100 is our sample rate.

    つまり、44,100がサンプル・レートだ。

  • If we have 256 samples, um, as our block size, that means that this process block needs to call 172 times per second to be able to produce audio where you don't hear any breaks, where it sounds the way it's supposed to sound.

    ブロックサイズを256サンプルとすると、このプロセス・ブロックは1秒間に172回呼び出す必要がある。

  • Okay.

    オーケー。

  • Now let's take, so that was 256 samples.

    では、256サンプルを見てみよう。

  • Now let's take same sample rate, 44,100.

    同じサンプルレート、44,100で考えてみよう。

  • Let's divide that by 64 samples.

    これを64サンプルで割ってみよう。

  • Okay.

    オーケー。

  • So rather than, I think it was 117, it said it needs to call 689 times per second in order to produce that audio accurately.

    つまり、117回だったと思うが、その音声を正確に出すためには、1秒間に689回呼び出す必要があるということだ。

  • So that's why what happens is that when you're adjusting, let's say you're doing DJ controller that you set your block size, your buffer size to be as small as possible.

    だから、例えばDJコントローラーを調整するときに、ブロックサイズやバッファサイズをできるだけ小さく設定するんだ。

  • Um, that what happens is that if you set your buffer size too small, then what you'll get is breaks within the audio.

    ええと、バッファサイズを小さく設定しすぎると、音声が途切れるんだ。

  • You'll get this artifacting and the audio will stutter and it won't play properly because the, because your computer needs to work harder to call that process block 689 times per second.

    アーチファクトが発生し、オーディオがとぎれとぎれになり、正しく再生されなくなる。

  • And it may not have the power to be able to do that and run all the other things that it needs to run at the same time.

    そして、それを実行し、同時に実行する必要のある他のすべてのことを実行できるパワーを持っていないかもしれない。

  • So that should hopefully give you an insight into, um, just the basics of how the process block runs and, uh, and help give you some intuition on, uh, some of the things that, um, that, that are done there within the process block.

    これで、プロセス・ブロックがどのように実行されるのか、そしてプロセス・ブロックの中でどのようなことが行われるのか、その基本的なことが理解できるだろう。

  • But we'll talk about other things.

    でも、他の話もしよう。

  • There are a lot of rules about the process block things that you're not supposed to do in your code, uh, here in the process block.

    プロセス・ブロックには、コードでやってはいけないルールがたくさんある。

  • So it's a highly optimized piece of code that's meant to run on time and make sure that audio is always producing the way that it was designed to going down a little bit further.

    つまり、高度に最適化されたコードで、時間通りに実行され、オーディオが常に設計された通りに生成されるようにするためのものです。

  • We have these two functions has editor and create editor.

    エディターがある機能とエディターを作成する機能がある。

  • So this is referring to the user interface, the graphics of your plugin.

    つまり、これはユーザーインターフェース、プラグインのグラフィックのことです。

  • Okay.

    オーケー。

  • So what you could do is you could set this has editor defaults.

    そこでできることは、エディターのデフォルトを設定することだ。

  • And that just means that you don't supply the, the, the, the plugin with, um, with your own graphics.

    つまり、プラグインに自分のグラフィックを提供しないということだ。

  • Typically when that happens, what will happen is that your DAW that you instantiate your plugin went in will typically see that.

    通常、このようなことが起こると、プラグインをインスタンス化したDAWがそれを見ることになります。

  • And it'll actually create a generic interface for you.

    そして、実際に汎用的なインターフェイスを作成してくれる。

  • It won't look nice.

    見た目は良くない。

  • It'll just be some simple dials and selector boxes.

    シンプルなダイヤルとセレクターボックスだけだ。

  • But, um, that's what will typically happen below that you have this create editor.

    でも、この作成エディターがあれば、普通はこうなる。

  • And what you can see here is that it returns a new audio plugin, audio processor, editor, editor.

    ここでわかるのは、新しいオーディオ・プラグイン、オーディオ・プロセッサー、エディター、エディターを返すということだ。

  • And what that is, uh, we'll talk about this in future tutorials is where you actually create the graphics for your plugin.

    これは、今後のチュートリアルで説明しますが、プラグインのグラフィックを実際に作成するところです。

  • So this is actually creating an instance of the audio processor editor where your graphics would show up.

    つまり、これはオーディオ・プロセッサ・エディタのインスタンスを作成し、そこにグラフィックを表示させるということです。

  • Okay.

    オーケー。

  • So that's what happens there.

    そこで何が起こるかだ。

  • Then you have get state information and set state information.

    そして、状態情報の取得と状態情報の設定がある。

  • So this is where you would actually be able to save and load presets.

    プリセットの保存と読み込みはここで行う。

  • Okay.

    オーケー。

  • So, uh, we'll do this in a future tutorial as well.

    だから、今後のチュートリアルでこのこともやってみよう。

  • And, uh, we'll show how that works where you can actually, so for example, when you're, when you plug in, let's say that it's, um, so this is actually not so much for, uh, for presets.

    例えば、プラグインするとき、プリセットの場合はそうでもない。

  • This is more for if you're in a DAW, uh, let's say you have a synthesizer loaded and it's in a certain state, the filter is at a certain cutoff and so on that, um, when you close down your project, you want the state of that plugin, the configuration that that's in to be saved.

    これは、DAWでシンセサイザーをロードしていて、それがある状態にあり、フィルターがあるカットオフになっているとします。

  • So that would happen in this, uh, set state information that it would say, okay, the user has saved this synthesizer in this current state.

    つまり、このセット・ステート情報では、オーケー、ユーザーはこのシンセサイザーをこの現在の状態で保存した、と言うことになる。

  • Now we're going to, um, we're going to save it to the project.

    では、プロジェクトに保存します。

  • And then of course, when you reload the project, then you want get state information where it reloads with the right settings.

    そしてもちろん、プロジェクトをリロードしたときに、正しい設定でリロードされた状態情報を取得したい。

  • So that's where that happens.

    だから、そういうことが起こるんだ。

  • Uh, then finally you have, uh, this function that is able to create an instance of the plugin itself called create plugin filter.

    そして最後に、プラグイン自体のインスタンスを作成する関数がある。

  • If we go a little bit further into the code, uh, what we'll see is how, what, how that actually happens.

    コードをもう少し読み進めれば、実際に何がどのように起こるのかがわかるだろう。

  • So as I was saying before, this juice audio processor class is a way for us to be able to write our audio code once, but not need to write it individually for each plugin format that we're trying to do.

    だから、さっき言ったように、このジュース・オーディオ・プロセッサー・クラスは、オーディオ・コードを一度だけ書けば、プラグイン・フォーマットごとに個別に書く必要がなくなるというものなんだ。

  • So typically, if we want to be able to sell a plugin, we want to be able to sell the VST three version of it, the AU version of it, potentially the AAX version of it.

    だから、通常、プラグインを販売する場合、VST 3バージョン、AUバージョン、AAXバージョンを販売できるようにしたい。

  • And we want to be able to do those for windows and Mac.

    そして、ウインドウズでもマックでもできるようにしたい。

  • Right.

    そうだね。

  • So, um, before juice, you used to need to be able to do that separately for each one of the plugin, uh, API APIs.

    つまり、juice以前は、プラグインごとにAPI APIを個別に設定する必要がありました。

  • But what juice has done is that they've nicely encapsulated this in this audio processor class so that when you actually write this once that it'll actually deploy your code and actually wrap it within the, uh, within these different plugin formats, uh, just by hitting a button.

    でもjuiceがやったのは、このオーディオ・プロセッサー・クラスにうまくカプセル化したことで、実際にコードを書いたら、ボタンを押すだけで、コードをデプロイして、さまざまなプラグイン形式にラップしてくれるんだ。

  • So there's a lot that happens under the hood there that you don't really see on the surface.

    だから、表面的には見えないところでいろいろなことが起こっているんだ。

  • So they've done a really nice job of that.

    だから、彼らは本当にいい仕事をしている。

  • I'll show you just a very general overview of how that happens.

    それがどのように起こるのか、ごく一般的な概要をお見せしよう。

  • But, uh, and if you want to have a deeper look, then feel free to take a deeper look.

    でも、あー、もっと深く見たいなら、遠慮なくもっと深く見ればいい。

  • But, um, this is where my knowledge starts to get a little bit hazy here.

    でも、うーん、このあたりから私の知識が少しあやふやになってくるんだ。

  • Um, but going into the juice code itself, I'm going to go into the juice modules.

    ええと、でもジュースのコード自体に入るんだけど、ジュースのモジュールに入ろうと思うんだ。

  • So think of these modules as individual libraries that have been written, um, for, um, for juice.

    つまり、これらのモジュールは、ジュースのために書かれた個々のライブラリだと考えてほしい。

  • Okay.

    オーケー。

  • So juice is really like a collection of different libraries and they have this one that's called juice audio plugin client.

    juiceは本当に様々なライブラリのコレクションのようなもので、juice audio plugin clientというものがある。

  • Now, if you go in here, now you see these different ones for AAX, uh, a U right.

    さて、この中に入ってみると、AAX用のさまざまなものが見えますね。

  • And BST three.

    そしてBST3。

  • So these are all individual, um, SDKs or API APIs that if you wanted to, if you, if, if you wanted to take, for example, the Apple audio unit API, you could write a plugin that you just do and you deploy as an audio unit as just for a U format, but typically people want different formats to be able to satisfy different customers.

    つまり、これらはすべて個別のSDKやAPI APIで、例えばアップルのオーディオ・ユニットAPIを利用しようと思えば、プラグインを書いてオーディオ・ユニットとしてデプロイすることができます。

  • Right.

    そうだね。

  • So here in this, uh, juice audio plugin client.

    それで、このジュースのオーディオ・プラグイン・クライアントの中にあるんだ。

  • So this is kind of the insertion point into where this happens.

    つまり、ここがある種の挿入ポイントなんだ。

  • And you have a whole bunch of configuration options here that I'm not going to go through in this tutorial, but then you have this, uh, create plugin filter.

    このチュートリアルでは説明しませんが、プラグイン・フィルターを作成します。

  • So this is what actually happens when you create a version of your audio plugin.

    オーディオ・プラグインのバージョンを作成すると、実際にこのようなことが起こります。

  • Then what happens is that it calls this function called create plugin filter of type.

    そして、create plugin filter of typeという関数を呼び出す。

  • And then here you have different plugin wrappers for the, for all the different, um, plugin formats.

    そしてここには、さまざまなプラグイン・ラッパーがあり、すべてのプラグイン・フォーマットに対応している。

  • So if I go here into wrapper type, here is where you see wrapper type VST three wrapper type, audio unit, wrapper type, AAX standalone wrapper type, and so on.

    ラッパー・タイプに入ると、VSTの3つのラッパー・タイプ、オーディオ・ユニットのラッパー・タイプ、AAXスタンドアロンのラッパー・タイプなどが表示されます。

  • So this is actually how juice takes your plugin and it wraps it into these different formats and is able to provide you with binaries of all these different types.

    つまり、juiceはプラグインをさまざまなフォーマットに変換し、さまざまなタイプのバイナリを提供できるのです。

  • So really clever stuff.

    実に巧妙だ。

  • Uh, it starts to get a lot lower level from here.

    ええと、ここからかなりレベルが下がる。

  • Uh, so for example, if we go into the VST three, um, into that one, let's just take a look here.

    例えば、VSTの3つを見てみよう。

  • This is where it starts to get outside of my, um, outside of my domain knowledge.

    ここからが僕の、いや、僕の専門外の話になるんだ。

  • And you can see here that there's a lot of, a lot of stuff that goes on here and, um, a lot of, um, code that's a little bit deeper than my, than my experience.

    そして、ここには私の経験よりも少し深いコードがたくさんある。

  • But if you want to take a deeper look there, feel free to have a look, but that's, that's how it happens.

    でも、もっと深く見たければ、遠慮なく見てください。

  • That's how the magic happens.

    そうやってマジックが起こるんだ。

  • Okay.

    オーケー。

  • So there you have it.

    そうだ。

  • That's a general overview of what happens with the juice audio processor.

    これが、ジュース・オーディオ・プロセッサーで起こることの大まかな概要だ。

  • As I mentioned before, this is one of the core classes that you need to know about if you're doing audio processing with juice.

    前にも述べたように、このクラスはjuiceでオーディオ処理をする場合に知っておかなければならない核となるクラスのひとつだ。

  • Uh, I hope that was helpful for you.

    ええと、お役に立てたでしょうか?

  • If you, uh, found that helpful and, um, gain something from that, be sure to give it a like and subscribe, and I will see you next time.

    もし、この記事が役に立ち、何か得るものがあったなら、ぜひ「いいね!」を押して購読してください。

Hey what's up everybody, I'd like to welcome you to another audio programmer tutorial.

皆さん、こんにちは!オーディオ・プログラマーのチュートリアルへようこそ。

字幕と単語
AI 自動生成字幕

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

B1 中級 日本語

JUCE Tutorial 02 - AudioProcessorクラス...JUCEで最も重要なクラスを深く掘り下げる! (JUCE Tutorial 02 - The AudioProcessor Class...A Deeper Dive into the Most Important Class in JUCE!)

  • 34 0
    zack に公開 2025 年 03 月 21 日
動画の中の単語