[Csnd] Virtual Keyboard and Windows
Date | 2020-11-09 21:26 |
From | tjingboem |
Subject | [Csnd] Virtual Keyboard and Windows |
Hi, the Virtual Keyboard does not appear to work well on the Mac (terminal); it shows an empty window and it can be played by hitting the invisible keys...On Linux (terminal) the Virtual Keyboard works fine. Can someone try the example out on a Windows machine, using the command line, to see if it works?
<CsOptions> ; Select audio/midi flags here according to platform -odac -+rtmidi=virtual -M0 ;;;realtime audio out ;-iadc ;;;uncomment -iadc if realtime audio input is needed too ; For Non-realtime ouput leave only the line below: ; -o sfplay3.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> ; By Menno Knevel - 2020 sr = 44100 ksmps = 32 nchnls = 2 0dbfs = 1 gitwelve ftgen 1, 0, 16, -2, 12, 2, 440, 69, 1, 16/15, 9/8, 6/5, 5/4, 4/3, 7/5, 3/2, 8/5, 5/3, 9/5, 15/8, 2 givife ftgen 2, 0, 16, -2, 5, 2, 261.659, 60, 1, 1.1486, 1.3195, 1.5157, 1.7411, 2.00 giSF sfload "01hpschd.sf2" ; soundfont can be found in examples folder of the manual sfplist giSF gipre sfpreset 0, 0, giSF, 0 instr 1 ; play from score and midi keyboard mididefault 60, p3 midinoteonkey p4, p5 ikey = p4 ivel = p5 aenv linsegr 1, 1, 1, 1, 0 ;envelope icps cpstuni ikey, gitwelve ;12 tones per octave iamp = 0.00001 ;scale amplitude down a lot, due to 0dbfs = 1 iamp *= ivel ;make velocity-dependent aL, aR sfplay3 ivel, ikey, iamp, icps, gipre, 1 aL = aL * aenv aR = aR * aenv outs aL, aR endin instr 2 ; play from score and midi keyboard mididefault 60, p3 midinoteonkey p4, p5 ikey = p4 ivel = p5 aenv linsegr 1, 1, 1, 1, 0 ;envelope icps cpstuni ikey, givife ;5 tones per octave iamp = 0.00001 ;scale amplitude down a lot, due to 0dbfs = 1 iamp *= ivel ;make velocity-dependent aL, aR sfplay3 ivel, ikey, iamp, icps, gipre, 1 aL = aL * aenv aR = aR * aenv outs aL, aR endin </CsInstruments> <CsScore> f0 60 ;play for 60 seconds ;instr.1 using ftable 1 i1 0 1 60 100 i1 + 1 62 < i1 + 1 65 < i1 + 1 69 40 ;instr.2 using ftable 2 i2 5 1 60 100 ; using same notes as instr 1 i2 + 1 62 < i2 + 1 65 < i2 + 1 69 40 e </CsScore> </CsoundSynthesizer> |
Date | 2020-11-10 09:20 |
From | Rory Walsh |
Subject | Re: [Csnd] Virtual Keyboard and Windows |
I just tried the example that ships with Csound for the virtual midi keyboard, virtual.csd and it crashes out for me. Looks like a portaudio error though. WARNING: buffer size should be an integer multiple of ksmps in full-duplex mode *** PortAudio: error: -9998: Invalid number of channels closing device Failed to initialise real time audio output inactive allocs returned to freespace end of score. overall amps: 0.0 0.0 overall samples out of range: 0 0 1 errors in performance Elapsed time at end of performance: real: 1.410s, CPU: 1.410s closing device D:\sourcecode\cmder λ csound --version 0dBFS level = 32768.0 --Csound version 6.15 (double samples) Aug 13 2020 [commit: 18c2c7897425f462b9a7743cee157cb410c88198] libsndfile-1.0.29pre1 end of score. overall amps: 0.0 overall samples out of range: 0 0 errors in performance Elapsed time at end of performance: real: 0.002s, CPU: 0.002s On Mon, 9 Nov 2020 at 21:27, tjingboem <magknevel@gmail.com> wrote:
|
Date | 2020-11-10 09:25 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
Does it crash on Windows or just doesn’t work? On the Mac it’s not going to work correctly as the FLTK widgets no longer work on MacOS. We will have to retire the FLTK widget opcodes or replace by something else. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 10 Nov 2020, at 09:20, Rory Walsh |
Date | 2020-11-10 10:43 |
From | Rory Walsh |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
Sorry Victor, you're right, it doesn't crash, it produces an error message and exits. But I don't think it has anything to do with the virtual keyboard. Looks like a port audio issue. On Tue, 10 Nov 2020 at 09:26, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: Does it crash on Windows or just doesn’t work? |
Date | 2020-11-10 22:11 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
Actually, the FLTK widgets do work on my Mac (Mojave and Catalina). in the Terminal, but not in CsoundQT - they do not crash on CsoundQt, they just appear as a blank panel (I think that the widgets are all there, just invisible) Dr. Richard Boulanger Professor of Electronic Production and Design Berklee College of Music Professional Writing and Technology Division On Tue, Nov 10, 2020 at 4:26 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: Does it crash on Windows or just doesn’t work? |
Date | 2020-11-10 22:16 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
Victor, It might be best to consider retiring the FLTK opcodes, especially now that we have Cabbage and the Widgets in CsoundQt as well. In fact, there is a nice virtual keyboard, that does work, in CsoundQt. But, is there a chance that a virtual keyboard could be designed, that would work in the terminal, that would not be FLTK based? - or should we just recommend, expect and perhaps show how to use Keyboard Apps and Utilities? -R Dr. Richard Boulanger Professor of Electronic Production and Design Berklee College of Music Professional Writing and Technology Division skype: radiobaton facebook: https://www.facebook.com/richard.boulanger.58 about: http://www.boulangerlabs.com/#about about: http://www.csounds.com/community/developers/dr-richard-boulanger/ music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/ Boulanger Labs - http://boulangerlabs.com The Csound Book - http://mitpress.mit.edu/books/csound-book The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book On Tue, Nov 10, 2020 at 4:26 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: Does it crash on Windows or just doesn’t work? |
Date | 2020-11-10 22:28 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] Virtual Keyboard and Windows |
OK - a little more testing - of the virtual keyboard on the Mac The virtual keyboard (in the Terminal) just appears for a moment and disappears. Other FLTK widgets have been working (in the terminal) Dr. Richard Boulanger Berklee College of Music On Tue, Nov 10, 2020 at 4:20 AM Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2020-11-10 22:40 |
From | Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
I have many older compositions that use FLTK widgets from the command line (and intended primarily for Windows). How would these be affected by such a move? On Tue, Nov 10, 2020 at 5:16 PM Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
|
Date | 2020-11-10 22:52 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
Hello Art, For sure we don't want to break any Csound pieces or apps! As I reported, the FLTK widgets do seem to work in the Terminal on the Mac. - there seems to be a problem with the Virtual Keyboard, and I do think that Rory was correct in that it is related to CoreAudio or PortAudio or PortMIDI or CoreMIDI - when it crashes for me, it complains about the wrong number of channels (and I think it is referring to Audio Channels.) Richard Boulanger Berklee On Tue, Nov 10, 2020 at 5:40 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
|
Date | 2020-11-11 00:22 |
From | Kevin Welsh |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
Dr.B - Even if it appears to run, apparently there are issues with FLTK threading interrupting audio processing: https://github.com/csound/csound/issues/1325 Even purely from a terminal, the widgets will show up but are pretty much unusable. For instance, when a slider moves it interrupts the main audio thread, causing very audible dropouts. You can see this if you run the hvs1 example found here and move the slider: https://csound.com/docs/manual/hvs1.html (This is a link to the old example using FLTK, Stefano has an updated example we'll be adding to the manual very soon) On Tue, Nov 10, 2020 at 5:52 PM Dr. Richard Boulanger |
Date | 2020-11-11 04:41 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Virtual Keyboard and Windows |
Thanks Kevin. Yes I do hear the issues. I was hopeful and optimistic about things working with the latest build and OS. Maybe with the new M1 chip? Someday Dr. Richard Boulanger Professor Electronic Production and Design Berklee College of Music > On Nov 10, 2020, at 7:22 PM, Kevin Welsh |