Python Forum
Values into system calls (RPi 4 Raspbian Buster Thonny)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Values into system calls (RPi 4 Raspbian Buster Thonny)
#1
import os
import time
os.system ("sudo modprobe snd-virmidi")
os.system ("aconnect 20:00 128:00")
b0=str(hex(12*12))[2:4]
b1=str(hex(5*12))[2:4]
b2=str(hex(100+27))[2:4]
while True:
  print (b0)
  print (b1)
  print (b2)
  os.system ("amidi -p hw:1,0 -S 'b0 b1 b2'")
  time.sleep(1)
This prints out the right values (90 3c 7f)
But the midi doesn't respond
If I replace b0 b1 b2 (next to last line) with 90 3c 7f
the synth plays ........... ??????????
Reply


Messages In This Thread
Values into system calls (RPi 4 Raspbian Buster Thonny) - by hitsware - Aug-26-2019, 11:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Sonar Code in Thonny for Pi Pico iansmiler 1 391 Nov-22-2023, 12:27 PM
Last Post: deanhystad
  Calls to Attributes of a Class SKarimi 3 3,457 Apr-22-2021, 04:18 PM
Last Post: SKarimi
  Difference between os.system("clear") and os.system("cls") chmsrohit 7 16,759 Jan-11-2021, 06:30 PM
Last Post: ykumar34
  Minimal python install for thonny ide DanielRossinsky 0 1,536 Jun-11-2020, 02:31 PM
Last Post: DanielRossinsky
  Does "import xlrd" work in Thonny? cnutakor 3 3,045 Apr-30-2020, 12:41 AM
Last Post: Larz60+
Question Difference between Python's os.system and Perl's system command Agile741 13 6,967 Dec-02-2019, 04:41 PM
Last Post: Agile741
  Need help with a function that calls other functions. skurrtboi 4 2,584 Sep-30-2019, 09:28 PM
Last Post: stullis
  Deluge (Python 2.7) on Raspbian with YARSS2 - certificate_transparency error Matt872000 0 1,557 Apr-21-2019, 02:39 AM
Last Post: Matt872000
  Testing function calls jenselme 1 2,715 Jul-25-2018, 10:33 AM
Last Post: Larz60+
  function state between calls Skaperen 5 5,183 Feb-08-2018, 02:20 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020