Re: Script launcher and a suite of basic scripts for music production?

2023-01-19 Thread Brian Durant

On 1/18/23 18:35, Luke A. Call wrote:

On 2023-01-18 16:51:28+0100, Brian Durant  
wrote:

On 1/18/23 11:46, Abhishek Chakravarti wrote:

Brian Durant  writes:

The only disadvantage that I can see at this point, is that what I am
describing would require a number of open terminals on the desktop,
which can be confusing to sort through, particularly during a live
performance.


Although not a direct answer to your question, perhaps tmux(1) might be
helpful here? You could have one tmux session window split into several
panes. Cycling through the panes is quite simple with PREFIX + o (the
default PREFIX being CTRL+b; in my case it's mapped to CTRL+o


Thanks for that. I haven't played around with tmux for ages, but you are
correct that could potentially help with terminal clutter. Below are a few
[]


FWIW I have my tmux set up to use Alt+#  (alt+1, alt+2...) key
combinations to switch among tmux panes more easily under X than using Ctrl+b
every time, which might be helpful if efficiency is important.  It is
also easier for me to put in muscle memory. I can provide details off-list if 
desired.


Thank you for that generous offer. However, before we go there, I think 
that there is a need to be more specific (to the extent that I can) at 
this point, regarding my use case scenario. This can be divided between 
audio (baritone saxophone, bass and singing) and MIDI (a class compliant 
launchpad type controller and a class compliant MIDI keyboard). midish 
looks like a very strong contender, but there are two issues that I am 
unclear about:

1) Can Fluidsynth instruments be changed on the fly when using midish?
2) Can MIDI events be used to trigger sndio and ffmpeg actions on the 
system? Here I am thinking of the possibility of using my controller pad 
as an alternative to a script launcher.


The audio side is in many ways more clear cut. I need to be able to 
record saxophone, voice and bass (I am unfortunately limited to two of 
these at a time with my current hardware.). The input through the sound 
card would need to be monitored (when live) and be recorded to file for 
use as loops with basic sound effects (ffmpeg?).


Sooo the big question with relevance to tmux, is how many terminal 
instances do I need for this scenario? I know my instruments, but as 
stated, I am a new user to OpenBSD, so I am trying to wrap my head 
around this scenario. I am cautiously optimistic, as (to my 
understanding) Ableton Live and Launchpads use scripts (hidden behind 
proprietary mumbo jumbo and GUI) so it should be possible to do this in 
OpenBSD as well.


Any input on how many terminal instances I will need, particularly with 
reference to audio, but also the MIDI in my scenario will be very much 
appreciated, as this will help me nail down my need for using tmux, a 
script editor, or something completely different to test this scenario 
in action on OpenBSD.




Re: Script launcher and a suite of basic scripts for music production?

2023-01-18 Thread Luke A. Call
On 2023-01-18 16:51:28+0100, Brian Durant  
wrote:
> On 1/18/23 11:46, Abhishek Chakravarti wrote:
> > Brian Durant  writes:
> > > The only disadvantage that I can see at this point, is that what I am
> > > describing would require a number of open terminals on the desktop,
> > > which can be confusing to sort through, particularly during a live
> > > performance.
> > 
> > Although not a direct answer to your question, perhaps tmux(1) might be
> > helpful here? You could have one tmux session window split into several
> > panes. Cycling through the panes is quite simple with PREFIX + o (the
> > default PREFIX being CTRL+b; in my case it's mapped to CTRL+o
> 
> Thanks for that. I haven't played around with tmux for ages, but you are
> correct that could potentially help with terminal clutter. Below are a few
> []

FWIW I have my tmux set up to use Alt+#  (alt+1, alt+2...) key
combinations to switch among tmux panes more easily under X than using Ctrl+b
every time, which might be helpful if efficiency is important.  It is
also easier for me to put in muscle memory. I can provide details off-list if 
desired.



Re: Script launcher and a suite of basic scripts for music production?

2023-01-18 Thread Crystal Kolipe
On Wed, Jan 18, 2023 at 04:51:28PM +0100, Brian Durant wrote:
> Record audio from USB sound card:
> $ aucat -o /home/user/Music/set/1 - ?.wav
> 
> Playback audio file:
> $ aucat -i /home/user/Music/set/1 - ?.wav

You might want to specify the encoding and other parameters rather than rely
on the defaults, which might change.

Last year I had to fix a problem for a company who were recording VoIP calls
on an OpenBSD system with a simple shell script that invoked aucat twice to
record the local and remote audio via separate sndio subdevices.

(So the resulting file was stereo, with the local audio on the left channel
 and the remote party on the right channel.)

When the VoIP program ended, the audio was trimmed of digital silence, and
then compressed with FLAC, (the choice of which was quite lucky, as you will
shortly see).

The problem is that they were writing to raw, headerless files rather than
wav or au, which I understand was done to make it easier to write the
digital silence trimming program.

At some point last year, in revision 1.178 of aucat.c, the default file
encoding was changed from 16-bit to 24-bit.

After upgrading to OpenBSD 7.1, their call recording script continued
processing the data as 16-bit, but nobody checked that the call recordings
were actually audible.

As you can imagine, since the incoming data was actually 24-bit, and yet
the two streams were being interleaved as if they were two 16-bit channels,
the end result was, if I remember rightly, very bad distortion in the left
channel, and pure noise in the right channel.

They only noticed the problem after about three weeks because the FLAC
processes were taking up a lot more CPU than before, (because they were
effectively trying to compress noise).

I had to study the exact transformations that their home-grown scripts and
programs had performed *, write code to reverse that, decompress all of the
FLAC files, (preserving the call metadata that was also stored in them),
fix the audio, then re-compress them all with FLAC again.

All because:

1. The defaults changed.
2. Their scripts assumed that the defaults would not change.

* It was more complicated than it sounds, because the trimming of the digital
silence had on some occasions caused further mangling of the data, since it
was cutting at the wrong point, and not even at sample boundaries.

If the audio data has been compressed with a lossy algorithm, it would have
been impossible to recover it.  Luckily that was not the case.



Re: Script launcher and a suite of basic scripts for music production?

2023-01-18 Thread Brian Durant

On 1/18/23 11:46, Abhishek Chakravarti wrote:


Hello!

Brian Durant  writes:


The only disadvantage that I can see at this point, is that what I am
describing would require a number of open terminals on the desktop,
which can be confusing to sort through, particularly during a live
performance.


Although not a direct answer to your question, perhaps tmux(1) might be
helpful here? You could have one tmux session window split into several
panes. Cycling through the panes is quite simple with PREFIX + o (the
default PREFIX being CTRL+b; in my case it's mapped to CTRL+o


Thanks for that. I haven't played around with tmux for ages, but you are 
correct that could potentially help with terminal clutter. Below are a 
few thoughts about scripts for music. I will avoid flooding the list 
with all of my ideas but will simply provide a couple of basic ones. 
Note that I am new to OpenBSD and have little experience with scripting:


OpenBSD music scripts

Scan midi/ values (from dmesg or...) and route them to midithru/0 
similar to manual commands below:
(Is there a use case scenario for rerouting midi/1 - ? by use of 
midithru/1 -?)


$ midicat -d -q midi/0 -q midithru/0
$ midicat -d -q midi/1 -q midithru/0


Record audio from USB sound card:
$ aucat -o /home/user/Music/set/1 - ?.wav

Playback audio file:
$ aucat -i /home/user/Music/set/1 - ?.wav

To my knowledge, most USB sound cards have at least two inputs (for 
microphone and guitar / bass as examples). Important that any script is 
input sensitive and can automatically number files for each input in 
order for possible playback with effects by using a simple alias created 
automatically for the purpose, for the session (?) Also important that 
monitoring is possible during file creation to avoid pauses while 
performing a set.




Re: Script launcher and a suite of basic scripts for music production?

2023-01-18 Thread Abhishek Chakravarti


Hello!

Brian Durant  writes:

> The only disadvantage that I can see at this point, is that what I am
> describing would require a number of open terminals on the desktop,
> which can be confusing to sort through, particularly during a live
> performance. 

Although not a direct answer to your question, perhaps tmux(1) might be
helpful here? You could have one tmux session window split into several
panes. Cycling through the panes is quite simple with PREFIX + o (the
default PREFIX being CTRL+b; in my case it's mapped to CTRL+o

-- 
Abhishek Chakravarti
abhis...@taranjali.org | Kolkata, IN
fifthestate.co.in | refpersys.org | taranjali.org



Script launcher and a suite of basic scripts for music production?

2023-01-17 Thread Brian Durant
Is there a script launcher that can be used for basic scripts to 
facilitate live (or close to live) music performances with OpenBSD? One 
of the reasons that I am a proponent of using OpenBSD with music, is the 
fact that much can be done simply, from the command line. Recording 
audio from a USB sound card, using ffmpeg to add reverb and basic 
effects, rerouting MIDI, switching instruments in Fluidsynth (still 
working on that one), potentially replaying audio files as clips, etc. 
There are a lot of possibilities that could be facilitated by a script 
launcher (and a suite of basic scripts) for new music creators trying 
out OpenBSD, would definitely be an asset.


The only disadvantage that I can see at this point, is that what I am 
describing would require a number of open terminals on the desktop, 
which can be confusing to sort through, particularly during a live 
performance. Which is part of the reason that a script launcher would be 
useful. The advantages are many, first and foremost fitting in with the 
Unix philosophy of combining existing programs for new purposes, 
providing an open source alternative to commercial DAWs such as Ableton 
and Bitwig, while at the same time removing the frustration for some 
users that the only DAW available on OpenBSD is LMMS, as well as the 
temptation for some to try to compile Zrythm or another DAW to OpenBSD.


Ideas or suggestions?