Skip to content

Commit

Permalink
minor updates related with py4pd
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesneimog committed Feb 4, 2024
1 parent 6d1d351 commit 2f6d2d5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
24 changes: 13 additions & 11 deletions README.deken.pd
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#N canvas 842 116 945 768 8;
#N canvas 842 116 588 418 8;
#X obj 15 4 py4pd -lib orchidea;
#X obj 14 46 orchidea.config;
#X msg 14 24 /home/neimog/Onedrive/Documents/MusicData/Samples/OrchideaSOL2020, f 66;
#X obj 15 89 else/keyboard 17 80 1 4 0 0 empty empty;
#X obj 15 173 stripnote;
#X msg 22 203 sharp;
#X obj 15 283 list;
#X obj 15 325 readsf~;
#X obj 15 355 dac~;
#X msg 15 304 open \$1 \, 1;
#X obj 15 225 else/pitch2note sharp;
#X msg 128 224 doc;
#X obj 15 262 orchidea.flute C4 p 1;
#X text 126 259 Note \, dynamics \, technique number.;
#X text 150 224 <= See the techniques numbers.;
#X msg 24 223 sharp;
#X obj 15 312 list;
#X obj 15 354 readsf~;
#X obj 15 384 dac~;
#X msg 15 333 open \$1 \, 1;
#X obj 15 254 else/pitch2note sharp;
#X msg 128 253 doc;
#X obj 15 291 orchidea.flute C4 p 1;
#X text 126 288 Note \, dynamics \, technique number.;
#X text 150 253 <= See the techniques numbers.;
#X text 355 22 <= Where is the folder of orchideaSol.;
#X text 97 46 FIRST CLEAR HERE \, RESTART PD;
#X obj 24 201 loadbang;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 10 0;
Expand All @@ -27,3 +28,4 @@
#X connect 10 0 12 0;
#X connect 11 0 12 0;
#X connect 12 0 6 0;
#X connect 17 0 5 0;
16 changes: 14 additions & 2 deletions orchidea.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import pd
import json
import platform

import pd

from src.Brass import *
from src.Keyboards import *
from src.PluckedStrings import *
from src.Strings import *
from src.Winds import *
from src.PluckedStrings import *


def orchideaConfig(path):
Expand All @@ -14,10 +17,19 @@ def orchideaConfig(path):
Set the path to orchidea samples.
'''
# check if last char of the path is / for linux and mac or \\ for windows
if platform.system() == "Windows":
if path[-1] != "\\":
path += "\\"
elif platform.system() == "Linux" or platform.system() == "Darwin":
if path[-1] != "/":
path += "/"

scriptPath = os.path.dirname(os.path.realpath(__file__))
# check if there is config.json inside the script folder
configPath = os.path.join(scriptPath, "config.json")
json.dump({"orchideaSolPath": path}, open(configPath, "w"))
pd.print("Path added!")


def orchidea(note, dyn, orchideaNumber, orchideaString):
Expand Down

0 comments on commit 2f6d2d5

Please # to comment.