Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Sine Wave By Ruby
Search
5hun
June 07, 2026
85
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Sine Wave By Ruby
Omotesando.rb #122
5hun
June 07, 2026
Transcript
12 slides
Sine Wave By Ruby Omotesando.rb #122
流行りに乗ってみた • Rubyで音を出したり、光らせたりが流 行っている感じがするので流行りに乗っ てみました。 • 初心者なので今日は、サイン波をならし てみたいと思います。
サイン波とは • サイン波は、一つの周波数成分しか含ま ない音のこと – 純音とも呼ぶ(←専門用語) • 音の中で最も単純でシンプルな波形
サイン波とは その2 • a : 振幅 • f : 周波数[Hz]
• t : 時刻 [s] • θ : 初期位相 [rad] • y(t) = a × sin(2π × f × t + θ)
サンプルコード
サンプルコード
何が出力されているのか • 1から-1の間の数字の配列 • 時間における縦軸(y軸)の位置を表して いる
Math.#sin • Rubyの組み込みライブラリ • sineの計算してくれる https://docs.ruby- lang.org/ja/latest/method/Math/m/sin.ht ml
倍音を重ねる
倍音を遅延して重ねる
これがいわゆる情操教育!? • Rubyの組み込みライブラリを使って簡単 音出し! – 時間の指定 – 周波数の指定 – 音を重ねる
自己紹介 • 5hun • @5hun_s • Rubyエンジニア • 楽器が好き
More Decks by 5hun
See All by 5hun
鉄琴の倍音構成について / On the Overtone Structure of the Glockenspiel
5hun
1
17
シンセ持ってないし組み込みもわからないけど音楽は作りたい人がやっていること / No Synth, No Embedded Skills, Still Making Music
5hun
1
23
Rubyで理解する音響信号処理 音をふわっと立ち上げる編 / Audio Signal Processing in Ruby, Part: Soft Attack Envelopes
5hun
1
67
Rubyで理解する音響信号処理 ADSR編 / Audio Signal Processing in Ruby, Part: ADSR
5hun
1
59
2026年、OSSコントリビュート初心者の歩き方 〜軽い一歩を、軽いままにしないために〜 / oss-contribution-for-beginners-2026
5hun
0
1.7k
Rubyと演奏したい〜その第一歩〜.pdf
5hun
1
95
Array#forty_two
5hun
0
110
与信管理を形にする: Ruby の柔軟性が支える高速データ収集・自動化基盤
5hun
1
440
ぼっちが秘める可能性〜孤高のRubyistが語る交流会サバイバル術〜
5hun
1
74
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
980
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Ethics towards AI in product and experience design
skipperchong
2
460
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
750
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
The Curse of the Amulet
leimatthew05
4
17k
Code Reviewing Like a Champion
maltzj
529
40k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
The Limits of Empathy - UXLibs8
cassininazir
2
780
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k