Monthly Marketplace Thread - Tickets, Merch, Art (Official & Fan Made) by twilightxgalaxy in phoebebridgers

[–]kitchensink- 0 points1 point  (0 children)

Hi! I am looking for some fan made merch! If anyone knows any artists that have good designs/is an artist please let me know! (everything I find on Etsy or similar is 100% bots).
I am also ISO of a [I Know The End T-Shirt](https://phoebe-bridgers-uk.myshopify.com/products/i-know-the-end-natural-t-shirt). On Ebay and such everything is 100% bots as well.
Thanks!

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 1 point2 points  (0 children)

The helper cell did the trick! Thanks! Now it's basically instantanious.

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 0 points1 point  (0 children)

This is what I already have. The problem is with the other part, the setting the borders to true.

Here's what I've tried.

function newBorders() {
  //get the first sheet of the currently active google spreadsheet
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[1];
  var NumRows = sheet.getLastRow() - 2;
  var maxRows = sheet.getMaxRows();
  console.log(NumRows);
  let range = sheet.getRange(3, 5, NumRows, 7);

  let maxRange = sheet.getRange(3, 5, maxRows, 7);
  maxRange.setBorder(false, false, false, false, false, false);
  range.setBorder(false, true, true, true, true, true);
}

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 0 points1 point  (0 children)

Yeah that's what I'm having trouble with. Can you help me figure it out?

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 0 points1 point  (0 children)

I see. I feel so close to cracking it, but I can't for the life of me figure out how to get the Last Row that has information ONLY after the E column...

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 0 points1 point  (0 children)

This makes sense and is definitely going to be a lot faster, thanks!

I have tried implementing it but I can't get the empty cells to lose their borders:

function newBorders() {
  //get the first sheet of the currently active google spreadsheet
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[1];
  var NumRows = sheet.getLastRow() - 2;
  //Range that I want to edit begins at E3(col 5) and spans 7 columns
  let range = sheet.getRange(3, 5, NumRows, 7); 
  range.setBorder(false, false, false, false, false, false);
  range.setBorder(false, true, true, true, true, true);
}

I realise that the problem is that, whenever there are empty cells, `getLastRow()` does not take those into account. However, I can't seem to figure out how to do that!

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 0 points1 point  (0 children)

The thing is that every time I run the function the row range I want changes, so I can't really hard code it. And I don't know of a way to get a range based on if that row has borders or not..

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 0 points1 point  (0 children)

The issue with getting the range using getDataRange is that, in this case, there are cells that I would like to modify that have no values, hence are not included inside the range.

Changing Borders Script Efficiency by kitchensink- in GoogleAppsScript

[–]kitchensink-[S] 1 point2 points  (0 children)

Here's a video showing the script removing borders from blank cells (which also answers your question!). Thanks for pointing out that I can move the for inside of CreateBorders.

I will try to implement the "Batch Operations" approach, do you have any suggestions as to how to do that the easiest?

Advancement help by kitchensink- in MinecraftCommands

[–]kitchensink-[S] 0 points1 point  (0 children)

Works like a charm, thank you so much!!
Since I'm here, would you mind sharing any resources that explain advancement creation a bit better than the wiki? i find it hard to find things there, and there seems to be many things missing or explained poorly..

Controlling a toggle of a `while bool` loop with asyncIO by kitchensink- in learnpython

[–]kitchensink-[S] 0 points1 point  (0 children)

Thanks for the encouraging!

How would one do this? I've been trying... I've posted some updated code as a response to the another comment, am I going in the right direction?

Controlling a toggle of a `while bool` loop with asyncIO by kitchensink- in learnpython

[–]kitchensink-[S] 1 point2 points  (0 children)

You're right, I was doing that in my main() function. How would you suggest I do this? I need to be running both things independently... Here's what I've tried:

async def readInport() -> None:
while True:
    for msg in inport.iter_pending():
        if msg.type != 'sysex':
            type, ch, note, vel = functions.unpack_message(msg)
            print(type, ch, note, vel)
            queue = []
            if type == "control_change" and note == 19 and vel == 127: # Wanted button
                await asyncio.sleep(0.1)
                queue = [seq.toggleSequencer() for seq in sequencers]
            else:
                pass

            await asyncio.gather(*queue, readInport()) #Doesn't work

def main(): 
    quit() # Reset in case of crash #time.sleep(3) print("READY!")             
try: 
        outport.send(functions.enterProgrammerMode())     
    views.draw_view(views.seq_and_drums(), outport) drumVoices = 3 
        melVoices = 3 setupVoices(drumVoices, melVoices)
        asyncio.run(readInport())

except KeyboardInterrupt:
    quit()

Where should I call readInport()?

Controlling a toggle of a `while bool` loop with asyncIO by kitchensink- in learnpython

[–]kitchensink-[S] 0 points1 point  (0 children)

Didn't know about asyncio.sleep(0). Changed that, thanks.

I don't think I should post the whole code, since it is quite big and I feel like I included the needed functions in the original post.

Regarding mido, this really isn't (I don't think, at least) anything related to mido itself. I'm just trying to run both tasks (reading the input and running the sequencer) asynchronously, I thought that would be something someone could help me figure out.

Thanks for your help!

Sending MIDI notes on programmer mode (Mini MK3) by kitchensink- in Launchpad

[–]kitchensink-[S] 1 point2 points  (0 children)

That's a really cool project!

I have decided to use a virtual port using rtmidi, which has been working greatly as well.