piano

How to create a completely flexible piano keyboard with HTML and CSS

坚强是说给别人听的谎言 提交于 2020-08-19 10:25:31
问题 I'm trying to create a piano keyboard that will keep it's elements ratios using flex box, but can't seem to make the black notes stay the same width or height once I start changing the window size. Here is a fiddle body{ width: 800px; height: 200px; display: flex; } #kbd { padding: 1%; flex-flow: column; display: flex; flex: 4; } #keys { display: flex; flex: 8; justify-content: center; } .note { flex: 1; display: inline-flex; align-items: center; } .black { justify-content: center; position:

Distinguish between key press and release of MIDI piano input

不打扰是莪最后的温柔 提交于 2020-03-06 03:15:10
问题 I am about to make a little program for a school project that is supposed to recognize the chords that are being played via a MIDI piano input (that's just one part of it). At the moment I got so far that for each press and each release of a key on the midi keyboard I get an object of the class ShortMessage . My question: How do I figure out if the key has been pressed or released? In each case, press and release, the static variable NOTE_OFF does contain the value 128, the variable NOTE_ON

Reading piano notes on Python

£可爱£侵袭症+ 提交于 2020-01-02 04:34:30
问题 I'd like to listen to the port having my midi output device (a piano) with my RPi, running on Debian. I've looked into pygame.midi, I managed to listen to the port, but somehow can not extract all midi information. Please find code below [edited code snippet] EDIT: Fixed, thanks a lot! 回答1: First of all you need to find out which device-id your keyboard has inside pygame. I wrote this little function to find out: import pygame.midi def print_devices(): for n in range(pygame.midi.get_count()):

How to create piano UI in Iphone? [closed]

你说的曾经没有我的故事 提交于 2020-01-01 00:45:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I am newbei in creating such piano based UI application. I am developing an application in which i have to use Piano. How to create piano UI in Iphone? How to create it using Interface builder ? or is there any other way to create the piano? I am in urgent need to create such UI

Tone Generation in Cocoa Touch

断了今生、忘了曾经 提交于 2019-12-29 03:11:26
问题 I need to generate a tone that I can manipulate frequency and wave. The overall goal is to create a basic piano. Does anyone know how I can achieve this? My development platform is the iPhone 2.x 回答1: You could always start with sin waves. :-) #include <cmath> typedef double Sample; typedef double Time; class MonoNote { protected: Time start, duration; virtual void internalRender(double now, Sample *mono) = 0; public: MonoNote(Time s, Time d) : start(s), duration(d) {} virtual ~MonoNote() {}

Slide to and from UIButtons and make them respond

血红的双手。 提交于 2019-12-25 01:07:33
问题 I am creating a semi-piano app in Objective-C for iPhone; it's in fact a diffrent layout MIDI Controller, but I'm still working on the design. I created all of the "keys" with UIButtons, and I want to be able to slide to them or from them to other UIButtons. I read all the similar questions before, but I couldn't make it to work with touchesMoved, Because it only worked from the view if I didn't drag the finger from a UIButton. Thanks in advance, code will be appreciated! 回答1: Are your

Function with input prints out nothing

别说谁变了你拦得住时间么 提交于 2019-12-24 12:17:57
问题 Ok so I'm trying to get z.ExNote() to print out an image (of an 8th note) onto a page of sheet music for an app I'm building. Basically every variable just has to do with the (x,y) coordinates of where the note is to be placed. .ExNote() is a function inside a class Note which translates 5 variables of the Note object (Num, staff, measure, note, notetype) into an x,y coordinate for the image to be placed on. This whole mess takes care of 4 variables for you so you can theoretically input the

How to convert midi files to keypresses (in Python)?

一世执手 提交于 2019-12-12 18:36:53
问题 I'm trying to read a MIDI file and then convert each note (midi number) to a simulated keypress on the keyboard (A,f,h,J,t...). I'm able to read any MIDI file with the python-midi library like this: pattern = midi.read_midifile("example.mid") and I can also simulate keypresses with pywin32 like this: shell = win32com.client.Dispatch("WScript.Shell") shell.SendKeys(key) But I have no idea on how to actually convert midi numbers (that are in midi files) to keypresses. To be more precise I'm

QKeyPress event in PyQt

折月煮酒 提交于 2019-12-09 13:11:19
问题 I am having issues with my software. In my piano software if I keep pressing a key on the keyboard then it is making multiple repeated same tones of that particular key. But actually I need a single tone until the release of that particular key. I'm providing a part of my code that detects the keyPress event and calls the corresponding method. So what should be the changes that I've to do with my code?? def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent and event.key() ==

Reading piano notes on Python

Deadly 提交于 2019-12-05 08:47:58
I'd like to listen to the port having my midi output device (a piano) with my RPi, running on Debian. I've looked into pygame.midi, I managed to listen to the port, but somehow can not extract all midi information. Please find code below [edited code snippet] EDIT: Fixed, thanks a lot! First of all you need to find out which device-id your keyboard has inside pygame. I wrote this little function to find out: import pygame.midi def print_devices(): for n in range(pygame.midi.get_count()): print (n,pygame.midi.get_device_info(n)) if __name__ == '__main__': pygame.midi.init() print_devices() It