Pure Data pitch bend for every note - audio

It seems that Pd has only a global MIDI pitch bend control. How can I send different pitch bend events for individual notes?
In Pd extended I made a simple patch that reads from MIDI in and writes the same note to MIDI out. Now I would like to change the pitch bend event individually for every incoming note according to a look up table, so the MIDI out note is bent differently depending on the MIDI in note.
Any ideas?

Pitch bend is a channel voice message meaning that it applies to the entire channel thus there is no direct way to do what you want. The only possible solution is pretty indirect and it would be using multiple channels, each configured to play the same sound then splitting the incoming notes among them such that only one note was playing at a time on each channel. A classic example of this approach is a MIDI pickup for a guitar - the ones with a pickup for each string. They assign each pickup to a discreet MIDI channel and then they can map string bends to pitch bends for the individual strings (sometimes poorly).

It's a limitation of the MIDI protocol, depending on what you want to do, you might want to look into OSC (OpenSoundControl), HD-MIDI or simply FUDI.

so it seems that you are aware of the limitations of MIDI (only a single pitch-bend parameter per channel), but would like to shape the pitchbend value individually for each note.
assume you have created 128 tables (named "bend1" .. "bend128"), each 16383 values long, containing a lookup table to convert between input pitchbend values (-8192..+8192) and output pitchbend values (from -1..+1), then you could do something like:
[notein 1]
| |
[t b f] |
| +---------+ |
| | |
| [bendin 1] | |
| | | |
[f ] [t f f] |
| | | |
[+ 8192] [set array$1( | |
| ______________+ | |
|/ / |
[tabread] / |
| / |
[* 12] / |
| / |
[+ ] |
| |
[noteout 1]
this will modify each MIDI-note based on an individually shaped pitch-bend value.
the main drawback is, that [noteout] will send MIDI-notes (which due to the limitations of MIDI can only be integer values), so the output will be quantized to semi-tones :-(
however, if you are doing the synth within Pd, then you can use fractal note-values: just send them to [mtof] to get a frequency from the MIDI-notenumber and send it to your favourite [osc~].

With pure data, you can work around this by using a midi CC to do real time pitch shifting instead or assign "note aftertouch" for this purpose.

Related

Building dependent picklist by finding associated rows

I have a need for a dependent picklists. The outputted workbook is actually created programmatically which does restrict the way this needs to be built (I'm trying to create everything in Excel first and then finish the programmatic output of the sheet).
I have rows that need dropdowns representing Objects and Fields in a database. So dropdown1 would contain a list of Objects and dropdown2 depends on that to display a list of Fields based on that object.
I have a Ledger sheet containing the data that needs to be represented. Something like this:
| A | B | C |
|--------|--------|---------------|
| People | People | First Name |
| Places | People | Last Name |
| Things | People | Phone Number |
| | People | Email Address |
| | Places | Longitude |
| | Places | Latitude |
| | Things | Color |
| | Things | Shape |
The A column contains all the Objects (People, Places, Things) and is used to populate all the dropdown1's. The B & C columns are used to represent the fields - B being the Object the field belongs to and C being the FieldName. So if I choose People in dropdown1 I want dropdown 2 to contain only values from C that apply to People (First Name, Last Name, Phone Number, Email Address)
I'm struggling to make this work. In another sheet I have succeeded in listing out the values that I would want in dropdown2 using the following formula (where A2 refers to dropdown1) - =IFERROR(INDEX(Ledger!C2:C1000,SMALL(IF(A2=Ledger!B2:B1000, ROW(Ledger!C2:C1000)-1,""), ROW()-1)), "") - but I haven't been able to actually make this work when creating a dropdown (via Data Validation button in excel). How can I get this into a dropdown in excel?

How to combine and split cells in tabulator.js

I need to create a complex tabular structure. The table is built using the tabulator.js library. But I can not find in the documentation how to combine or split the cells.
I want to create something like this:
|---------------------------------------------|
| TITLE | TERM START | TERM END |
|---------------------------------------------|
| | term_1_start | term_1_end |
| year_1 |-------------------------------|
| | term_2_start | term_2_end |
|---------------------------------------------|
| year_2 | not avalibe |
|---------------------------------------------|
Or there may be some other library that can easily handle it.
Would column groups work for you?:
http://tabulator.info/examples/4.3#column-groups
Currently not feasible because Tabulator.js uses DIVs to create HTML elements.
Unfortunately div has not colspan/rowspan attribute.
If you see the Developer Roadmap you can check the Version 5.0 which contain that the following description:
Coll Span Functionality
Row Span Functionality

Excel Countif with wildcards in searched array

I've searched for a while, but it looks like all the examples I find are the opposite of what I need. There are many ways to see if a string with wildcards matches any of the values in an array, but I need to go the other way - I need the array to contain wildcards, and check if the string in the target cell matches any of the match strings in the array, but the match strings can contain wild cards.
To put it in context, I am parsing large log files, and there are many lines I wish to ignore (but not delete); so I have a helper column:
+---+-------+----------------------------------------+----------------------------+
| | A | B | C (filter for = FALSE) | Requirement
+---+-------+----------------------------------------+----------------------------+
| 1 | 11:00 | VPN Status | =COUNTIF(IgnoreList,B1)>0 + Keep
| 2 | 11:05 | Log at event index 118, time index 115 | =COUNTIF(IgnoreList,B2)>0 + Ignore
| 3 | 11:20 | Log at event index 147, time index 208 | =COUNTIF(IgnoreList,B3)>0 + Ignore
+---+-------+----------------------------------------+----------------------------+
I've tried to put wildcards in my IgnoreList range to catch any of the "Log at event" lines:
+--------------------------------------+
| IgnoreList +
+--------------------------------------+
| State Runtime 1 +
| State Runtime 2 +
| State Runtime 3 +
| State Runtime 4 +
| Log at event index *, time index * +
+--------------------------------------+
... but this isn't working.
Does anyone know how to check a cell against an array containing wildcards?
My IgnoreList has 60 entries so far, so testing each cell individually isn't really feasible. I could have 30,000 or more entries in the log, so individual testing will be a lot more formulas than I'd hoped to use. I also don't want to edit the formulae when I add an entry to the IgnoreList.
Thanks for your help!
Use SEARCH, which allows wild card lookups, inside SUMPRODUCT:
=SUMPRODUCT(--ISNUMBER(SEARCH(IgnoreList,B1)))>0
To use COUNTIF one would need to reverse the criteria and wrap in SUMPRODUCT:
=SUMPRODUCT(COUNTIF(B1,IgnoreList))>0

Can't return multiple values of same input using VLOOKUP/INDEX/MATCH

I've tried searching online to solve this problem but cannot seem to find an appropriate solution to this problem I have.
I am trying to find all of the MAC addresses connected to each Switch in a network.
I am doing this in excel and have the following sample data:
+--------------+------------+--------+
| Mac Address | Switch | Port |
+--------------+------------+--------+
| 00144f601fdf | 6553DC-HA1 | Gi4/42 |
| 00144f601fdf | 6554DC-LA1 | Gi6/1 |
| 00144f601ff2 | 1123DC-MA1 | Gi8/34 |
| 00144f601ff2 | 6554DC-LA1 | Gi6/1 |
| 00144f601ff3 | 1123DC-MA1 | Gi8/35 |
| 00144f601ff3 | 6554DC-LA1 | Gi6/1 |
| 00144f685d38 | 1123DC-MA1 | Gi8/44 |
| 00144f685d38 | 6554DC-LA1 | Gi5/1 |
+--------------+------------+--------+
I have tried using VLOOKUP but obviously that only returns the first value, i've tried playing around with INDEX and MATCH but I haven't got anywhere helpful.
Ideally I'd like to see:
00144f601fdf = 6553DC-HA1
= 6554DC-LA1
00144f601ff2 = 1123DC-MA1
= 6554DC-LA1
And so on... any help on this matter or suggestions for potential solutions would be greatly appreciated!
Your example "I'd like to see" shows all of the switches for each mac address, but your request is for "all of the MAC addresses connected to each Switch."
Assuming your example is what you want to see, then you can insert a column in Excel between the "MAC Address" and "Switch" columns and use a formula in the new column to show MAC addresses only when they change.
If the rows are already sorted by MAC Address, and MAC Address is column A, the formula is
=IF(A2=A1,"",A2)
Just paste that in each cell of the new column and it will how the MAC Address entry only the first time it appears - the result will look like your example above.
fyi if you want a more compressed result, use unique() and transpose() with (optionally) concatenate(). Example at this Google sheet.
If the data is structure like in your example I recommend mike's answer.
If it is unordered you can use the following approach which will always return two results:
In D1: =VLOOKUP(A12,$A$2:$C$9,2,FALSE) (fairly obvious)
In D2:
=VLOOKUP(A12,
OFFSET($A$2,
MATCH(A12,$A$2:$A$9,0),
0,
COUNTA($A$2:$A$9) - MATCH(A12,$A$2:$A$9,0),
2),
2,
FALSE)
This offsets the range to after the first matched MAC address and resizes it to the end of the supplied range (In case you have more stuff below) and runs the VLOOKUP on that.

Specific concatenation of text cells by formula

I'm having difficulty producing a CONCATENATE formula that combines text cells in the way that I want. There are five fields that I want to concatenate: Title, Forename, RegnalNumber, Surname, and Alias, in that order. I'm no regex expert, so excuse the poor formatting, but this is a rough way of expressing what I'm trying to achieve:
(title)? (forename) (regnalnumber)? (surname)?, (alias).
The only field that can't be null is the forename field, although it might have the value "?", in which case it shouldn't output anything in the concatenation, i.e. it should be treated as blank. Hopefully the following test cases should demonstrate the output I'm trying to achieve: the output on the right is what it should look like:
| Title | Forename | RN | Surname | Alias | CONCATENATE |
+--------+----------+----+-----------+--------------+---------------------------------------+
| Ser | Jaime | | Lannister | Kingslayer | Ser Jaime Lannister, Kingslayer |
| | Pate | | | | Pate |
| Lord | ? | | Vance | | Lord Vance |
| King | Aerys | II | Targaryen | The Mad King | King Aerys II Targaryen, The Mad King |
| Lord | Jon | | Arryn | | Lord Jon Arryn |
| | Garth | | | Of Oldtown | Garth, Of Oldtown |
I've experimented for ages trying to make this concatenation work, but haven't been able to get it right. This is the current formula, with cell references replaced by the field name for comprehensibility:
=CONCATENATE(IF(Title<>"",Title&" ",""),IF(AND(Forename<>"",Forename<>"?"),Forename,""),IF(RN<>""," "&RN,""), IF(OR(AND(Forename<>"", Forename<>"?"), Surname<>"", RN<>""), " ",""), IF(Surname<>"",Surname,""),IF(AND(Alias<>"",OR(Alias<>"",AND(Forename<>"", Forename<>"?"),Surname<>"")),", "&Alias, Alias))
There is one case where it doesn't work: if the Surname and RN are null but the the Forename and Alias are non-null. For example, if the Forename is Garth, and the Alias is Of Oldtown, the concatenation outputs: Garth , Of Oldtown. It's the same if the title is non-null. It shouldn't have a space before the comma.
Can you help me to fix this formula so it works as expected? If you can find a way to simplify it, even better! I know I'm probably overcomplicating this a great deal. I'm using LibreOffice Calc 4.3.1.2, not Excel.
The best way imho to solve situations like this is to divide the problem over multiple simple columns, rather than 1 huge complex formula. Remember you can always hide the columns that you don't want to see.
So create a column for Title that says =if(a2="","",a2&" ").
That can be extended for all the other columns, except:
for Forename, where you want to include the "?" as follows: =if(b2="?","",b2&" ")
for Alias, where you want to include the leading ",": =if(e2="","",", "&e2)
Lastly just concatenate each of your working columns with something like: =f2&g2&h2&i2&j2.
This breaks the problem down into very simple components, and makes it easy to debug. If you want to add extra functionality at a later stage, it is easy to swap out one of your formulae for something else.
I know this is only a bit of fun, but can I suggest a more algorithmic approach?
The algorithm is:-
If a field is empty or ?, do nothing
Else
If concatenation so far is empty, add field to concatenation
Else
Add a space followed by the field to concatenation
which leads to this formula in G2 :-
=IF(OR(A2="",A2="?"),F2,IF(F2="",A2,F2&" "&A2)
(need to put single apostrophes in column F to make it work)
which when copied across looks like this:-

Resources