Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pythonใงMIDIใŒๅ†็”Ÿใงใใชใ„ใจใใซใ‚„ใฃใŸใ“ใจ

1
Last updated at Posted at 2023-06-04

็ต่ซ–

ใ‚นใƒ”ใƒผใ‚ซใซใคใชใŒใฃใฆใ„ใ‚‹ใจๆ€ใฃใฆใ„ใŸใƒใƒผใƒˆใŒใ€ไธญ็ถ™ๆฉŸ๏ผˆMIDIใ‚นใƒซใƒผ๏ผ‰ใ ใฃใŸใ€‚
TiMidity++ใ‚’่ตทๅ‹•ใ—ใ€ๅ‡บๅŠ›ๆฉŸๅ™จใ‚’ไฝœๆˆใ—ใŸใ‚‰ๅ†็”ŸใงใใŸใ€‚
image.png
โ†“TiMidity++ใ‚’่ตทๅ‹•
image.png

็’ฐๅขƒ

  • OS
    • Ubuntu 22.04 x86_64

ไบ‹่ฑก

MIDIใ‚’ๅ‹‰ๅผทใ—ใŸใใฆใ€pythonใฎmidoใƒฉใ‚คใƒ–ใƒฉใƒชใ‚’ไฝฟใฃใฆใฟใพใ—ใŸใ€‚
ใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซ้€šใ‚ŠๅฎŸๆ–ฝใ™ใ‚‹ใ‚‚ใ€ใ‚นใƒ”ใƒผใ‚ซใ‹ใ‚‰้ŸณใŒๅ‡บใšใ€ๅ›ฐใฃใฆใ„ใพใ—ใŸใ€‚
ใ‚นใ‚ฏใƒชใƒ—ใƒˆใฏใ‚จใƒฉใƒผใชใๅ‹•ใ„ใฆใ„ใ‚‹ใฎใงใ€้Ÿณๅฃฐๅ‡บๅŠ›ใพใ‚ใ‚Šใง่ชฟๆŸปใ—ใฆใ„ใใพใ—ใŸใ€‚

midoใƒฉใ‚คใƒ–ใƒฉใƒชใ‚’ไฝฟ็”จใ—ใ€MIDIใƒใƒผใƒˆใ‚’ไธ€่ฆงใ‚’ๅ‡บๅŠ›ใ—ใฆใฟใพใ—ใŸใ€‚

$ python       
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mido
>>> print(mido.get_output_names())
['Midi Through:Midi Through Port-0 14:0', 'Midi Through:Midi Through Port-0 14:0']

MIDIใฎใƒ‰ๅˆๅฟƒ่€…ใชใฎใงใ€ใƒใƒผใƒˆใฏไฝ•ใงใ‚‚ใ„ใ„ใ‹ใชใจๆ€ใฃใฆใ„ใพใ—ใŸใŒใ€ใ“ใ“ใŒใ ใ‚ใ ใฃใŸใฟใŸใ„ใงใ™ใ€‚
ใฉใฎOSใซใ‚‚ๅ…ฑ้€šใ—ใฆใ€MIDIใ‚’PCใฎใ‚นใƒ”ใƒผใ‚ซใ‹ใ‚‰ๅ†็”Ÿใ™ใ‚‹ใŸใ‚ใซใฏใ€ไปฎๆƒณ็š„ใชMIDIๅ‡บๅŠ›ใƒใƒผใƒˆใ‚’็”จๆ„ใ—ใชใ‘ใ‚Œใฐใชใ‚Šใพใ›ใ‚“ใงใ—ใŸใ€‚

ๅฎŸๆ–ฝไบ‹้ …

Timidity++ใฎๅ…ฌๅผใ‚ตใ‚คใƒˆใฎๆ‰‹้ †้€šใ‚Šใ€ใ‚คใƒณใ‚นใƒˆใƒผใƒซใ—ใพใ—ใŸใ€‚
ใใฎๅพŒใ€ไธ‹่จ˜ใฎใ‚ณใƒžใƒณใƒ‰ใงtimidity++ใ‚’ๅฎŸ่กŒใ—ใพใ—ใŸใ€‚

$ timidity -iA

ๅ†ๅบฆMIDIใƒใƒผใƒˆใ‚’็ขบ่ชใ—ใ€ๅข—ใˆใฆใ„ใ‚‹ใ“ใจใ‚’็ขบ่ช

$ python       
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mido
>>> print(mido.get_output_names())
['Midi Through:Midi Through Port-0 14:0', 'Midi Through:Midi Through Port-0 14:0', 'TiMidity:TiMidity port 0 129:0', 'TiMidity:TiMidity port 1 129:1', 'TiMidity:TiMidity port 2 129:2', 'TiMidity:TiMidity port 3 129:3']

ไธŠ่จ˜ใฎ่จญๅฎšๅพŒใซใ€midiใฎใƒใƒฅใƒผใƒˆใƒชใ‚ขใƒซใงใ€TiMidityใฎใƒใƒผใƒˆใ‚’้ธๆŠžใ—ใ€ใ‚นใ‚ฏใƒชใƒ—ใƒˆใ‚’ๅ‹•ใ‹ใ—ใŸใจใ“ใ‚ใ€ใใกใ‚“ใจๅ†็”Ÿใ•ใ‚Œใพใ—ใŸใ€‚

ใกใชใฟใซใ€aconnectguiใ‚’ไฝฟใ†ใจGUIใงMIDIใƒใƒผใƒˆใ‚’็ขบ่ชใ€ๆ“ไฝœใงใใพใ™ใ€‚
ใ‚นใ‚ฏใ‚ทใƒงใฏใ€ๅŒใ‚ฝใƒ•ใƒˆใ‚’ไฝฟ็”จใ—ใ€ไฝœๆˆใ—ใพใ—ใŸใ€‚
image.png
PythonใงMIDIใ‚’ๅ†็”Ÿใ™ใ‚‹ใจใ€RtMidiOut ClientใŒTiMidityใฎไปฎๆƒณใƒใƒผใƒˆใซๅ‡บๅŠ›ใ•ใ‚Œใฆใ„ใ‚‹ใ“ใจใ‚’็ขบ่ชใ—ใพใ—ใŸใ€‚

ๅ‚่€ƒ่ณ‡ๆ–™

ใจใฆใ‚‚ๆ„Ÿ่ฌใ—ใฆใ„ใพใ™ใ€‚
MIDI ไปฎๆƒณใ‚ญใƒผใƒœใƒผใƒ‰ใจ็‰ฉ็†ใ‚ญใƒผใƒœใƒผใƒ‰ใ‚’ Ubuntu ใง่ฉฆใ™

MACใฎๅ ดๅˆใฏใ“ใกใ‚‰ใฎๅฏพๅฟœใŒๅฟ…่ฆใใ†ใงใ™ใ€‚
Outputting MIDI sound from Python Mido library on Mac

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

@zakuzakuzaki's pickup articles

zakuzakuzaki

@zakuzakuzaki

ๆŠ€่ก“ใจใ‚ขใ‚คใƒ‡ใ‚ขใงไบบใฎๅฟƒใ‚’ๅ‹•ใ‹ใ™ใ“ใจใ‚’ใƒขใƒƒใƒˆใƒผใจใ—ใฆใ„ใพใ™ใ€‚ ็พๅœจใ€ไธ€ไบบๅจ˜ใ‚’่‚ฒใฆใชใŒใ‚‰ใƒญใƒœใƒƒใƒˆ็ณปใฎไผš็คพใงใƒ•ใƒซใ‚นใ‚ฟใƒƒใ‚ฏใ‚จใƒณใ‚ธใƒ‹ใ‚ข็›ฎๆŒ‡ใ—ใ€ไฟฎ่กŒไธญใ€‚ ๅธธใซๅ…ˆ้€ฒๆŠ€่ก“ใ‚’ๅญฆใฐใชใ‘ใ‚Œใฐใ„ใ‘ใชใ„่ทๆฅญใงใ™ใŒใ€ๅฅฝใใช่จ€่‘‰ใฏใ€Œๆžฏใ‚ŒใŸๆŠ€่ก“ใฎๆฐดๅนณๆ€่€ƒใ€

Today's trending articles

Comments

No comments

Let's comment your feelings that are more than good

Being held Article posting campaign

1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address