Re: for and ^ question

2021-01-01 Thread Patrick R. Michaud
On Fri, Jan 01, 2021 at 05:41:04PM -0800, ToddAndMargo via perl6-users wrote: > On 1/1/21 6:32 AM, David Santiago wrote: > > say $_ for {0.1+$_}...^5 > > Is there a way to do this without the finger wagging? > > say $_ for {0.1+$_}...^2 If you're going to a sequence operator ("...") instead of

Re: for and ^ question

2021-01-01 Thread ToddAndMargo via perl6-users
On 1/1/21 6:32 AM, David Santiago wrote: say $_ for {0.1+$_}...^5 Hi David, Thank you! Is there a way to do this without the finger wagging? say $_ for {0.1+$_}...^2 Use of uninitialized value of type Any in numeric context in block at line 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1

Re: concurrency of asynchronous events - input from multiple keyboards

2021-01-01 Thread Brad Gilbert
I think the simplest way to turn that into a Supply is to use the `supply` keyword my $pm = Audio::PortMIDI.new; my $input = supply { my $stream = $pm.open-input($input-device-number, 32); DONE { $stream.close; } loop { emit

Re: concurrency of asynchronous events - input from multiple keyboards

2021-01-01 Thread Vadim Belman
As it seems that Audio::PortMIDI lacks non-blocking interface, I think a solution would be to read events in a dedicated thread and re-submit them into a Supplier. Something like: my Supplier $midi-events; start { loop { my $ev = $midi.read; $midi-events.emit: $ev; } }

concurrency of asynchronous events - input from multiple keyboards

2021-01-01 Thread Nathan Gray
I am working on a small virtual organ program, where I have multiple MIDI controller keyboards which can be connected to one or more synthesizer channels to emit various sounds simultaneously. At this point, I am able to read events from a single MIDI controller and send the events to the correct

Re: for and ^ question

2021-01-01 Thread David Santiago
> for .1^...5 {print "$_\n";} 1.1 2.1 3.1 4.1 both still increments by 1 What am I doing wrong? do this if you want to increment by 0.1: say $_ for {0.1+$_}...^5 Best regards, David Santiago

Re: for and ^ question

2021-01-01 Thread ToddAndMargo via perl6-users
On 1/1/21 3:23 AM, Kevin Pye wrote: ..^ is an operator. You can't put spaces in the middle of an operator. > for ^2.1..4.5 {print "$_\n";} Range objects are not valid endpoints for Ranges in block at line 1 > for 2.1^..4.5 {print "$_\n";} 3.1 4.1 > for .1^...5 {print "$_\n";} 1.1 2.1 3.1

Re: for and ^ question

2021-01-01 Thread Kevin Pye
..^ is an operator. You can't put spaces in the middle of an operator. On Fri, 1 Jan 2021 at 22:13, ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > >> On Fri, 1 Jan 2021 at 18:59, ToddAndMargo via perl6-users > >> mailto:perl6-users@perl.org>> wrote: > >> > >> >> ^ note:

Re: for and ^ question

2021-01-01 Thread ToddAndMargo via perl6-users
On Fri, 1 Jan 2021 at 18:59, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: >> ^ note: ^3 means the integer "just before" 3 (zero is presume to be the >> start point) >> >>3^ means the integer "just after" 3 (an ending